Skip to content

Commit

Permalink
Make Zod a Peer Dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrevanveluw committed Nov 8, 2021
1 parent d708500 commit 222d4db
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
5 changes: 3 additions & 2 deletions deno/lib/__tests__/param.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @ts-ignore TS6133
import { expect } from "https://deno.land/x/[email protected]/mod.ts";
const test = Deno.test;
export * from "https://raw.githubusercontent.com/colinhacks/zod/master/deno/lib/mod.ts";

import * as z from "../index.ts";

Expand All @@ -15,7 +16,7 @@ test("parameter with number", () => {
try {
n.parse(400);
} catch (err) {
const zerr: z.ZodError = err;
const zerr: z.ZodError = err as ZodError;
expect(zerr.issues[0].code).toEqual(z.ZodIssueCode.too_big);
expect(zerr.issues[0].message).toEqual(
`Value should be less than or equal to 100`
Expand All @@ -34,7 +35,7 @@ test("parameter with string", () => {
try {
s.parse("12345678");
} catch (err) {
const zerr: z.ZodError = err;
const zerr: z.ZodError = err as ZodError;
expect(zerr.issues[0].code).toEqual(z.ZodIssueCode.too_big);
expect(zerr.issues[0].message).toEqual(
`Should be at most 7 characters long`
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"prepublishOnly": "npm run test && npm run build && npm run build:deno",
"play": "nodemon -e ts -w . -x ts-node src/playground.ts --project tsconfig.json --trace-warnings",
"depcruise": "depcruise -c .dependency-cruiser.js src",
"benchmark": "ts-node src/benchmarks/index.ts"
"benchmark": "ts-node src/benchmarks/index.ts",
"update": "npx --yes update-ruecksichtslos@latest"
},
"devDependencies": {
"@rollup/plugin-typescript": "^8.2.0",
Expand Down
5 changes: 3 additions & 2 deletions src/__tests__/param.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-ignore TS6133
import { expect, test } from "@jest/globals";
import { ZodError } from "zod";

import * as z from "../index";

Expand All @@ -14,7 +15,7 @@ test("parameter with number", () => {
try {
n.parse(400);
} catch (err) {
const zerr: z.ZodError = err;
const zerr: z.ZodError = err as ZodError;
expect(zerr.issues[0].code).toEqual(z.ZodIssueCode.too_big);
expect(zerr.issues[0].message).toEqual(
`Value should be less than or equal to 100`
Expand All @@ -33,7 +34,7 @@ test("parameter with string", () => {
try {
s.parse("12345678");
} catch (err) {
const zerr: z.ZodError = err;
const zerr: z.ZodError = err as ZodError;
expect(zerr.issues[0].code).toEqual(z.ZodIssueCode.too_big);
expect(zerr.issues[0].message).toEqual(
`Should be at most 7 characters long`
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5244,10 +5244,10 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

[email protected].5:
version "4.3.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.5.tgz#4d1c37cc16e893973c45a06886b7113234f119f4"
integrity sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==
typescript@^4.3.2:
version "4.4.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c"
integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==

uglify-js@^3.1.4, uglify-js@^3.4.9:
version "3.13.10"
Expand Down

0 comments on commit 222d4db

Please sign in to comment.