MCPcopy Index your code
hub / github.com/anomalyco/opencode / validateWith

Function validateWith

packages/llm/src/protocols/shared.ts:309–311  ·  view source on GitHub ↗
(decode: (input: I) => Effect.Effect<A, E>)

Source from the content-addressed store, hash-verified

307 */
308export const validateWith =
309 <A, I, E extends { readonly message: string }>(decode: (input: I) => Effect.Effect<A, E>) =>
310 (payload: I) =>
311 decode(payload).pipe(Effect.mapError((error) => invalidRequest(error.message)))
312
313/**
314 * Build an HTTP POST with a JSON body. Sets `content-type: application/json`

Callers

nothing calls this directly

Calls 2

invalidRequestFunction · 0.85
decodeFunction · 0.50

Tested by

no test coverage detected