MCPcopy Index your code
hub / github.com/nodejs/node / markSymbolOfAliasDeclarationIfTypeOnly

Function markSymbolOfAliasDeclarationIfTypeOnly

test/fixtures/snapshot/typescript.js:50864–50878  ·  view source on GitHub ↗

* Marks a symbol as type-only if its declaration is syntactically type-only. * If it is not itself marked type-only, but resolves to a type-only alias * somewhere in its resolution chain, save a reference to the type-only alias declaration * so the alias _not_ marked type-

(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty)

Source from the content-addressed store, hash-verified

50862 * must still be checked for a type-only marker, overwriting the previous negative result if found.
50863 */
50864 function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) {
50865 if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration))
50866 return false;
50867 // If the declaration itself is type-only, mark it and return.
50868 // No need to check what it resolves to.
50869 var sourceSymbol = getSymbolOfNode(aliasDeclaration);
50870 if (ts.isTypeOnlyImportOrExportDeclaration(aliasDeclaration)) {
50871 var links_1 = getSymbolLinks(sourceSymbol);
50872 links_1.typeOnlyDeclaration = aliasDeclaration;
50873 return true;
50874 }
50875 var links = getSymbolLinks(sourceSymbol);
50876 return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty)
50877 || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty);
50878 }
50879 function markSymbolOfAliasDeclarationIfTypeOnlyWorker(aliasDeclarationLinks, target, overwriteEmpty) {
50880 var _a, _b, _c;
50881 if (target && (aliasDeclarationLinks.typeOnlyDeclaration === undefined || overwriteEmpty && aliasDeclarationLinks.typeOnlyDeclaration === false)) {

Calls 3

getSymbolOfNodeFunction · 0.85
getSymbolLinksFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…