dsherret / dsherret/ts-morph

why module name judge like this?

Open
#1,509 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
6.2k
Forks
238
Avg merge
2m
Merged PRs (30d)
1

Description

**Describe the bug**

Version: 21.0.1

sourceText:
```typescript
declare module '@x/y' {};
```

judge:
```typescript
const modules = sourceFile.getModules();

modules.forEach(m => {
if (m.getName() === "'@x/y'") {
console.log('enter');
}
});
```
so, Why ? "'@x/y'" instead of '@x/y'?

And:
```ts
const t = sourceFile.getModule('@x/y'); // => undefined ?
const t = sourceFile.getModule("'@x/y'"); // => it works...
```
**Expected behavior**
'@x/y'

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.