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

Function base

packages/zod/src/v3/tests/async-parsing.test.ts:343–349  ·  view source on GitHub ↗
(is_async?: boolean)

Source from the content-addressed store, hash-verified

341
342test("async validation multiple errors 2", async () => {
343 const base = (is_async?: boolean) =>
344 z.object({
345 hello: z.string(),
346 foo: z.object({
347 bar: z.number().refine(is_async ? async () => false : () => false),
348 }),
349 });
350
351 const testval = { hello: 3, foo: { bar: 4 } };
352 const result1 = base().safeParse(testval);

Callers 1

Calls 3

stringMethod · 0.80
refineMethod · 0.80
numberMethod · 0.80

Tested by

no test coverage detected