why module name judge like this?
fantian007 opened this issue · comments
赵永盛 commented
Describe the bug
Version: 21.0.1
sourceText:
declare module '@x/y' {};
judge:
const modules = sourceFile.getModules();
modules.forEach(m => {
if (m.getName() === "'@x/y'") {
console.log('enter');
}
});
so, Why ? "'@x/y'" instead of '@x/y'?
And:
const t = sourceFile.getModule('@x/y'); // => undefined ?
const t = sourceFile.getModule("'@x/y'"); // => it works...
Expected behavior
'@x/y'
赵永盛 commented
I'm confused...
David Sherret commented
These two module names are distinct:
declare module "example" {}
declare module example {}
That said, perhaps it should be normalizing single quotes to double quotes.