MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / singleQuoteForEval

Function singleQuoteForEval

source code/utils/bash/bashPipeCommand.ts:275–277  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

273 * like `select(.x != .y)` into `select(.x \!= .y)`.
274 */
275function singleQuoteForEval(s: string): string {
276 return "'" + s.replace(/'/g, `'"'"'`) + "'"
277}
278
279/**
280 * Joins shell continuation lines (backslash-newline) into a single line.

Callers 2

rearrangePipeCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected