Skip to content

Commit

Permalink
Add ie11 message
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin McDonnell committed Aug 1, 2021
1 parent c2717db commit c0f6f62
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Zod is designed to be as developer-friendly as possible. The goal is to eliminat
Some other great aspects:

- Zero dependencies
- Works in browsers and Node.js
- Works in Node.js and browsers (including IE 11)
- Tiny: 8kb minified + zipped
- Immutable: methods (i.e. `.optional()` return a new instance
- Concise, chainable interface
Expand Down
33 changes: 33 additions & 0 deletions deno/lib/playground.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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 {};

0 comments on commit c0f6f62

Please sign in to comment.