(specifier: string, importer: string)
| 102 | } |
| 103 | // e.g. a module another hook loads, code given to node --eval, or a file without an extension |
| 104 | const untransformedProblemOf = (specifier: string, importer: string) => { |
| 105 | if (!importer.startsWith("file:")) |
| 106 | return writeFilelessImportMessage(importer, specifier) |
| 107 | const file = fileURLToPath(importer) |
| 108 | if (isTransformed(file) || dependencyOf(file)) return |
| 109 | const cwd = realPathOf(opts?.cwd ?? process.cwd()) |
| 110 | return existsSync(file) ? |
| 111 | writeUntransformedImportMessage(file, specifier, cwd) |
| 112 | : writeFilelessImportMessage(printablePathOf(cwd, file), specifier) |
| 113 | } |
| 114 | module.registerHooks({ |
| 115 | resolve: (specifier, context, nextResolve) => { |
| 116 | if (specifier.startsWith("~arktype/")) |
no test coverage detected