From e82979dbcfe3324f895e714cf993eed60f20c287 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Sat, 31 Jul 2021 22:22:46 -0400 Subject: [PATCH] chore: automatic fixes and code generation for f76adead (3.6.0) https://github.com/colinhacks/zod/actions/runs/1086358471 --- deno/lib/playground.ts | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 deno/lib/playground.ts diff --git a/deno/lib/playground.ts b/deno/lib/playground.ts deleted file mode 100644 index b784f97c6..000000000 --- a/deno/lib/playground.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { z } from "./index.ts"; - -const run = async () => { - z; - - const propertySchema = z.string(); - const schema = z - .object({ - a: propertySchema, - b: propertySchema, - }) - .refine( - (val) => { - return val.a === val.b; - }, - { message: "Must be equal" } - ); - - try { - schema.parse({ - a: "asdf", - b: "qwer", - }); - } catch (error) { - if (error instanceof z.ZodError) { - console.log(error); - console.log(error.flatten((iss) => iss.code)); - } - } -}; -run(); - -export {};