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

Function getNamespaceLikeImportText

test/fixtures/snapshot/typescript.js:153241–153253  ·  view source on GitHub ↗
(declaration)

Source from the content-addressed store, hash-verified

153239 }
153240 }
153241 function getNamespaceLikeImportText(declaration) {
153242 var _a, _b, _c;
153243 switch (declaration.kind) {
153244 case 254 /* SyntaxKind.VariableDeclaration */:
153245 return (_a = ts.tryCast(declaration.name, ts.isIdentifier)) === null || _a === void 0 ? void 0 : _a.text;
153246 case 265 /* SyntaxKind.ImportEqualsDeclaration */:
153247 return declaration.name.text;
153248 case 266 /* SyntaxKind.ImportDeclaration */:
153249 return (_c = ts.tryCast((_b = declaration.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings, ts.isNamespaceImport)) === null || _c === void 0 ? void 0 : _c.name.text;
153250 default:
153251 return ts.Debug.assertNever(declaration);
153252 }
153253 }
153254 function getAddAsTypeOnly(isValidTypeOnlyUseSite, isForNewImportDeclaration, symbol, targetFlags, checker, compilerOptions) {
153255 if (!isValidTypeOnlyUseSite) {
153256 // Can't use a type-only import if the usage is an emitting position

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected