(filepath: string)
| 192 | const CHAR_FORWARD_SLASH = 47 |
| 193 | |
| 194 | function toFileUrl(filepath: string) { |
| 195 | const outURL = new URL("file://") |
| 196 | let resolved = resolve(filepath) |
| 197 | // path.resolve strips trailing slashes so we must add them back |
| 198 | const filePathLast = filepath.charCodeAt(filepath.length - 1) |
| 199 | if ( |
| 200 | (filePathLast === CHAR_FORWARD_SLASH) && |
| 201 | resolved[resolved.length - 1] !== "/" |
| 202 | ) { |
| 203 | resolved += "/" |
| 204 | } |
| 205 | outURL.pathname = encodePathChars(resolved) |
| 206 | return Effect.succeed(outURL) |
| 207 | } |
| 208 | |
| 209 | const percentRegEx = /%/g |
| 210 | const backslashRegEx = /\\/g |
nothing calls this directly
no test coverage detected