MCPcopy Index your code
hub / github.com/codeaashu/claude-code / singleQuoteForEval

Function singleQuoteForEval

src/utils/bash/bashPipeCommand.ts:273–275  ·  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

271 * like `select(.x != .y)` into `select(.x \!= .y)`.
272 */
273function singleQuoteForEval(s: string): string {
274 return "'" + s.replace(/'/g, `'"'"'`) + "'"
275}
276
277/**
278 * 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