/home/techb158/balavpn.abdallabala.com/node_modules/zod/src/v3/tests
NameSizeModeActions
all-errors.test.ts47530666editdlrm
anyunknown.test.ts6730666editdlrm
array.test.ts19390666editdlrm
async-parsing.test.ts126390666editdlrm
async-refinements.test.ts16030666editdlrm
base.test.ts7820666editdlrm
bigint.test.ts19770666editdlrm
branded.test.ts17340666editdlrm
catch.test.ts65500666editdlrm
coerce.test.ts66500666editdlrm
complex.test.ts19140666editdlrm
custom.test.ts9500666editdlrm
date.test.ts9830666editdlrm
deepmasking.test.ts52150666editdlrm
default.test.ts35270666editdlrm
description.test.ts13230666editdlrm
discriminated-unions.test.ts85370666editdlrm
enum.test.ts27370666editdlrm
error.test.ts168120666editdlrm
firstparty.test.ts23910666editdlrm
firstpartyschematypes.test.ts7880666editdlrm
function.test.ts65780666editdlrm
generics.test.ts15230666editdlrm
instanceof.test.ts11540666editdlrm
intersection.test.ts30910666editdlrm
language-server.source.ts12750666editdlrm
language-server.test.ts83180666editdlrm
literal.test.ts10630666editdlrm
map.test.ts35450666editdlrm
masking.test.ts850666editdlrm
mocker.test.ts3890666editdlrm
Mocker.ts13410666editdlrm
nan.test.ts5870666editdlrm
nativeEnum.test.ts23440666editdlrm
nullable.test.ts11720666editdlrm
number.test.ts63730666editdlrm
object-augmentation.test.ts5690666editdlrm
object-in-es5-env.test.ts7780666editdlrm
object.test.ts117720666editdlrm
optional.test.ts12220666editdlrm
parser.test.ts11250666editdlrm
parseUtil.test.ts8690666editdlrm
partials.test.ts69960666editdlrm
pickomit.test.ts36220666editdlrm
pipeline.test.ts8230666editdlrm
preprocess.test.ts45300666editdlrm
primitive.test.ts122150666editdlrm
promise.test.ts24900666editdlrm
readonly.test.ts73390666editdlrm
record.test.ts37350666editdlrm
recursive.test.ts39460666editdlrm
refine.test.ts81720666editdlrm
safeparse.test.ts6280666editdlrm
set.test.ts47880666editdlrm
standard-schema.test.ts25870666editdlrm
string.test.ts656230666editdlrm
transformer.test.ts56870666editdlrm
tuple.test.ts26910666editdlrm
unions.test.ts15400666editdlrm
validations.test.ts38260666editdlrm
void.test.ts3490666editdlrm
Edit: /home/techb158/balavpn.abdallabala.com/node_modules/zod/src/v3/tests/deepmasking.test.ts (5215B)
// @ts-ignore TS6133 import { test } from "vitest"; import * as z from "zod/v3"; test("test", () => { z; }); // const fish = z.object({ // name: z.string(), // props: z.object({ // color: z.string(), // numScales: z.number(), // }), // }); // const nonStrict = z // .object({ // name: z.string(), // color: z.string(), // }) // .nonstrict(); // test('object pick type', () => { // const modNonStrictFish = nonStrict.omit({ name: true }); // modNonStrictFish.parse({ color: 'asdf' }); // const bad1 = () => fish.pick({ props: { unknown: true } } as any); // const bad2 = () => fish.omit({ name: true, props: { unknown: true } } as any); // expect(bad1).toThrow(); // expect(bad2).toThrow(); // }); // test('f1', () => { // const f1 = fish.pick(true); // f1.parse({ name: 'a', props: { color: 'b', numScales: 3 } }); // }); // test('f2', () => { // const f2 = fish.pick({ props: true }); // f2.parse({ props: { color: 'asdf', numScales: 1 } }); // const badcheck2 = () => f2.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any); // expect(badcheck2).toThrow(); // }); // test('f3', () => { // const f3 = fish.pick({ props: { color: true } }); // f3.parse({ props: { color: 'b' } }); // const badcheck3 = () => f3.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any); // expect(badcheck3).toThrow(); // }); // test('f4', () => { // const badcheck4 = () => fish.pick({ props: { color: true, unknown: true } }); // expect(badcheck4).toThrow(); // }); // test('f6', () => { // const f6 = fish.omit({ props: true }); // const badcheck6 = () => f6.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any); // f6.parse({ name: 'adsf' }); // expect(badcheck6).toThrow(); // }); // test('f7', () => { // const f7 = fish.omit({ props: { color: true } }); // f7.parse({ name: 'a', props: { numScales: 3 } }); // const badcheck7 = () => f7.parse({ name: 'a', props: { color: 'b', numScales: 3 } } as any); // expect(badcheck7).toThrow(); // }); // test('f8', () => { // const badcheck8 = () => fish.omit({ props: { color: true, unknown: true } }); // expect(badcheck8).toThrow(); // }); // test('f9', () => { // const f9 = nonStrict.pick(true); // f9.parse({ name: 'a', color: 'asdf' }); // }); // test('f10', () => { // const f10 = nonStrict.pick({ name: true }); // f10.parse({ name: 'a' }); // const val = f10.parse({ name: 'a', color: 'b' }); // expect(val).toEqual({ name: 'a' }); // }); // test('f12', () => { // const badfcheck12 = () => nonStrict.omit({ color: true, asdf: true }); // expect(badfcheck12).toThrow(); // }); // test('array masking', () => { // const fishArray = z.array(fish); // const modFishArray = fishArray.pick({ // name: true, // props: { // numScales: true, // }, // }); // modFishArray.parse([{ name: 'fish', props: { numScales: 12 } }]); // const bad1 = () => modFishArray.parse([{ name: 'fish', props: { numScales: 12, color: 'asdf' } }] as any); // expect(bad1).toThrow(); // }); // test('array masking', () => { // const fishArray = z.array(fish); // const fail = () => // fishArray.pick({ // name: true, // props: { // whatever: true, // }, // } as any); // expect(fail).toThrow(); // }); // test('array masking', () => { // const fishArray = z.array(fish); // const fail = () => // fishArray.omit({ // whateve: true, // } as any); // expect(fail).toThrow(); // }); // test('array masking', () => { // const fishArray = z.array(fish); // const modFishList = fishArray.omit({ // name: true, // props: { // color: true, // }, // }); // modFishList.parse([{ props: { numScales: 12 } }]); // const fail = () => modFishList.parse([{ name: 'hello', props: { numScales: 12 } }] as any); // expect(fail).toThrow(); // }); // test('primitive array masking', () => { // const fishArray = z.array(z.number()); // const fail = () => fishArray.pick({} as any); // expect(fail).toThrow(); // }); // test('other array masking', () => { // const fishArray = z.array(z.array(z.number())); // const fail = () => fishArray.pick({} as any); // expect(fail).toThrow(); // }); // test('invalid mask #1', () => { // const fail = () => fish.pick(1 as any); // expect(fail).toThrow(); // }); // test('invalid mask #2', () => { // const fail = () => fish.pick([] as any); // expect(fail).toThrow(); // }); // test('invalid mask #3', () => { // const fail = () => fish.pick(false as any); // expect(fail).toThrow(); // }); // test('invalid mask #4', () => { // const fail = () => fish.pick('asdf' as any); // expect(fail).toThrow(); // }); // test('invalid mask #5', () => { // const fail = () => fish.omit(1 as any); // expect(fail).toThrow(); // }); // test('invalid mask #6', () => { // const fail = () => fish.omit([] as any); // expect(fail).toThrow(); // }); // test('invalid mask #7', () => { // const fail = () => fish.omit(false as any); // expect(fail).toThrow(); // }); // test('invalid mask #8', () => { // const fail = () => fish.omit('asdf' as any); // expect(fail).toThrow(); // });