* @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)
| 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. |
no test coverage detected