Skip to content

JsonParse

JsonParse<TResult> = (value) => { data: TResult; success: true; } | { error: unknown; success: false; }

Validates and narrows a 'json' value, reporting success with the parsed data or failure with the error, in the shape of zod’s safeParse.

TResult

The type the parser produces on success.

unknown

{ data: TResult; success: true; } | { error: unknown; success: false; }