MCPcopy
hub / github.com/colinhacks/zod / default

Function default

packages/zod/src/v3/types.ts:481–490  ·  view source on GitHub ↗
(def: any)

Source from the content-addressed store, hash-verified

479 default(def: util.noUndefined<Input>): ZodDefault<this>;
480 default(def: () => util.noUndefined<Input>): ZodDefault<this>;
481 default(def: any) {
482 const defaultValueFunc = typeof def === "function" ? def : () => def;
483
484 return new ZodDefault({
485 ...processCreateParams(this._def),
486 innerType: this,
487 defaultValue: defaultValueFunc,
488 typeName: ZodFirstPartyTypeKind.ZodDefault,
489 }) as any;
490 }
491
492 brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
493 brand<B extends string | number | symbol>(): ZodBranded<this, B> {

Callers

nothing calls this directly

Calls 1

processCreateParamsFunction · 0.85

Tested by

no test coverage detected