Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
cqt /
node_modules /
zod /
src /
v3 /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
Mocker.ts
1.31
KB
-rw-r--r--
all-errors.test.ts
4.64
KB
-rw-r--r--
anyunknown.test.ts
673
B
-rw-r--r--
array.test.ts
1.89
KB
-rw-r--r--
async-parsing.test.ts
12.34
KB
-rw-r--r--
async-refinements.test.ts
1.57
KB
-rw-r--r--
base.test.ts
782
B
-rw-r--r--
bigint.test.ts
1.93
KB
-rw-r--r--
branded.test.ts
1.69
KB
-rw-r--r--
catch.test.ts
6.4
KB
-rw-r--r--
coerce.test.ts
6.49
KB
-rw-r--r--
complex.test.ts
1.87
KB
-rw-r--r--
custom.test.ts
950
B
-rw-r--r--
date.test.ts
983
B
-rw-r--r--
deepmasking.test.ts
5.09
KB
-rw-r--r--
default.test.ts
3.44
KB
-rw-r--r--
description.test.ts
1.29
KB
-rw-r--r--
discriminated-unions.test.ts
8.34
KB
-rw-r--r--
enum.test.ts
2.67
KB
-rw-r--r--
error.test.ts
16.42
KB
-rw-r--r--
firstparty.test.ts
2.33
KB
-rw-r--r--
firstpartyschematypes.test.ts
788
B
-rw-r--r--
function.test.ts
6.42
KB
-rw-r--r--
generics.test.ts
1.49
KB
-rw-r--r--
instanceof.test.ts
1.13
KB
-rw-r--r--
intersection.test.ts
3.02
KB
-rw-r--r--
language-server.source.ts
1.25
KB
-rw-r--r--
language-server.test.ts
8.12
KB
-rw-r--r--
literal.test.ts
1.04
KB
-rw-r--r--
map.test.ts
3.46
KB
-rw-r--r--
masking.test.ts
85
B
-rw-r--r--
mocker.test.ts
389
B
-rw-r--r--
nan.test.ts
587
B
-rw-r--r--
nativeEnum.test.ts
2.29
KB
-rw-r--r--
nullable.test.ts
1.14
KB
-rw-r--r--
number.test.ts
6.22
KB
-rw-r--r--
object-augmentation.test.ts
569
B
-rw-r--r--
object-in-es5-env.test.ts
778
B
-rw-r--r--
object.test.ts
11.5
KB
-rw-r--r--
optional.test.ts
1.19
KB
-rw-r--r--
parseUtil.test.ts
869
B
-rw-r--r--
parser.test.ts
1.1
KB
-rw-r--r--
partials.test.ts
6.83
KB
-rw-r--r--
pickomit.test.ts
3.54
KB
-rw-r--r--
pipeline.test.ts
823
B
-rw-r--r--
preprocess.test.ts
4.42
KB
-rw-r--r--
primitive.test.ts
11.93
KB
-rw-r--r--
promise.test.ts
2.43
KB
-rw-r--r--
readonly.test.ts
7.17
KB
-rw-r--r--
record.test.ts
3.65
KB
-rw-r--r--
recursive.test.ts
3.85
KB
-rw-r--r--
refine.test.ts
7.98
KB
-rw-r--r--
safeparse.test.ts
628
B
-rw-r--r--
set.test.ts
4.68
KB
-rw-r--r--
standard-schema.test.ts
2.53
KB
-rw-r--r--
string.test.ts
64.08
KB
-rw-r--r--
transformer.test.ts
5.55
KB
-rw-r--r--
tuple.test.ts
2.63
KB
-rw-r--r--
unions.test.ts
1.5
KB
-rw-r--r--
validations.test.ts
3.74
KB
-rw-r--r--
void.test.ts
349
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : primitive.test.ts
// @ts-ignore TS6133 import { expect, test } from "vitest"; import * as z from "zod/v3"; import { util } from "../helpers/util.js"; import { Mocker } from "./Mocker.js"; const literalStringSchema = z.literal("asdf"); const literalNumberSchema = z.literal(12); const literalBooleanSchema = z.literal(true); const literalBigIntSchema = z.literal(BigInt(42)); const MySymbol = Symbol("stuff"); const literalSymbolSchema = z.literal(MySymbol); const stringSchema = z.string(); const numberSchema = z.number(); const bigintSchema = z.bigint(); const booleanSchema = z.boolean(); const dateSchema = z.date(); const symbolSchema = z.symbol(); const nullSchema = z.null(); const undefinedSchema = z.undefined(); const stringSchemaOptional = z.string().optional(); const stringSchemaNullable = z.string().nullable(); const numberSchemaOptional = z.number().optional(); const numberSchemaNullable = z.number().nullable(); const bigintSchemaOptional = z.bigint().optional(); const bigintSchemaNullable = z.bigint().nullable(); const booleanSchemaOptional = z.boolean().optional(); const booleanSchemaNullable = z.boolean().nullable(); const dateSchemaOptional = z.date().optional(); const dateSchemaNullable = z.date().nullable(); const symbolSchemaOptional = z.symbol().optional(); const symbolSchemaNullable = z.symbol().nullable(); const val = new Mocker(); test("literal string correct", () => { expect(literalStringSchema.parse("asdf")).toBe("asdf"); }); test("literal string incorrect", () => { const f = () => literalStringSchema.parse("not_asdf"); expect(f).toThrow(); }); test("literal string number", () => { const f = () => literalStringSchema.parse(123); expect(f).toThrow(); }); test("literal string boolean", () => { const f = () => literalStringSchema.parse(true); expect(f).toThrow(); }); test("literal string boolean", () => { const f = () => literalStringSchema.parse(true); expect(f).toThrow(); }); test("literal string object", () => { const f = () => literalStringSchema.parse({}); expect(f).toThrow(); }); test("literal number correct", () => { expect(literalNumberSchema.parse(12)).toBe(12); }); test("literal number incorrect", () => { const f = () => literalNumberSchema.parse(13); expect(f).toThrow(); }); test("literal number number", () => { const f = () => literalNumberSchema.parse(val.string); expect(f).toThrow(); }); test("literal number boolean", () => { const f = () => literalNumberSchema.parse(val.boolean); expect(f).toThrow(); }); test("literal number object", () => { const f = () => literalStringSchema.parse({}); expect(f).toThrow(); }); test("literal boolean correct", () => { expect(literalBooleanSchema.parse(true)).toBe(true); }); test("literal boolean incorrect", () => { const f = () => literalBooleanSchema.parse(false); expect(f).toThrow(); }); test("literal boolean number", () => { const f = () => literalBooleanSchema.parse("asdf"); expect(f).toThrow(); }); test("literal boolean boolean", () => { const f = () => literalBooleanSchema.parse(123); expect(f).toThrow(); }); test("literal boolean object", () => { const f = () => literalBooleanSchema.parse({}); expect(f).toThrow(); }); test("literal bigint correct", () => { expect(literalBigIntSchema.parse(BigInt(42))).toBe(BigInt(42)); }); test("literal bigint incorrect", () => { const f = () => literalBigIntSchema.parse(BigInt(43)); expect(f).toThrow(); }); test("literal bigint number", () => { const f = () => literalBigIntSchema.parse("asdf"); expect(f).toThrow(); }); test("literal bigint boolean", () => { const f = () => literalBigIntSchema.parse(123); expect(f).toThrow(); }); test("literal bigint object", () => { const f = () => literalBigIntSchema.parse({}); expect(f).toThrow(); }); test("literal symbol", () => { util.assertEqual<z.infer<typeof literalSymbolSchema>, typeof MySymbol>(true); literalSymbolSchema.parse(MySymbol); expect(() => literalSymbolSchema.parse(Symbol("asdf"))).toThrow(); }); test("parse stringSchema string", () => { stringSchema.parse(val.string); }); test("parse stringSchema number", () => { const f = () => stringSchema.parse(val.number); expect(f).toThrow(); }); test("parse stringSchema boolean", () => { const f = () => stringSchema.parse(val.boolean); expect(f).toThrow(); }); test("parse stringSchema undefined", () => { const f = () => stringSchema.parse(val.undefined); expect(f).toThrow(); }); test("parse stringSchema null", () => { const f = () => stringSchema.parse(val.null); expect(f).toThrow(); }); test("parse numberSchema string", () => { const f = () => numberSchema.parse(val.string); expect(f).toThrow(); }); test("parse numberSchema number", () => { numberSchema.parse(val.number); }); test("parse numberSchema bigint", () => { const f = () => numberSchema.parse(val.bigint); expect(f).toThrow(); }); test("parse numberSchema boolean", () => { const f = () => numberSchema.parse(val.boolean); expect(f).toThrow(); }); test("parse numberSchema undefined", () => { const f = () => numberSchema.parse(val.undefined); expect(f).toThrow(); }); test("parse numberSchema null", () => { const f = () => numberSchema.parse(val.null); expect(f).toThrow(); }); test("parse bigintSchema string", () => { const f = () => bigintSchema.parse(val.string); expect(f).toThrow(); }); test("parse bigintSchema number", () => { const f = () => bigintSchema.parse(val.number); expect(f).toThrow(); }); test("parse bigintSchema bigint", () => { bigintSchema.parse(val.bigint); }); test("parse bigintSchema boolean", () => { const f = () => bigintSchema.parse(val.boolean); expect(f).toThrow(); }); test("parse bigintSchema undefined", () => { const f = () => bigintSchema.parse(val.undefined); expect(f).toThrow(); }); test("parse bigintSchema null", () => { const f = () => bigintSchema.parse(val.null); expect(f).toThrow(); }); test("parse booleanSchema string", () => { const f = () => booleanSchema.parse(val.string); expect(f).toThrow(); }); test("parse booleanSchema number", () => { const f = () => booleanSchema.parse(val.number); expect(f).toThrow(); }); test("parse booleanSchema boolean", () => { booleanSchema.parse(val.boolean); }); test("parse booleanSchema undefined", () => { const f = () => booleanSchema.parse(val.undefined); expect(f).toThrow(); }); test("parse booleanSchema null", () => { const f = () => booleanSchema.parse(val.null); expect(f).toThrow(); }); // ============== test("parse dateSchema string", () => { const f = () => dateSchema.parse(val.string); expect(f).toThrow(); }); test("parse dateSchema number", () => { const f = () => dateSchema.parse(val.number); expect(f).toThrow(); }); test("parse dateSchema boolean", () => { const f = () => dateSchema.parse(val.boolean); expect(f).toThrow(); }); test("parse dateSchema date", () => { dateSchema.parse(val.date); }); test("parse dateSchema undefined", () => { const f = () => dateSchema.parse(val.undefined); expect(f).toThrow(); }); test("parse dateSchema null", () => { const f = () => dateSchema.parse(val.null); expect(f).toThrow(); }); test("parse dateSchema invalid date", async () => { try { await dateSchema.parseAsync(new Date("invalid")); } catch (err) { expect((err as z.ZodError).issues[0].code).toEqual(z.ZodIssueCode.invalid_date); } }); // ============== test("parse symbolSchema string", () => { const f = () => symbolSchema.parse(val.string); expect(f).toThrow(); }); test("parse symbolSchema number", () => { const f = () => symbolSchema.parse(val.number); expect(f).toThrow(); }); test("parse symbolSchema boolean", () => { const f = () => symbolSchema.parse(val.boolean); expect(f).toThrow(); }); test("parse symbolSchema date", () => { const f = () => symbolSchema.parse(val.date); expect(f).toThrow(); }); test("parse symbolSchema symbol", () => { symbolSchema.parse(val.symbol); }); test("parse symbolSchema undefined", () => { const f = () => symbolSchema.parse(val.undefined); expect(f).toThrow(); }); test("parse symbolSchema null", () => { const f = () => symbolSchema.parse(val.null); expect(f).toThrow(); }); // ============== test("parse undefinedSchema string", () => { const f = () => undefinedSchema.parse(val.string); expect(f).toThrow(); }); test("parse undefinedSchema number", () => { const f = () => undefinedSchema.parse(val.number); expect(f).toThrow(); }); test("parse undefinedSchema boolean", () => { const f = () => undefinedSchema.parse(val.boolean); expect(f).toThrow(); }); test("parse undefinedSchema undefined", () => { undefinedSchema.parse(val.undefined); }); test("parse undefinedSchema null", () => { const f = () => undefinedSchema.parse(val.null); expect(f).toThrow(); }); test("parse nullSchema string", () => { const f = () => nullSchema.parse(val.string); expect(f).toThrow(); }); test("parse nullSchema number", () => { const f = () => nullSchema.parse(val.number); expect(f).toThrow(); }); test("parse nullSchema boolean", () => { const f = () => nullSchema.parse(val.boolean); expect(f).toThrow(); }); test("parse nullSchema undefined", () => { const f = () => nullSchema.parse(val.undefined); expect(f).toThrow(); }); test("parse nullSchema null", () => { nullSchema.parse(val.null); }); test("primitive inference", () => { util.assertEqual<z.TypeOf<typeof literalStringSchema>, "asdf">(true); util.assertEqual<z.TypeOf<typeof literalNumberSchema>, 12>(true); util.assertEqual<z.TypeOf<typeof literalBooleanSchema>, true>(true); util.assertEqual<z.TypeOf<typeof literalBigIntSchema>, bigint>(true); util.assertEqual<z.TypeOf<typeof stringSchema>, string>(true); util.assertEqual<z.TypeOf<typeof numberSchema>, number>(true); util.assertEqual<z.TypeOf<typeof bigintSchema>, bigint>(true); util.assertEqual<z.TypeOf<typeof booleanSchema>, boolean>(true); util.assertEqual<z.TypeOf<typeof dateSchema>, Date>(true); util.assertEqual<z.TypeOf<typeof symbolSchema>, symbol>(true); util.assertEqual<z.TypeOf<typeof nullSchema>, null>(true); util.assertEqual<z.TypeOf<typeof undefinedSchema>, undefined>(true); util.assertEqual<z.TypeOf<typeof stringSchemaOptional>, string | undefined>(true); util.assertEqual<z.TypeOf<typeof stringSchemaNullable>, string | null>(true); util.assertEqual<z.TypeOf<typeof numberSchemaOptional>, number | undefined>(true); util.assertEqual<z.TypeOf<typeof numberSchemaNullable>, number | null>(true); util.assertEqual<z.TypeOf<typeof bigintSchemaOptional>, bigint | undefined>(true); util.assertEqual<z.TypeOf<typeof bigintSchemaNullable>, bigint | null>(true); util.assertEqual<z.TypeOf<typeof booleanSchemaOptional>, boolean | undefined>(true); util.assertEqual<z.TypeOf<typeof booleanSchemaNullable>, boolean | null>(true); util.assertEqual<z.TypeOf<typeof dateSchemaOptional>, Date | undefined>(true); util.assertEqual<z.TypeOf<typeof dateSchemaNullable>, Date | null>(true); util.assertEqual<z.TypeOf<typeof symbolSchemaOptional>, symbol | undefined>(true); util.assertEqual<z.TypeOf<typeof symbolSchemaNullable>, symbol | null>(true); // [ // literalStringSchemaTest, // literalNumberSchemaTest, // literalBooleanSchemaTest, // literalBigIntSchemaTest, // stringSchemaTest, // numberSchemaTest, // bigintSchemaTest, // booleanSchemaTest, // dateSchemaTest, // symbolSchemaTest, // nullSchemaTest, // undefinedSchemaTest, // stringSchemaOptionalTest, // stringSchemaNullableTest, // numberSchemaOptionalTest, // numberSchemaNullableTest, // bigintSchemaOptionalTest, // bigintSchemaNullableTest, // booleanSchemaOptionalTest, // booleanSchemaNullableTest, // dateSchemaOptionalTest, // dateSchemaNullableTest, // symbolSchemaOptionalTest, // symbolSchemaNullableTest, // ]; }); test("get literal value", () => { expect(literalStringSchema.value).toEqual("asdf"); }); test("optional convenience method", () => { z.ostring().parse(undefined); z.onumber().parse(undefined); z.oboolean().parse(undefined); });
Close