| 520 | const tabRegExp = /\t/g |
| 521 | |
| 522 | function encodePathChars(filepath: string) { |
| 523 | if (filepath.includes("%")) { |
| 524 | filepath = filepath.replace(percentRegExp, "%25") |
| 525 | } |
| 526 | if (filepath.includes("\\")) { |
| 527 | filepath = filepath.replace(backslashRegExp, "%5C") |
| 528 | } |
| 529 | if (filepath.includes("\n")) { |
| 530 | filepath = filepath.replace(newlineRegExp, "%0A") |
| 531 | } |
| 532 | if (filepath.includes("\r")) { |
| 533 | filepath = filepath.replace(carriageReturnRegExp, "%0D") |
| 534 | } |
| 535 | if (filepath.includes("\t")) { |
| 536 | filepath = filepath.replace(tabRegExp, "%09") |
| 537 | } |
| 538 | return filepath |
| 539 | } |
| 540 | |
| 541 | const posixImpl = make({ |
| 542 | resolve, |