Skip to content

Commit 097a784

Browse files
committed
Support targets without declarations
1 parent 2658808 commit 097a784

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/services/exportInfoMap.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ namespace ts {
186186
function key(importedName: string, symbol: Symbol, moduleName: string, checker: TypeChecker) {
187187
const unquoted = stripQuotes(moduleName);
188188
const moduleKey = isExternalModuleNameRelative(unquoted) ? "/" : unquoted;
189-
const target = skipAlias(symbol, checker);
190-
return `${importedName}|${createSymbolKey(target)}|${moduleKey}`;
189+
const targetKey = symbol.flags & SymbolFlags.Alias ? createSymbolKey(skipAlias(symbol, checker)) : moduleName;
190+
return `${importedName}|${targetKey}|${moduleKey}`;
191191
}
192192

193193
function parseKey(key: string) {
@@ -203,7 +203,9 @@ namespace ts {
203203
key += `,${symbol.parent.name}`;
204204
symbol = symbol.parent;
205205
}
206-
return `${key},${getSourceFileOfNode(symbol.declarations![0]).fileName}`;
206+
const decl = symbol.declarations?.[0];
207+
const fileName = decl && getSourceFileOfNode(decl).fileName;
208+
return `${key},${fileName}`;
207209
}
208210

209211
function fileIsGlobalOnly(file: SourceFile) {

0 commit comments

Comments
 (0)