Download .opencode/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts from Chenloong999/opencode-data: direct link, hf CLI and curl.
- Browser
- Download file 778 Bytes
-
https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts
- Command line
-
hf download hf://datasets/Chenloong999/opencode-data/.opencode/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts
-
curl -L -o object-in-es5-env.test.ts https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts
778 Bytes
| // @ts-ignore TS6133 | |
| import { expect, test } from "vitest"; | |
| import * as z from "zod/v3"; | |
| const RealSet = Set; | |
| const RealMap = Map; | |
| const RealDate = Date; | |
| test("doesn’t throw when Date is undefined", () => { | |
| delete (globalThis as any).Date; | |
| const result = z.object({}).safeParse({}); | |
| expect(result.success).toEqual(true); | |
| globalThis.Date = RealDate; | |
| }); | |
| test("doesn’t throw when Set is undefined", () => { | |
| delete (globalThis as any).Set; | |
| const result = z.object({}).safeParse({}); | |
| expect(result.success).toEqual(true); | |
| globalThis.Set = RealSet; | |
| }); | |
| test("doesn’t throw when Map is undefined", () => { | |
| delete (globalThis as any).Map; | |
| const result = z.object({}).safeParse({}); | |
| expect(result.success).toEqual(true); | |
| globalThis.Map = RealMap; | |
| }); | |