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

Function createSyntheticImport

test/fixtures/snapshot/typescript.js:117959–117970  ·  view source on GitHub ↗
(text, file)

Source from the content-addressed store, hash-verified

117957 : b.kind === 10 /* SyntaxKind.StringLiteral */ && a.text === b.text;
117958 }
117959 function createSyntheticImport(text, file) {
117960 var externalHelpersModuleReference = ts.factory.createStringLiteral(text);
117961 var importDecl = ts.factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference, /*assertClause*/ undefined);
117962 ts.addEmitFlags(importDecl, 67108864 /* EmitFlags.NeverApplyImportHelper */);
117963 ts.setParent(externalHelpersModuleReference, importDecl);
117964 ts.setParent(importDecl, file);
117965 // explicitly unset the synthesized flag on these declarations so the checker API will answer questions about them
117966 // (which is required to build the dependency graph for incremental emit)
117967 externalHelpersModuleReference.flags &= ~8 /* NodeFlags.Synthesized */;
117968 importDecl.flags &= ~8 /* NodeFlags.Synthesized */;
117969 return externalHelpersModuleReference;
117970 }
117971 function collectExternalModuleReferences(file) {
117972 if (file.imports) {
117973 return;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…