(filepath: string)
| 24 | const hashRegex = /#/g |
| 25 | |
| 26 | function encodePathChars(filepath: string) { |
| 27 | if (filepath.includes('%')) filepath = filepath.replace(percentRegEx, '%25') |
| 28 | // In posix, backslash is a valid character in paths: |
| 29 | if (!isWindows && filepath.includes('\\')) |
| 30 | filepath = filepath.replace(backslashRegEx, '%5C') |
| 31 | if (filepath.includes('\n')) filepath = filepath.replace(newlineRegEx, '%0A') |
| 32 | if (filepath.includes('\r')) |
| 33 | filepath = filepath.replace(carriageReturnRegEx, '%0D') |
| 34 | if (filepath.includes('\t')) filepath = filepath.replace(tabRegEx, '%09') |
| 35 | return filepath |
| 36 | } |
| 37 | |
| 38 | export const posixDirname: (path: string) => string = pathe.dirname |
| 39 | export const posixResolve: (...paths: string[]) => string = pathe.resolve |
no outgoing calls
no test coverage detected