* Returns true if the filename contains characters that require C-style * quoting (as used by Git and GNU diffutils in diff output).
(s: string)
| 6 | * quoting (as used by Git and GNU diffutils in diff output). |
| 7 | */ |
| 8 | function needsQuoting(s: string): boolean { |
| 9 | for (let i = 0; i < s.length; i++) { |
| 10 | if (s[i] < '\x20' || s[i] > '\x7e' || s[i] === '"' || s[i] === '\\') { |
| 11 | return true; |
| 12 | } |
| 13 | } |
| 14 | return false; |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * C-style quotes a filename, encoding special characters as escape sequences |
no outgoing calls
no test coverage detected