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

Function getImportKind

test/fixtures/snapshot/typescript.js:153523–153531  ·  view source on GitHub ↗

* @param forceImportKeyword Indicates that the user has already typed `import`, so the result must start with `import`. * (In other words, do not allow `const x = require("...")` for JS files.)

(importingFile, exportKind, compilerOptions, forceImportKeyword)

Source from the content-addressed store, hash-verified

153521 * (In other words, do not allow `const x = require("...")` for JS files.)
153522 */
153523 function getImportKind(importingFile, exportKind, compilerOptions, forceImportKeyword) {
153524 switch (exportKind) {
153525 case 0 /* ExportKind.Named */: return 0 /* ImportKind.Named */;
153526 case 1 /* ExportKind.Default */: return 1 /* ImportKind.Default */;
153527 case 2 /* ExportKind.ExportEquals */: return getExportEqualsImportKind(importingFile, compilerOptions, !!forceImportKeyword);
153528 case 3 /* ExportKind.UMD */: return getUmdImportKind(importingFile, compilerOptions, !!forceImportKeyword);
153529 default: return ts.Debug.assertNever(exportKind);
153530 }
153531 }
153532 codefix.getImportKind = getImportKind;
153533 function getUmdImportKind(importingFile, compilerOptions, forceImportKeyword) {
153534 // Import a synthetic `default` if enabled.

Callers 2

createExistingImportMapFunction · 0.85
getNewImportFixesFunction · 0.85

Calls 2

getUmdImportKindFunction · 0.85

Tested by

no test coverage detected