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

Function check

packages/zod/src/v4/classic/schemas.ts:256–269  ·  view source on GitHub ↗
(...chks)

Source from the content-addressed store, hash-verified

254 // shared underlying function references across all instances.
255 _installLazyMethods(inst, "ZodType", {
256 check(...chks) {
257 const def = this.def;
258 return this.clone(
259 util.mergeDefs(def, {
260 checks: [
261 ...(def.checks ?? []),
262 ...chks.map((ch) =>
263 typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch
264 ),
265 ],
266 }),
267 { parent: true }
268 );
269 },
270 with(...chks) {
271 return this.check(...chks);
272 },

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.65

Tested by

no test coverage detected