* A JS/TS `imports` reference to the module of an import named by one bare * segment — `'config'` in `import { DEFAULT_THEME_MODE } from 'config'` under * `"baseUrl": "src"`. Shaped like a package, it names a file only when * resolveImportPath finds one (the app's `baseUrl` or catch-all `paths`,
(ref: UnresolvedRef, context: ResolutionContext)
| 2865 | * binds locally is that binding, not the module, and resolves as one. |
| 2866 | */ |
| 2867 | function isJsBareModuleRef(ref: UnresolvedRef, context: ResolutionContext): boolean { |
| 2868 | if (ref.referenceKind !== 'imports' || !ESM_IMPORT_LANGUAGES.has(ref.language) || isJsPathSpecifier(ref.referenceName)) return false; |
| 2869 | const imports = context.getImportMappings(ref.filePath, ref.language); |
| 2870 | return imports.some((m) => m.source === ref.referenceName) && !imports.some((m) => m.localName === ref.referenceName); |
| 2871 | } |
| 2872 | |
| 2873 | /** |
| 2874 | * The file a JS/TS module reference names, the way resolveViaImport reads it: |
no test coverage detected