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

Function assertNotTemplate

packages/computer/src/sh.ts:79–88  ·  view source on GitHub ↗
(command: unknown)

Source from the content-addressed store, hash-verified

77// indexed array shape survives. Either way the unsafe path fails
78// loudly and points at the fix.
79export function assertNotTemplate(command: unknown): asserts command is string {
80 if (Array.isArray(command)) {
81 throw new TypeError(
82 "The remote stub's exec() does not take a tagged template. Reach the " +
83 "Workspace through getWorkspace(stub) and call exec as a template there, " +
84 "or wrap the command in the sh tag so interpolated values are escaped " +
85 "before the command crosses the RPC boundary.",
86 );
87 }
88}
89
90// Tagged template that builds a shell command string with every
91// interpolated value escaped. The static template parts come from

Callers 2

sh.test.tsFile · 0.85
execMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected