* Single-quote a string for use as an eval argument. Escapes embedded single * quotes via '"'"' (close-sq, literal-sq-in-dq, reopen-sq). Used instead of * shell-quote's quote() which switches to double-quote mode when the input * contains single quotes and then escapes ! -> \!, corrupting jq/awk
(s: string)
| 271 | * like `select(.x != .y)` into `select(.x \!= .y)`. |
| 272 | */ |
| 273 | function singleQuoteForEval(s: string): string { |
| 274 | return "'" + s.replace(/'/g, `'"'"'`) + "'" |
| 275 | } |
| 276 | |
| 277 | /** |
| 278 | * Joins shell continuation lines (backslash-newline) into a single line. |
no outgoing calls
no test coverage detected