(from: string, specifier: string)
| 29 | const packageDir = resolve(dirname(fileURLToPath(import.meta.url)), '..') |
| 30 | |
| 31 | function resolveSourceImport(from: string, specifier: string) { |
| 32 | const resolved = resolve(dirname(from), specifier) |
| 33 | const withoutJsExtension = specifier.endsWith('.js') |
| 34 | ? resolved.slice(0, -'.js'.length) |
| 35 | : resolved |
| 36 | const candidates = [ |
| 37 | resolved, |
| 38 | `${withoutJsExtension}.ts`, |
| 39 | resolve(withoutJsExtension, 'index.ts'), |
| 40 | ] |
| 41 | |
| 42 | return candidates.find((candidate) => existsSync(candidate)) |
| 43 | } |
| 44 | |
| 45 | function collectStaticImportGraph(entry: string) { |
| 46 | const visited = new Set<string>() |
no outgoing calls
no test coverage detected