POSIX single-quote escape: wrap in '…' and escape embedded quotes.
(value: string)
| 22 | |
| 23 | /** POSIX single-quote escape: wrap in '…' and escape embedded quotes. */ |
| 24 | function q(value: string): string { |
| 25 | return `'${value.replace(/'/g, `'\\''`)}'` |
| 26 | } |
| 27 | |
| 28 | /** Reject values that could be parsed as a git flag when used as a positional. */ |
| 29 | function assertNoLeadingDash(value: string, name: string): void { |
no test coverage detected