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

Function createAllExportExpressions

test/fixtures/snapshot/typescript.js:105320–105334  ·  view source on GitHub ↗
(name, value, location)

Source from the content-addressed store, hash-verified

105318 return ts.singleOrMany(statements);
105319 }
105320 function createAllExportExpressions(name, value, location) {
105321 var exportedNames = getExports(name);
105322 if (exportedNames) {
105323 // For each additional export of the declaration, apply an export assignment.
105324 var expression = ts.isExportName(name) ? value : factory.createAssignment(name, value);
105325 for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) {
105326 var exportName = exportedNames_2[_i];
105327 // Mark the node to prevent triggering substitution.
105328 ts.setEmitFlags(expression, 4 /* EmitFlags.NoSubstitution */);
105329 expression = createExportExpression(exportName, expression, /*location*/ location);
105330 }
105331 return expression;
105332 }
105333 return factory.createAssignment(name, value);
105334 }
105335 /**
105336 * Transforms an exported variable with an initializer into an expression.
105337 *

Callers

nothing calls this directly

Calls 2

createExportExpressionFunction · 0.85
getExportsFunction · 0.70

Tested by

no test coverage detected