diff --git a/deno/lib/README.md b/deno/lib/README.md index ce4251d1f..83af7ed6b 100644 --- a/deno/lib/README.md +++ b/deno/lib/README.md @@ -512,6 +512,7 @@ There are a growing number of tools that are built atop or support Zod natively! - [`@vee-validate/zod`](https://github.com/logaretm/vee-validate/tree/main/packages/zod): Form library for Vue.js with Zod schema validation. - [`zod-form-renderer`](https://github.com/thepeaklab/zod-form-renderer): Auto-infer form fields from zod schema and render them with react-hook-form with E2E type safety. - [`antd-zod`](https://github.com/MrBr/antd-zod): Zod adapter for Ant Design form fields validation. +- [`frrm`](https://github.com/schalkventer/frrm): Tiny 0.5kb Zod-based, HTML form abstraction that goes brr. #### Zod to X diff --git a/deno/lib/__tests__/standard-schema.test.ts b/deno/lib/__tests__/standard-schema.test.ts index 065315c52..11f726ea8 100644 --- a/deno/lib/__tests__/standard-schema.test.ts +++ b/deno/lib/__tests__/standard-schema.test.ts @@ -1,12 +1,11 @@ // @ts-ignore TS6133 import { expect } from "https://deno.land/x/expect@v0.2.6/mod.ts"; const test = Deno.test; -import { util } from "../helpers/util.ts"; +import type { StandardSchemaV1 } from "@standard-schema/spec"; +import { util } from "../helpers/util.ts"; import * as z from "../index.ts"; -import type { StandardSchemaV1 } from "@standard-schema/spec"; - test("assignability", () => { const _s1: StandardSchemaV1 = z.string(); const _s2: StandardSchemaV1 = z.string(); diff --git a/deno/lib/__tests__/string.test.ts b/deno/lib/__tests__/string.test.ts index cb934a97e..c9aa938af 100644 --- a/deno/lib/__tests__/string.test.ts +++ b/deno/lib/__tests__/string.test.ts @@ -252,8 +252,10 @@ test("jwt validations", () => { const jwtWithAlg = z.string().jwt({ alg: "HS256" }); // Valid JWTs - const validHeader = Buffer.from(JSON.stringify({ typ: "JWT", alg: "HS256" })).toString('base64url'); - const validPayload = Buffer.from("{}").toString('base64url'); + const validHeader = Buffer.from( + JSON.stringify({ typ: "JWT", alg: "HS256" }) + ).toString("base64url"); + const validPayload = Buffer.from("{}").toString("base64url"); const validSignature = "signature"; const validJWT = `${validHeader}.${validPayload}.${validSignature}`; @@ -266,12 +268,14 @@ test("jwt validations", () => { expect(() => jwt.parse("invalid.invalid.invalid")).toThrow(); // Invalid header - const invalidHeader = Buffer.from("{}").toString('base64url'); + const invalidHeader = Buffer.from("{}").toString("base64url"); const invalidHeaderJWT = `${invalidHeader}.${validPayload}.${validSignature}`; expect(() => jwt.parse(invalidHeaderJWT)).toThrow(); // Wrong algorithm - const wrongAlgHeader = Buffer.from(JSON.stringify({ typ: "JWT", alg: "RS256" })).toString('base64url'); + const wrongAlgHeader = Buffer.from( + JSON.stringify({ typ: "JWT", alg: "RS256" }) + ).toString("base64url"); const wrongAlgJWT = `${wrongAlgHeader}.${validPayload}.${validSignature}`; expect(() => jwtWithAlg.parse(wrongAlgJWT)).toThrow(); diff --git a/src/__tests__/standard-schema.test.ts b/src/__tests__/standard-schema.test.ts index 8f67cce76..fbf312f16 100644 --- a/src/__tests__/standard-schema.test.ts +++ b/src/__tests__/standard-schema.test.ts @@ -1,11 +1,10 @@ // @ts-ignore TS6133 import { expect, test } from "@jest/globals"; -import { util } from "../helpers/util"; +import type { StandardSchemaV1 } from "@standard-schema/spec"; +import { util } from "../helpers/util"; import * as z from "../index"; -import type { StandardSchemaV1 } from "@standard-schema/spec"; - test("assignability", () => { const _s1: StandardSchemaV1 = z.string(); const _s2: StandardSchemaV1 = z.string(); diff --git a/src/__tests__/string.test.ts b/src/__tests__/string.test.ts index dc01162c4..9b18a0241 100644 --- a/src/__tests__/string.test.ts +++ b/src/__tests__/string.test.ts @@ -251,8 +251,10 @@ test("jwt validations", () => { const jwtWithAlg = z.string().jwt({ alg: "HS256" }); // Valid JWTs - const validHeader = Buffer.from(JSON.stringify({ typ: "JWT", alg: "HS256" })).toString('base64url'); - const validPayload = Buffer.from("{}").toString('base64url'); + const validHeader = Buffer.from( + JSON.stringify({ typ: "JWT", alg: "HS256" }) + ).toString("base64url"); + const validPayload = Buffer.from("{}").toString("base64url"); const validSignature = "signature"; const validJWT = `${validHeader}.${validPayload}.${validSignature}`; @@ -265,12 +267,14 @@ test("jwt validations", () => { expect(() => jwt.parse("invalid.invalid.invalid")).toThrow(); // Invalid header - const invalidHeader = Buffer.from("{}").toString('base64url'); + const invalidHeader = Buffer.from("{}").toString("base64url"); const invalidHeaderJWT = `${invalidHeader}.${validPayload}.${validSignature}`; expect(() => jwt.parse(invalidHeaderJWT)).toThrow(); // Wrong algorithm - const wrongAlgHeader = Buffer.from(JSON.stringify({ typ: "JWT", alg: "RS256" })).toString('base64url'); + const wrongAlgHeader = Buffer.from( + JSON.stringify({ typ: "JWT", alg: "RS256" }) + ).toString("base64url"); const wrongAlgJWT = `${wrongAlgHeader}.${validPayload}.${validSignature}`; expect(() => jwtWithAlg.parse(wrongAlgJWT)).toThrow();