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

Function createRequireCall

test/fixtures/snapshot/typescript.js:105087–105094  ·  view source on GitHub ↗

* Creates a `require()` call to import an external module. * * @param importNode The declararation to import.

(importNode)

Source from the content-addressed store, hash-verified

105085 * @param importNode The declararation to import.
105086 */
105087 function createRequireCall(importNode) {
105088 var moduleName = ts.getExternalModuleNameLiteral(factory, importNode, currentSourceFile, host, resolver, compilerOptions);
105089 var args = [];
105090 if (moduleName) {
105091 args.push(moduleName);
105092 }
105093 return factory.createCallExpression(factory.createIdentifier("require"), /*typeArguments*/ undefined, args);
105094 }
105095 /**
105096 * Visits an ImportEqualsDeclaration node.
105097 *

Callers 6

visitImportDeclarationFunction · 0.85
visitExportDeclarationFunction · 0.85
makeImportOrRequireFunction · 0.85
filterImportFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected