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

Function meta

packages/zod/src/v4/classic/schemas.ts:339–348  ·  view source on GitHub ↗
(...args: any[])

Source from the content-addressed store, hash-verified

337 return cl;
338 },
339 meta(...args: any[]): any {
340 // overloaded: meta() returns the registered metadata, meta(data)
341 // returns a clone with `data` registered. The mapped type picks
342 // up the second overload, so we accept variadic any-args and
343 // return `any` to satisfy both at runtime.
344 if (args.length === 0) return core.globalRegistry.get(this);
345 const cl = this.clone();
346 core.globalRegistry.add(cl, args[0]);
347 return cl;
348 },
349 isOptional() {
350 return this.safeParse(undefined).success;
351 },

Callers

nothing calls this directly

Calls 3

getMethod · 0.80
addMethod · 0.80
cloneMethod · 0.65

Tested by

no test coverage detected