| 213 | const tabRegEx = /\t/g |
| 214 | |
| 215 | function encodePathChars(filepath: string) { |
| 216 | if (filepath.includes("%")) { |
| 217 | filepath = filepath.replace(percentRegEx, "%25") |
| 218 | } |
| 219 | if (filepath.includes("\\")) { |
| 220 | filepath = filepath.replace(backslashRegEx, "%5C") |
| 221 | } |
| 222 | if (filepath.includes("\n")) { |
| 223 | filepath = filepath.replace(newlineRegEx, "%0A") |
| 224 | } |
| 225 | if (filepath.includes("\r")) { |
| 226 | filepath = filepath.replace(carriageReturnRegEx, "%0D") |
| 227 | } |
| 228 | if (filepath.includes("\t")) { |
| 229 | filepath = filepath.replace(tabRegEx, "%09") |
| 230 | } |
| 231 | return filepath |
| 232 | } |
| 233 | |
| 234 | const posixImpl = Path.of({ |
| 235 | [TypeId]: TypeId, |