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

Function checkGrammarImportClause

test/fixtures/snapshot/typescript.js:89131–89140  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

89129 return ambientModulesCache;
89130 }
89131 function checkGrammarImportClause(node) {
89132 var _a;
89133 if (node.isTypeOnly && node.name && node.namedBindings) {
89134 return grammarErrorOnNode(node, ts.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
89135 }
89136 if (node.isTypeOnly && ((_a = node.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 269 /* SyntaxKind.NamedImports */) {
89137 return checkGrammarNamedImportsOrExports(node.namedBindings);
89138 }
89139 return false;
89140 }
89141 function checkGrammarNamedImportsOrExports(namedBindings) {
89142 return !!ts.forEach(namedBindings.elements, function (specifier) {
89143 if (specifier.isTypeOnly) {

Callers 1

checkImportDeclarationFunction · 0.85

Calls 2

grammarErrorOnNodeFunction · 0.85

Tested by

no test coverage detected