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

Function rewriteModuleSpecifier

test/fixtures/snapshot/typescript.js:54095–54120  ·  view source on GitHub ↗
(parent, lit)

Source from the content-addressed store, hash-verified

54093 : "arg".concat(index);
54094 }
54095 function rewriteModuleSpecifier(parent, lit) {
54096 if (bundled) {
54097 if (context.tracker && context.tracker.moduleResolverHost) {
54098 var targetFile = getExternalModuleFileFromDeclaration(parent);
54099 if (targetFile) {
54100 var getCanonicalFileName = ts.createGetCanonicalFileName(!!host.useCaseSensitiveFileNames);
54101 var resolverHost = {
54102 getCanonicalFileName: getCanonicalFileName,
54103 getCurrentDirectory: function () { return context.tracker.moduleResolverHost.getCurrentDirectory(); },
54104 getCommonSourceDirectory: function () { return context.tracker.moduleResolverHost.getCommonSourceDirectory(); }
54105 };
54106 var newName = ts.getResolvedExternalModuleName(resolverHost, targetFile);
54107 return ts.factory.createStringLiteral(newName);
54108 }
54109 }
54110 }
54111 else {
54112 if (context.tracker && context.tracker.trackExternalModuleSymbolOfImportTypeNode) {
54113 var moduleSym = resolveExternalModuleNameWorker(lit, lit, /*moduleNotFoundError*/ undefined);
54114 if (moduleSym) {
54115 context.tracker.trackExternalModuleSymbolOfImportTypeNode(moduleSym);
54116 }
54117 }
54118 }
54119 return lit;
54120 }
54121 }
54122 }
54123 function symbolTableToDeclarationStatements(symbolTable, context, bundled) {

Calls 3

pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…