MCPcopy Create free account
hub / github.com/nodejs/node / getModuleSpecifierText

Function getModuleSpecifierText

test/fixtures/snapshot/typescript.js:153716–153721  ·  view source on GitHub ↗
(promotedDeclaration)

Source from the content-addressed store, hash-verified

153714 }
153715 }
153716 function getModuleSpecifierText(promotedDeclaration) {
153717 var _a, _b;
153718 return promotedDeclaration.kind === 265 /* SyntaxKind.ImportEqualsDeclaration */
153719 ? ((_b = ts.tryCast((_a = ts.tryCast(promotedDeclaration.moduleReference, ts.isExternalModuleReference)) === null || _a === void 0 ? void 0 : _a.expression, ts.isStringLiteralLike)) === null || _b === void 0 ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText()
153720 : ts.cast(promotedDeclaration.parent.moduleSpecifier, ts.isStringLiteral).text;
153721 }
153722 function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile) {
153723 // See comment in `doAddExistingFix` on constant with the same name.
153724 var convertExistingToTypeOnly = compilerOptions.preserveValueImports && compilerOptions.isolatedModules;

Callers 1

codeActionForFixWorkerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected