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

Interface ZodOptional

packages/zod/src/v4/classic/schemas.ts:2058–2063  ·  packages/zod/src/v4/classic/schemas.ts::ZodOptional

Source from the content-addressed store, hash-verified

2056
2057class="cm">// ZodOptional
2058export interface ZodOptional<T extends core.SomeType = core.$ZodType>
2059 extends _ZodType<core.$ZodOptionalInternals<T>>,
2060 core.$ZodOptional<T> {
2061 class="st">"~standard": ZodStandardSchemaWithJSON<this>;
2062 unwrap(): T;
2063}
2064export const ZodOptional: core.$constructor<ZodOptional> = /*@__PURE__*/ core.$constructor(
2065 class="st">"ZodOptional",
2066 (inst, def) => {

Callers

nothing calls this directly

Implementers 5

ZodPromisepackages/zod/src/v3/types.ts
ZodOptionalpackages/zod/src/v3/types.ts
ZodNullablepackages/zod/src/v3/types.ts
ZodBrandedpackages/zod/src/v3/types.ts
ZodReadonlypackages/zod/src/v3/types.ts

Calls

no outgoing calls

Tested by

no test coverage detected