Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/domain_functions/src/test-prelude.ts>z.Schema#refine

Decouple your business logic from your framework. With first-class type inference from end to end.
Go to Latest
method z.Schema.prototype.refine
import { z } from "https://deno.land/x/domain_functions@v2.6.0/src/test-prelude.ts";
const { Schema } = z;

Type Parameters

RefinedOutput extends Output

Parameters

check: (arg: Output) => arg is RefinedOutput
optional
message: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)

Parameters

check: (arg: Output) => unknown | Promise<unknown>
optional
message: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)

Returns

ZodEffects<this, Output, Input>