(relativePath: string)
| 20 | const WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g; |
| 21 | |
| 22 | const relativePathToRequest = (relativePath: string): string => { |
| 23 | if (relativePath === '') { |
| 24 | return './.'; |
| 25 | } |
| 26 | if (relativePath === '..') { |
| 27 | return '../.'; |
| 28 | } |
| 29 | if (relativePath.startsWith('../')) { |
| 30 | return relativePath; |
| 31 | } |
| 32 | return `./${relativePath}`; |
| 33 | }; |
| 34 | |
| 35 | const absoluteToRequest = (context: string, maybeAbsolutePath: string): string => { |
| 36 | if (maybeAbsolutePath[0] === '/') { |