MCPcopy Create free account
hub / github.com/cloudflare/computer / interpolate

Function interpolate

packages/computer/src/sh.ts:56–64  ·  view source on GitHub ↗
(value: ShellValue)

Source from the content-addressed store, hash-verified

54}
55
56function interpolate(value: ShellValue): string {
57 if (isRaw(value)) return value.raw;
58 if (Array.isArray(value)) {
59 return (value as ReadonlyArray<string | number>)
60 .map((item) => shellQuote(String(item)))
61 .join(" ");
62 }
63 return shellQuote(String(value));
64}
65
66// Guard against `exec` being called as a tagged template. `exec`
67// takes a plain command string, and over Workers RPC that string is

Callers 1

shFunction · 0.85

Calls 2

isRawFunction · 0.85
shellQuoteFunction · 0.70

Tested by

no test coverage detected