Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno_books/deps.ts>z.ZodSchema#refine

Access OpenLibrary's API with Deno.
Go to Latest
method z.ZodSchema.prototype.refine
import { z } from "https://deno.land/x/deno_books@v1.2.0/deps.ts";
const { ZodSchema } = 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>