Skip to content
1 min read · 58 words

Function: makeShortCircuit()

ts
function makeShortCircuit(): (result: string) => never;

Defined in: batteries/tools/_shared/index.ts:190

Build a shortCircuit(result) function for an input-pipeline context. Calling it throws the internal sentinel, which runInputPipeline catches and converts into the verbatim result (skipping the HTTP request entirely — e.g. a cache hit).

Returns

A function that, when called with a result string, throws the short-circuit sentinel.

(result: string) => never