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

Function addExports

test/fixtures/snapshot/typescript.js:162275–162286  ·  view source on GitHub ↗
(sourceFile, toMove, needExport, useEs6Exports)

Source from the content-addressed store, hash-verified

162273 return ts.factory.createCallExpression(ts.factory.createIdentifier("require"), /*typeArguments*/ undefined, [moduleSpecifier]);
162274 }
162275 function addExports(sourceFile, toMove, needExport, useEs6Exports) {
162276 return ts.flatMap(toMove, function (statement) {
162277 if (isTopLevelDeclarationStatement(statement) &&
162278 !isExported(sourceFile, statement, useEs6Exports) &&
162279 forEachTopLevelDeclaration(statement, function (d) { return needExport.has(ts.Debug.checkDefined(d.symbol)); })) {
162280 var exports = addExport(statement, useEs6Exports);
162281 if (exports)
162282 return exports;
162283 }
162284 return statement;
162285 });
162286 }
162287 function deleteUnusedImports(sourceFile, importDecl, changes, isUnused) {
162288 switch (importDecl.kind) {
162289 case 266 /* SyntaxKind.ImportDeclaration */:

Callers 1

Calls 6

isExportedFunction · 0.85
addExportFunction · 0.85
flatMapMethod · 0.80
hasMethod · 0.65

Tested by

no test coverage detected