MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / shellQuote

Function shellQuote

scripts/benchmark/helpers/shell.ts:10–16  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

8
9/** Quote a value for safe interpolation into a bash command line. */
10export function shellQuote(value: string): string {
11 if (/^[\w@./:=-]+$/.test(value)) {
12 return value;
13 }
14
15 return `'${value.replace(/'/g, `'\\''`)}'`;
16}

Callers 5

benchmarkErrorFunction · 0.90
wrapWithGnuTimeFunction · 0.90
shell.test.tsFile · 0.90
runner.test.tsFile · 0.90
wrapWithCpuTimingFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected