(modulePath)
| 40 | } |
| 41 | |
| 42 | export const resolveImportModulePath = function (modulePath) { |
| 43 | // 1. If it's an absolute path, convert to a file:// URL |
| 44 | if (path.isAbsolute(modulePath)) { |
| 45 | return pathToFileURL(modulePath).href; |
| 46 | } |
| 47 | |
| 48 | // 2. If it's a relative path (starts with ./ or ../), resolve it fully |
| 49 | if (modulePath.startsWith('./') || modulePath.startsWith('../')) { |
| 50 | return modulePath |
| 51 | } |
| 52 | |
| 53 | // 3. Otherwise, it's likely a bare NPM module (e.g., 'chai', 'codeceptjs') |
| 54 | // Let Node.js resolve it natively from node_modules |
| 55 | return modulePath; |
| 56 | } |
| 57 | |
| 58 | export const fileExists = function (filePath) { |
| 59 | return fs.existsSync(filePath) |
no outgoing calls
no test coverage detected