@morojs/moro


@morojs/moro / z / ZodCodec

Interface: ZodCodec<A, B>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:588

Extends

Type Parameters

A

A extends SomeType = $ZodType

B

B extends SomeType = $ZodType

Properties

~~_def~~

_def: $ZodPipeDef<A, B>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:8

Deprecated

Use .def instead.

Inherited from

ZodPipe._def


~~_input~~

_input: input<A>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:12

Deprecated

Use z.input<typeof schema> instead.

Inherited from

ZodPipe._input


~~_output~~

_output: output<B>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:10

Deprecated

Use z.output<typeof schema> instead.

Inherited from

ZodPipe._output


_zod

_zod: $ZodCodecInternals<A, B>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:589

Overrides

ZodPipe._zod


~standard

~standard: $ZodStandardSchema<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/core/schemas.d.cts:90

Inherited from

ZodPipe.~standard


def

def: $ZodCodecDef<A, B>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:590

Overrides

ZodPipe.def


description?

optional description: string

Defined in: node_modules/zod/v4/classic/schemas.d.cts:53

Inherited from

ZodPipe.description


in

in: A

Defined in: node_modules/zod/v4/classic/schemas.d.cts:583

Inherited from

ZodPipe.in


out

out: B

Defined in: node_modules/zod/v4/classic/schemas.d.cts:584

Inherited from

ZodPipe.out


spa()

spa: (data, params?) => Promise<ZodSafeParseResult<output<B>>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:23

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<output<B>>>

Inherited from

ZodPipe.spa


type

type: "pipe"

Defined in: node_modules/zod/v4/classic/schemas.d.cts:6

Inherited from

ZodPipe.type

Methods

and()

and<T>(incoming): ZodIntersection<ZodCodec<A, B>, T>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:45

Type Parameters

T

T extends SomeType

Parameters

incoming

T

Returns

ZodIntersection<ZodCodec<A, B>, T>

Inherited from

ZodPipe.and


array()

array(): ZodArray<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:43

Returns

ZodArray<ZodCodec<A, B>>

Inherited from

ZodPipe.array


brand()

brand<T>(value?): PropertyKey extends T ? ZodCodec<A, B> : $ZodBranded<ZodCodec<A, B>, T>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:18

Type Parameters

T

T extends PropertyKey = PropertyKey

Parameters

value?

T

Returns

PropertyKey extends T ? ZodCodec<A, B> : $ZodBranded<ZodCodec<A, B>, T>

Inherited from

ZodPipe.brand


catch()

Call Signature

catch(def): ZodCatch<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:47

Parameters
def

output<B>

Returns

ZodCatch<ZodCodec<A, B>>

Inherited from

ZodPipe.catch

Call Signature

catch(def): ZodCatch<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:48

Parameters
def

(ctx) => output<B>

Returns

ZodCatch<ZodCodec<A, B>>

Inherited from

ZodPipe.catch


check()

check(...checks): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:13

Parameters

checks

...(CheckFn<output<B>> | $ZodCheck<output<B>>)[]

Returns

this

Inherited from

ZodPipe.check


clone()

clone(def?, params?): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:14

Parameters

def?

$ZodPipeDef<A, B>

params?
parent

boolean

Returns

this

Inherited from

ZodPipe.clone


decode()

decode(data, params?): output<B>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:25

Parameters

data

input<A>

params?

ParseContext<$ZodIssue>

Returns

output<B>

Inherited from

ZodPipe.decode


decodeAsync()

decodeAsync(data, params?): Promise<output<B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:27

Parameters

data

input<A>

params?

ParseContext<$ZodIssue>

Returns

Promise<output<B>>

Inherited from

ZodPipe.decodeAsync


default()

Call Signature

default(def): ZodDefault<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:39

Parameters
def

output<B>

Returns

ZodDefault<ZodCodec<A, B>>

Inherited from

ZodPipe.default

Call Signature

default(def): ZodDefault<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:40

Parameters
def

() => NoUndefined<output<B>>

Returns

ZodDefault<ZodCodec<A, B>>

Inherited from

ZodPipe.default


describe()

describe(description): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:52

Returns a new instance that has been registered in z.globalRegistry with the specified description

Parameters

description

string

Returns

this

Inherited from

ZodPipe.describe


encode()

encode(data, params?): input<A>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:24

Parameters

data

output<B>

params?

ParseContext<$ZodIssue>

Returns

input<A>

Inherited from

ZodPipe.encode


encodeAsync()

encodeAsync(data, params?): Promise<input<A>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:26

Parameters

data

output<B>

params?

ParseContext<$ZodIssue>

Returns

Promise<input<A>>

Inherited from

ZodPipe.encodeAsync


~~isNullable()~~

isNullable(): boolean

Defined in: node_modules/zod/v4/classic/schemas.d.cts:74

Returns

boolean

Deprecated

Try safe-parsing null (this is what isNullable does internally):

const schema = z.string().nullable();
const isNullable = schema.safeParse(null).success; // true

Inherited from

ZodPipe.isNullable


~~isOptional()~~

isOptional(): boolean

Defined in: node_modules/zod/v4/classic/schemas.d.cts:65

Returns

boolean

Deprecated

Try safe-parsing undefined (this is what isOptional does internally):

const schema = z.string().optional();
const isOptional = schema.safeParse(undefined).success; // true

Inherited from

ZodPipe.isOptional


meta()

Call Signature

meta(): undefined | {[key: string]: unknown; deprecated?: boolean; description?: string; id?: string; title?: string; }

Defined in: node_modules/zod/v4/classic/schemas.d.cts:55

Returns the metadata associated with this instance in z.globalRegistry

Returns

undefined | {[key: string]: unknown; deprecated?: boolean; description?: string; id?: string; title?: string; }

Inherited from

ZodPipe.meta

Call Signature

meta(data): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:57

Returns a new instance that has been registered in z.globalRegistry with the specified metadata

Parameters
data
deprecated?

boolean

description?

string

id?

string

title?

string

Returns

this

Inherited from

ZodPipe.meta


nonoptional()

nonoptional(params?): ZodNonOptional<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:36

Parameters

params?

string |

{ error?: string | $ZodErrorMap<$ZodIssueInvalidType<unknown>>; message?: string; }

error?

string | $ZodErrorMap<$ZodIssueInvalidType<unknown>>

message?

string

Deprecated

This parameter is deprecated. Use error instead.

Returns

ZodNonOptional<ZodCodec<A, B>>

Inherited from

ZodPipe.nonoptional


nullable()

nullable(): ZodNullable<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:37

Returns

ZodNullable<ZodCodec<A, B>>

Inherited from

ZodPipe.nullable


nullish()

nullish(): ZodOptional<ZodNullable<ZodCodec<A, B>>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:38

Returns

ZodOptional<ZodNullable<ZodCodec<A, B>>>

Inherited from

ZodPipe.nullish


optional()

optional(): ZodOptional<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:35

Returns

ZodOptional<ZodCodec<A, B>>

Inherited from

ZodPipe.optional


or()

or<T>(option): ZodUnion<[ZodCodec<A, B>, T]>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:44

Type Parameters

T

T extends SomeType

Parameters

option

T

Returns

ZodUnion<[ZodCodec<A, B>, T]>

Inherited from

ZodPipe.or


overwrite()

overwrite(fn): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:34

Parameters

fn

(x) => output<B>

Returns

this

Inherited from

ZodPipe.overwrite


parse()

parse(data, params?): output<B>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:19

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

output<B>

Inherited from

ZodPipe.parse


parseAsync()

parseAsync(data, params?): Promise<output<B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:21

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

Promise<output<B>>

Inherited from

ZodPipe.parseAsync


pipe()

pipe<T>(target): ZodPipe<ZodCodec<A, B>, T>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:49

Type Parameters

T

T extends $ZodType<any, output<B>, $ZodTypeInternals<any, output<B>>>

Parameters

target

T | $ZodType<any, output<B>, $ZodTypeInternals<any, output<B>>>

Returns

ZodPipe<ZodCodec<A, B>, T>

Inherited from

ZodPipe.pipe


prefault()

Call Signature

prefault(def): ZodPrefault<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:41

Parameters
def

() => input<A>

Returns

ZodPrefault<ZodCodec<A, B>>

Inherited from

ZodPipe.prefault

Call Signature

prefault(def): ZodPrefault<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:42

Parameters
def

input<A>

Returns

ZodPrefault<ZodCodec<A, B>>

Inherited from

ZodPipe.prefault


readonly()

readonly(): ZodReadonly<ZodCodec<A, B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:50

Returns

ZodReadonly<ZodCodec<A, B>>

Inherited from

ZodPipe.readonly


refine()

refine(check, params?): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:32

Parameters

check

(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, this check will only be executed if the function returns true. Defaults to payload => z.util.isAborted(payload).

Returns

this

Inherited from

ZodPipe.refine


register()

register<R>(registry, ...meta): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:17

Type Parameters

R

R extends $ZodRegistry<MetadataType, $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>

Parameters

registry

R

meta

...ZodCodec<A, B> extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], R["_schema"] & ZodCodec<A, B>>?] : [$replace<R["_meta"], R["_schema"] & ZodCodec<A, B>>] : ["Incompatible schema"]

Returns

this

Inherited from

ZodPipe.register


safeDecode()

safeDecode(data, params?): ZodSafeParseResult<output<B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:29

Parameters

data

input<A>

params?

ParseContext<$ZodIssue>

Returns

ZodSafeParseResult<output<B>>

Inherited from

ZodPipe.safeDecode


safeDecodeAsync()

safeDecodeAsync(data, params?): Promise<ZodSafeParseResult<output<B>>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:31

Parameters

data

input<A>

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<output<B>>>

Inherited from

ZodPipe.safeDecodeAsync


safeEncode()

safeEncode(data, params?): ZodSafeParseResult<input<A>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:28

Parameters

data

output<B>

params?

ParseContext<$ZodIssue>

Returns

ZodSafeParseResult<input<A>>

Inherited from

ZodPipe.safeEncode


safeEncodeAsync()

safeEncodeAsync(data, params?): Promise<ZodSafeParseResult<input<A>>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:30

Parameters

data

output<B>

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<input<A>>>

Inherited from

ZodPipe.safeEncodeAsync


safeParse()

safeParse(data, params?): ZodSafeParseResult<output<B>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:20

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

ZodSafeParseResult<output<B>>

Inherited from

ZodPipe.safeParse


safeParseAsync()

safeParseAsync(data, params?): Promise<ZodSafeParseResult<output<B>>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:22

Parameters

data

unknown

params?

ParseContext<$ZodIssue>

Returns

Promise<ZodSafeParseResult<output<B>>>

Inherited from

ZodPipe.safeParseAsync


superRefine()

superRefine(refinement): this

Defined in: node_modules/zod/v4/classic/schemas.d.cts:33

Parameters

refinement

(arg, ctx) => void | Promise<void>

Returns

this

Inherited from

ZodPipe.superRefine


transform()

transform<NewOut>(transform): ZodPipe<ZodCodec<A, B>, ZodTransform<Awaited<NewOut>, output<B>>>

Defined in: node_modules/zod/v4/classic/schemas.d.cts:46

Type Parameters

NewOut

NewOut

Parameters

transform

(arg, ctx) => NewOut | Promise<NewOut>

Returns

ZodPipe<ZodCodec<A, B>, ZodTransform<Awaited<NewOut>, output<B>>>

Inherited from

ZodPipe.transform