Skip to main content

Function: refine()

refine<T>(fn, _params?): $ZodCheck<T>

Defined in: packages/agentos/node_modules/zod/v4/classic/schemas.d.cts:742

Type Parameters

T

T

Parameters

fn

(arg) => unknown

_params?

string |

{ abort?: boolean; error?: string | $ZodErrorMap<NonNullable<$ZodIssue>>; message?: string; params?: Record<string, any>; path?: PropertyKey[]; when?: (payload) => boolean; }

abort?

boolean

If true, no later checks will be executed if this check fails. Default false.

error?

string | $ZodErrorMap<NonNullable<$ZodIssue>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

params?

Record<string, any>

path?

PropertyKey[]

when?

(payload) => boolean

If provided, the check runs only when this returns true. By default, it is skipped if prior parsing produced aborting issues.

Returns

$ZodCheck<T>