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

Function visitImportClause

test/fixtures/snapshot/typescript.js:93834–93840  ·  view source on GitHub ↗

* Visits an import clause, eliding it if its `name` and `namedBindings` may both be elided. * * @param node The import clause node.

(node)

Source from the content-addressed store, hash-verified

93832 * @param node The import clause node.
93833 */
93834 function visitImportClause(node) {
93835 ts.Debug.assert(!node.isTypeOnly);
93836 // Elide the import clause if we elide both its name and its named bindings.
93837 var name = shouldEmitAliasDeclaration(node) ? node.name : undefined;
93838 var namedBindings = ts.visitNode(node.namedBindings, visitNamedImportBindings, ts.isNamedImportBindings);
93839 return (name || namedBindings) ? factory.updateImportClause(node, /*isTypeOnly*/ false, name, namedBindings) : undefined;
93840 }
93841 /**
93842 * Visits named import bindings, eliding them if their targets, their references, and the compilation settings allow.
93843 *

Callers

nothing calls this directly

Calls 2

assertMethod · 0.80

Tested by

no test coverage detected