(value: string)
| 116 | } |
| 117 | |
| 118 | function tryFileUrlToPath(value: string): string | null { |
| 119 | if (!value.startsWith('file:')) { |
| 120 | return null; |
| 121 | } |
| 122 | |
| 123 | try { |
| 124 | return fileURLToPath(value); |
| 125 | } catch (error) { |
| 126 | log('warn', `Failed to parse file URL path: ${value}. ${String(error)}`); |
| 127 | return null; |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | function normalizePathValue(value: string, cwd: string): string { |
| 132 | const fileUrlPath = tryFileUrlToPath(value); |
no test coverage detected