zod 4.5.4 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compile.cjs +19 -0
- package/index.cjs +19 -0
- package/locales/index.cjs +19 -0
- package/mini/index.cjs +19 -0
- package/package.json +8 -7
- package/src/v3/helpers/errorUtil.ts +1 -1
- package/src/v4/classic/checks.ts +0 -1
- package/src/v4/classic/external.ts +2 -0
- package/src/v4/classic/from-json-schema.ts +248 -25
- package/src/v4/classic/schemas.ts +255 -164
- package/src/v4/classic/tests/assignability.test.ts +59 -9
- package/src/v4/classic/tests/bigint.test.ts +6 -0
- package/src/v4/classic/tests/continuability.test.ts +2 -2
- package/src/v4/classic/tests/cyclic-data.test.ts +274 -0
- package/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
- package/src/v4/classic/tests/enum.test.ts +9 -0
- package/src/v4/classic/tests/error.test.ts +130 -1
- package/src/v4/classic/tests/firstparty.test.ts +4 -0
- package/src/v4/classic/tests/from-json-schema.test.ts +157 -0
- package/src/v4/classic/tests/iban.test.ts +81 -0
- package/src/v4/classic/tests/instance-footprint.test.ts +18 -2
- package/src/v4/classic/tests/instanceof.test.ts +27 -7
- package/src/v4/classic/tests/issue-schema.test.ts +88 -56
- package/src/v4/classic/tests/object.test.ts +56 -0
- package/src/v4/classic/tests/optin-ladder.test.ts +3 -2
- package/src/v4/classic/tests/properties.test.ts +225 -0
- package/src/v4/classic/tests/recursive-types.test.ts +46 -1
- package/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/src/v4/classic/tests/string.test.ts +25 -0
- package/src/v4/classic/tests/template-literal.test.ts +33 -1
- package/src/v4/classic/tests/to-json-schema.test.ts +147 -3
- package/src/v4/classic/tests/validate.test.ts +569 -0
- package/src/v4/core/api.ts +30 -6
- package/src/v4/core/checks.ts +1 -101
- package/src/v4/core/compile.ts +194 -82
- package/src/v4/core/doc.ts +6 -2
- package/src/v4/core/errors.ts +3 -6
- package/src/v4/core/json-schema-generator.ts +2 -2
- package/src/v4/core/json-schema-processors.ts +226 -68
- package/src/v4/core/memoizer.ts +78 -28
- package/src/v4/core/parse.ts +37 -16
- package/src/v4/core/regexes.ts +10 -4
- package/src/v4/core/schemas.ts +350 -113
- package/src/v4/core/tests/cached.test.ts +54 -0
- package/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/src/v4/core/tests/compile.test.ts +222 -2
- package/src/v4/core/tests/email-regex.test.ts +140 -0
- package/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/src/v4/core/to-json-schema.ts +10 -8
- package/src/v4/core/util.ts +222 -147
- package/src/v4/core/versions.ts +2 -2
- package/src/v4/core/visit.ts +11 -0
- package/src/v4/locales/ar.ts +1 -0
- package/src/v4/locales/az.ts +1 -0
- package/src/v4/locales/be.ts +1 -0
- package/src/v4/locales/bg.ts +1 -0
- package/src/v4/locales/bn.ts +1 -0
- package/src/v4/locales/ca.ts +1 -0
- package/src/v4/locales/ckb.ts +1 -0
- package/src/v4/locales/cs.ts +1 -0
- package/src/v4/locales/da.ts +1 -0
- package/src/v4/locales/de.ts +1 -0
- package/src/v4/locales/el.ts +1 -0
- package/src/v4/locales/en.ts +1 -0
- package/src/v4/locales/eo.ts +1 -0
- package/src/v4/locales/es.ts +1 -0
- package/src/v4/locales/fa.ts +1 -0
- package/src/v4/locales/fi.ts +1 -0
- package/src/v4/locales/fr-CA.ts +1 -0
- package/src/v4/locales/fr.ts +1 -0
- package/src/v4/locales/gu.ts +1 -0
- package/src/v4/locales/he.ts +1 -0
- package/src/v4/locales/hi.ts +1 -0
- package/src/v4/locales/hr.ts +1 -0
- package/src/v4/locales/hu.ts +1 -0
- package/src/v4/locales/hy.ts +1 -0
- package/src/v4/locales/id.ts +1 -0
- package/src/v4/locales/index.ts +1 -0
- package/src/v4/locales/is.ts +1 -0
- package/src/v4/locales/it.ts +1 -0
- package/src/v4/locales/ja.ts +1 -0
- package/src/v4/locales/ka.ts +1 -0
- package/src/v4/locales/km.ts +1 -0
- package/src/v4/locales/kn.ts +1 -0
- package/src/v4/locales/ko.ts +1 -0
- package/src/v4/locales/lt.ts +1 -0
- package/src/v4/locales/mk.ts +1 -0
- package/src/v4/locales/ms.ts +1 -0
- package/src/v4/locales/ne.ts +1 -0
- package/src/v4/locales/nl.ts +1 -0
- package/src/v4/locales/nn.ts +1 -0
- package/src/v4/locales/no.ts +1 -0
- package/src/v4/locales/ota.ts +1 -0
- package/src/v4/locales/pl.ts +1 -0
- package/src/v4/locales/ps.ts +1 -0
- package/src/v4/locales/pt-BR.ts +1 -0
- package/src/v4/locales/pt.ts +1 -0
- package/src/v4/locales/ro.ts +1 -0
- package/src/v4/locales/ru.ts +1 -0
- package/src/v4/locales/sk.ts +1 -0
- package/src/v4/locales/sl.ts +1 -0
- package/src/v4/locales/sv.ts +1 -0
- package/src/v4/locales/ta.ts +1 -0
- package/src/v4/locales/tg.ts +134 -0
- package/src/v4/locales/th.ts +1 -0
- package/src/v4/locales/tk.ts +1 -0
- package/src/v4/locales/tr.ts +1 -0
- package/src/v4/locales/uk.ts +1 -0
- package/src/v4/locales/ur.ts +1 -0
- package/src/v4/locales/uz.ts +1 -0
- package/src/v4/locales/vi.ts +1 -0
- package/src/v4/locales/yo.ts +1 -0
- package/src/v4/locales/zh-CN.ts +1 -0
- package/src/v4/locales/zh-TW.ts +1 -0
- package/src/v4/mini/checks.ts +0 -1
- package/src/v4/mini/external.ts +2 -0
- package/src/v4/mini/schemas.ts +38 -2
- package/src/v4/mini/tests/checks.test.ts +1 -1
- package/src/v4/mini/tests/computed.test.ts +11 -17
- package/src/v4/mini/tests/index.test.ts +8 -0
- package/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/src/v4/mini/tests/string.test.ts +16 -0
- package/v3/ZodError.cjs +19 -0
- package/v3/errors.cjs +19 -0
- package/v3/external.cjs +19 -0
- package/v3/helpers/enumUtil.cjs +19 -0
- package/v3/helpers/errorUtil.cjs +20 -1
- package/v3/helpers/errorUtil.js +1 -1
- package/v3/helpers/parseUtil.cjs +19 -0
- package/v3/helpers/partialUtil.cjs +19 -0
- package/v3/helpers/typeAliases.cjs +19 -0
- package/v3/helpers/util.cjs +19 -0
- package/v3/index.cjs +19 -0
- package/v3/standard-schema.cjs +19 -0
- package/v3/types.cjs +19 -0
- package/v4/classic/checks.cjs +20 -2
- package/v4/classic/checks.d.cts +1 -1
- package/v4/classic/checks.d.ts +1 -1
- package/v4/classic/checks.js +1 -1
- package/v4/classic/coerce.cjs +19 -0
- package/v4/classic/compat.cjs +19 -0
- package/v4/classic/deep-partial.cjs +19 -0
- package/v4/classic/errors.cjs +19 -0
- package/v4/classic/external.cjs +22 -1
- package/v4/classic/external.d.cts +1 -1
- package/v4/classic/external.d.ts +1 -1
- package/v4/classic/external.js +1 -1
- package/v4/classic/from-json-schema.cjs +264 -24
- package/v4/classic/from-json-schema.js +245 -24
- package/v4/classic/in-out.cjs +19 -0
- package/v4/classic/index.cjs +19 -0
- package/v4/classic/iso.cjs +19 -0
- package/v4/classic/parse.cjs +19 -0
- package/v4/classic/schemas.cjs +100 -31
- package/v4/classic/schemas.d.cts +17 -1
- package/v4/classic/schemas.d.ts +17 -1
- package/v4/classic/schemas.js +77 -29
- package/v4/core/api.cjs +37 -2
- package/v4/core/api.d.cts +6 -4
- package/v4/core/api.d.ts +6 -4
- package/v4/core/api.js +17 -2
- package/v4/core/checks.cjs +19 -96
- package/v4/core/checks.d.cts +1 -1
- package/v4/core/checks.d.ts +1 -1
- package/v4/core/checks.js +0 -96
- package/v4/core/compile.cjs +165 -66
- package/v4/core/compile.d.cts +18 -4
- package/v4/core/compile.d.ts +18 -4
- package/v4/core/compile.js +146 -67
- package/v4/core/core.cjs +19 -0
- package/v4/core/doc.cjs +26 -2
- package/v4/core/doc.js +7 -2
- package/v4/core/errors.cjs +21 -5
- package/v4/core/errors.js +2 -5
- package/v4/core/index.cjs +19 -0
- package/v4/core/json-schema-generator.cjs +20 -1
- package/v4/core/json-schema-generator.js +2 -2
- package/v4/core/json-schema-processors.cjs +215 -63
- package/v4/core/json-schema-processors.d.cts +17 -0
- package/v4/core/json-schema-processors.d.ts +17 -0
- package/v4/core/json-schema-processors.js +195 -64
- package/v4/core/json-schema.cjs +19 -0
- package/v4/core/memoizer.cjs +114 -23
- package/v4/core/memoizer.js +72 -23
- package/v4/core/parse.cjs +56 -16
- package/v4/core/parse.js +37 -16
- package/v4/core/regexes.cjs +29 -6
- package/v4/core/regexes.d.cts +2 -0
- package/v4/core/regexes.d.ts +2 -0
- package/v4/core/regexes.js +8 -4
- package/v4/core/registries.cjs +19 -0
- package/v4/core/schemas.cjs +322 -95
- package/v4/core/schemas.d.cts +42 -7
- package/v4/core/schemas.d.ts +42 -7
- package/v4/core/schemas.js +301 -94
- package/v4/core/standard-schema.cjs +19 -0
- package/v4/core/to-json-schema.cjs +29 -7
- package/v4/core/to-json-schema.d.cts +7 -3
- package/v4/core/to-json-schema.d.ts +7 -3
- package/v4/core/to-json-schema.js +8 -7
- package/v4/core/util.cjs +181 -143
- package/v4/core/util.d.cts +25 -4
- package/v4/core/util.d.ts +25 -4
- package/v4/core/util.js +160 -143
- package/v4/core/versions.cjs +21 -2
- package/v4/core/versions.d.cts +1 -1
- package/v4/core/versions.d.ts +1 -1
- package/v4/core/versions.js +2 -2
- package/v4/core/visit.cjs +31 -0
- package/v4/core/visit.js +12 -0
- package/v4/index.cjs +19 -0
- package/v4/locales/ar.cjs +1 -0
- package/v4/locales/ar.js +1 -0
- package/v4/locales/az.cjs +1 -0
- package/v4/locales/az.js +1 -0
- package/v4/locales/be.cjs +1 -0
- package/v4/locales/be.js +1 -0
- package/v4/locales/bg.cjs +1 -0
- package/v4/locales/bg.js +1 -0
- package/v4/locales/bn.cjs +1 -0
- package/v4/locales/bn.js +1 -0
- package/v4/locales/ca.cjs +1 -0
- package/v4/locales/ca.js +1 -0
- package/v4/locales/ckb.cjs +1 -0
- package/v4/locales/ckb.js +1 -0
- package/v4/locales/cs.cjs +1 -0
- package/v4/locales/cs.js +1 -0
- package/v4/locales/da.cjs +1 -0
- package/v4/locales/da.js +1 -0
- package/v4/locales/de.cjs +1 -0
- package/v4/locales/de.js +1 -0
- package/v4/locales/el.cjs +1 -0
- package/v4/locales/el.js +1 -0
- package/v4/locales/en.cjs +1 -0
- package/v4/locales/en.js +1 -0
- package/v4/locales/eo.cjs +1 -0
- package/v4/locales/eo.js +1 -0
- package/v4/locales/es.cjs +1 -0
- package/v4/locales/es.js +1 -0
- package/v4/locales/fa.cjs +1 -0
- package/v4/locales/fa.js +1 -0
- package/v4/locales/fi.cjs +1 -0
- package/v4/locales/fi.js +1 -0
- package/v4/locales/fr-CA.cjs +1 -0
- package/v4/locales/fr-CA.js +1 -0
- package/v4/locales/fr.cjs +1 -0
- package/v4/locales/fr.js +1 -0
- package/v4/locales/gu.cjs +1 -0
- package/v4/locales/gu.js +1 -0
- package/v4/locales/he.cjs +1 -0
- package/v4/locales/he.js +1 -0
- package/v4/locales/hi.cjs +1 -0
- package/v4/locales/hi.js +1 -0
- package/v4/locales/hr.cjs +1 -0
- package/v4/locales/hr.js +1 -0
- package/v4/locales/hu.cjs +1 -0
- package/v4/locales/hu.js +1 -0
- package/v4/locales/hy.cjs +1 -0
- package/v4/locales/hy.js +1 -0
- package/v4/locales/id.cjs +1 -0
- package/v4/locales/id.js +1 -0
- package/v4/locales/index.cjs +22 -1
- package/v4/locales/index.d.cts +1 -0
- package/v4/locales/index.d.ts +1 -0
- package/v4/locales/index.js +1 -0
- package/v4/locales/is.cjs +1 -0
- package/v4/locales/is.js +1 -0
- package/v4/locales/it.cjs +1 -0
- package/v4/locales/it.js +1 -0
- package/v4/locales/ja.cjs +1 -0
- package/v4/locales/ja.js +1 -0
- package/v4/locales/ka.cjs +1 -0
- package/v4/locales/ka.js +1 -0
- package/v4/locales/km.cjs +1 -0
- package/v4/locales/km.js +1 -0
- package/v4/locales/kn.cjs +1 -0
- package/v4/locales/kn.js +1 -0
- package/v4/locales/ko.cjs +1 -0
- package/v4/locales/ko.js +1 -0
- package/v4/locales/lt.cjs +1 -0
- package/v4/locales/lt.js +1 -0
- package/v4/locales/mk.cjs +1 -0
- package/v4/locales/mk.js +1 -0
- package/v4/locales/ms.cjs +1 -0
- package/v4/locales/ms.js +1 -0
- package/v4/locales/ne.cjs +1 -0
- package/v4/locales/ne.js +1 -0
- package/v4/locales/nl.cjs +1 -0
- package/v4/locales/nl.js +1 -0
- package/v4/locales/nn.cjs +1 -0
- package/v4/locales/nn.js +1 -0
- package/v4/locales/no.cjs +1 -0
- package/v4/locales/no.js +1 -0
- package/v4/locales/ota.cjs +1 -0
- package/v4/locales/ota.js +1 -0
- package/v4/locales/pl.cjs +1 -0
- package/v4/locales/pl.js +1 -0
- package/v4/locales/ps.cjs +1 -0
- package/v4/locales/ps.js +1 -0
- package/v4/locales/pt-BR.cjs +1 -0
- package/v4/locales/pt-BR.js +1 -0
- package/v4/locales/pt.cjs +1 -0
- package/v4/locales/pt.js +1 -0
- package/v4/locales/ro.cjs +1 -0
- package/v4/locales/ro.js +1 -0
- package/v4/locales/ru.cjs +1 -0
- package/v4/locales/ru.js +1 -0
- package/v4/locales/sk.cjs +1 -0
- package/v4/locales/sk.js +1 -0
- package/v4/locales/sl.cjs +1 -0
- package/v4/locales/sl.js +1 -0
- package/v4/locales/sv.cjs +1 -0
- package/v4/locales/sv.js +1 -0
- package/v4/locales/ta.cjs +1 -0
- package/v4/locales/ta.js +1 -0
- package/v4/locales/tg.cjs +143 -0
- package/v4/locales/tg.d.cts +5 -0
- package/v4/locales/tg.d.ts +4 -0
- package/v4/locales/tg.js +116 -0
- package/v4/locales/th.cjs +1 -0
- package/v4/locales/th.js +1 -0
- package/v4/locales/tk.cjs +1 -0
- package/v4/locales/tk.js +1 -0
- package/v4/locales/tr.cjs +1 -0
- package/v4/locales/tr.js +1 -0
- package/v4/locales/uk.cjs +1 -0
- package/v4/locales/uk.js +1 -0
- package/v4/locales/ur.cjs +1 -0
- package/v4/locales/ur.js +1 -0
- package/v4/locales/uz.cjs +1 -0
- package/v4/locales/uz.js +1 -0
- package/v4/locales/vi.cjs +1 -0
- package/v4/locales/vi.js +1 -0
- package/v4/locales/yo.cjs +1 -0
- package/v4/locales/yo.js +1 -0
- package/v4/locales/zh-CN.cjs +1 -0
- package/v4/locales/zh-CN.js +1 -0
- package/v4/locales/zh-TW.cjs +1 -0
- package/v4/locales/zh-TW.js +1 -0
- package/v4/mini/checks.cjs +20 -2
- package/v4/mini/checks.d.cts +1 -1
- package/v4/mini/checks.d.ts +1 -1
- package/v4/mini/checks.js +1 -1
- package/v4/mini/coerce.cjs +19 -0
- package/v4/mini/deep-partial.cjs +19 -0
- package/v4/mini/external.cjs +22 -1
- package/v4/mini/external.d.cts +1 -1
- package/v4/mini/external.d.ts +1 -1
- package/v4/mini/external.js +1 -1
- package/v4/mini/in-out.cjs +19 -0
- package/v4/mini/index.cjs +19 -0
- package/v4/mini/iso.cjs +19 -0
- package/v4/mini/parse.cjs +19 -0
- package/v4/mini/schemas.cjs +42 -4
- package/v4/mini/schemas.d.cts +8 -0
- package/v4/mini/schemas.d.ts +8 -0
- package/v4/mini/schemas.js +19 -2
- package/v4-mini/index.cjs +19 -0
|
@@ -2,35 +2,29 @@ import { expect, test } from "vitest";
|
|
|
2
2
|
import * as z from "zod/mini";
|
|
3
3
|
import { util as zc } from "zod/v4/core";
|
|
4
4
|
|
|
5
|
+
// checks no longer write metadata into the bag at attach time; the converter folds the checks itself, so the derived values are asserted through it
|
|
6
|
+
|
|
5
7
|
test("min/max", () => {
|
|
6
8
|
const a = z.number().check(z.minimum(5), z.minimum(6), z.minimum(7), z.maximum(10), z.maximum(11), z.maximum(12));
|
|
7
|
-
|
|
8
|
-
expect(a._zod.bag
|
|
9
|
-
expect(a._zod.bag.maximum).toEqual(10);
|
|
9
|
+
expect(z.toJSONSchema(a)).toMatchObject({ minimum: 7, maximum: 10 });
|
|
10
|
+
expect(a._zod.bag).toEqual({});
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
test("multipleOf", () => {
|
|
13
14
|
const b = z.number().check(z.multipleOf(5));
|
|
14
|
-
expect(b
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
test("int64 format", () => {
|
|
18
|
-
const c = z.int64();
|
|
19
|
-
expect(c._zod.bag.format).toEqual("int64");
|
|
20
|
-
expect(c._zod.bag.minimum).toEqual(zc.BIGINT_FORMAT_RANGES.int64[0]);
|
|
21
|
-
expect(c._zod.bag.maximum).toEqual(zc.BIGINT_FORMAT_RANGES.int64[1]);
|
|
15
|
+
expect(z.toJSONSchema(b)).toMatchObject({ multipleOf: 5 });
|
|
22
16
|
});
|
|
23
17
|
|
|
24
18
|
test("int32 format", () => {
|
|
25
19
|
const d = z.int32();
|
|
26
|
-
expect(d
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
expect(z.toJSONSchema(d)).toMatchObject({
|
|
21
|
+
type: "integer",
|
|
22
|
+
minimum: zc.NUMBER_FORMAT_RANGES.int32[0],
|
|
23
|
+
maximum: zc.NUMBER_FORMAT_RANGES.int32[1],
|
|
24
|
+
});
|
|
29
25
|
});
|
|
30
26
|
|
|
31
27
|
test("array size", () => {
|
|
32
28
|
const e = z.array(z.string()).check(z.length(5));
|
|
33
|
-
expect(e
|
|
34
|
-
expect(e._zod.bag.minimum).toEqual(5);
|
|
35
|
-
expect(e._zod.bag.maximum).toEqual(5);
|
|
29
|
+
expect(z.toJSONSchema(e)).toMatchObject({ minItems: 5, maxItems: 5 });
|
|
36
30
|
});
|
|
@@ -491,6 +491,14 @@ test("z.enum - native", () => {
|
|
|
491
491
|
// expect(a.enum.A).toEqual(NativeEnum.A);
|
|
492
492
|
// expect(a.enum.B).toEqual(NativeEnum.B);
|
|
493
493
|
// expect(a.enum.C).toEqual(NativeEnum.C);
|
|
494
|
+
|
|
495
|
+
enum NumericEnum {
|
|
496
|
+
A = 0,
|
|
497
|
+
B = 1,
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// numeric enums carry reverse-mapping keys; options lists only what parse accepts
|
|
501
|
+
expect(z.enum(NumericEnum).options).toEqual([NumericEnum.A, NumericEnum.B]);
|
|
494
502
|
});
|
|
495
503
|
|
|
496
504
|
test("z.nativeEnum", () => {
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { expect, expectTypeOf, test } from "vitest";
|
|
2
2
|
import { z } from "zod/mini";
|
|
3
3
|
|
|
4
|
+
test("recursive object schema type aliases", () => {
|
|
5
|
+
type ObjectField = z.ZodMiniObject<{ [k: string]: ObjectField }>;
|
|
6
|
+
type Field = z.ZodMiniString<string> | z.ZodMiniObject<{ [k: string]: Field }>;
|
|
7
|
+
type ObjectValue = { [k: string]: ObjectValue };
|
|
8
|
+
type Value = string | { [k: string]: Value };
|
|
9
|
+
expectTypeOf<z.input<ObjectField>>().toEqualTypeOf<ObjectValue>();
|
|
10
|
+
expectTypeOf<z.output<ObjectField>>().toEqualTypeOf<ObjectValue>();
|
|
11
|
+
expectTypeOf<keyof z.input<ObjectField>>().toEqualTypeOf<string>();
|
|
12
|
+
expectTypeOf<keyof z.output<ObjectField>>().toEqualTypeOf<string>();
|
|
13
|
+
expectTypeOf<z.input<Field>>().toEqualTypeOf<Value>();
|
|
14
|
+
expectTypeOf<z.output<Field>>().toEqualTypeOf<Value>();
|
|
15
|
+
const schema: Field = z.object({ nested: z.object({ name: z.string() }) });
|
|
16
|
+
expect(schema.parse({ nested: { name: "a", extra: true } })).toEqual({ nested: { name: "a" } });
|
|
17
|
+
expect(schema.safeParse({ nested: { name: 123 } }).success).toBe(false);
|
|
18
|
+
});
|
|
19
|
+
|
|
4
20
|
test("recursion with z.lazy", () => {
|
|
5
21
|
const data = {
|
|
6
22
|
name: "I",
|
|
@@ -338,6 +338,22 @@ test("z.creditCard", () => {
|
|
|
338
338
|
expect(() => z.parse(a, 123)).toThrow();
|
|
339
339
|
});
|
|
340
340
|
|
|
341
|
+
test("z.iban", () => {
|
|
342
|
+
const a = z.iban();
|
|
343
|
+
// valid iban
|
|
344
|
+
expect(z.parse(a, "DE89370400440532013000")).toEqual("DE89370400440532013000");
|
|
345
|
+
expect(z.parse(a, "NO9386011117947")).toEqual("NO9386011117947");
|
|
346
|
+
// failed mod 97 checksum
|
|
347
|
+
expect(() => z.parse(a, "DE89370400440532013001")).toThrow();
|
|
348
|
+
// formatting violations
|
|
349
|
+
expect(() => z.parse(a, "de89370400440532013000")).toThrow();
|
|
350
|
+
expect(() => z.parse(a, "DE89 3704 0044 0532 0130 00")).toThrow();
|
|
351
|
+
expect(() => z.parse(a, "NO938601111794")).toThrow();
|
|
352
|
+
expect(() => z.parse(a, "hello")).toThrow();
|
|
353
|
+
// wrong type
|
|
354
|
+
expect(() => z.parse(a, 123)).toThrow();
|
|
355
|
+
});
|
|
356
|
+
|
|
341
357
|
test("z.jwt", () => {
|
|
342
358
|
const a = z.jwt();
|
|
343
359
|
// valid jwt
|
package/v3/ZodError.cjs
CHANGED
|
@@ -146,3 +146,22 @@ ZodError.create = (issues) => {
|
|
|
146
146
|
const error = new ZodError(issues);
|
|
147
147
|
return error;
|
|
148
148
|
};
|
|
149
|
+
|
|
150
|
+
// seal-cjs-exports
|
|
151
|
+
(function () {
|
|
152
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
153
|
+
for (var i = 0; i < keys.length; i++) {
|
|
154
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
155
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
156
|
+
var value;
|
|
157
|
+
try {
|
|
158
|
+
value = desc.get();
|
|
159
|
+
} catch (e) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
163
|
+
if (value === undefined) continue;
|
|
164
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
165
|
+
}
|
|
166
|
+
Object.freeze(exports);
|
|
167
|
+
})();
|
package/v3/errors.cjs
CHANGED
|
@@ -15,3 +15,22 @@ function setErrorMap(map) {
|
|
|
15
15
|
function getErrorMap() {
|
|
16
16
|
return overrideErrorMap;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
// seal-cjs-exports
|
|
20
|
+
(function () {
|
|
21
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
22
|
+
for (var i = 0; i < keys.length; i++) {
|
|
23
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
24
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
25
|
+
var value;
|
|
26
|
+
try {
|
|
27
|
+
value = desc.get();
|
|
28
|
+
} catch (e) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
32
|
+
if (value === undefined) continue;
|
|
33
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
34
|
+
}
|
|
35
|
+
Object.freeze(exports);
|
|
36
|
+
})();
|
package/v3/external.cjs
CHANGED
|
@@ -20,3 +20,22 @@ __exportStar(require("./helpers/typeAliases.cjs"), exports);
|
|
|
20
20
|
__exportStar(require("./helpers/util.cjs"), exports);
|
|
21
21
|
__exportStar(require("./types.cjs"), exports);
|
|
22
22
|
__exportStar(require("./ZodError.cjs"), exports);
|
|
23
|
+
|
|
24
|
+
// seal-cjs-exports
|
|
25
|
+
(function () {
|
|
26
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
27
|
+
for (var i = 0; i < keys.length; i++) {
|
|
28
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
29
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
30
|
+
var value;
|
|
31
|
+
try {
|
|
32
|
+
value = desc.get();
|
|
33
|
+
} catch (e) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
37
|
+
if (value === undefined) continue;
|
|
38
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
39
|
+
}
|
|
40
|
+
Object.freeze(exports);
|
|
41
|
+
})();
|
package/v3/helpers/enumUtil.cjs
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
|
|
4
|
+
// seal-cjs-exports
|
|
5
|
+
(function () {
|
|
6
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
7
|
+
for (var i = 0; i < keys.length; i++) {
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
9
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
10
|
+
var value;
|
|
11
|
+
try {
|
|
12
|
+
value = desc.get();
|
|
13
|
+
} catch (e) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
17
|
+
if (value === undefined) continue;
|
|
18
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
19
|
+
}
|
|
20
|
+
Object.freeze(exports);
|
|
21
|
+
})();
|
package/v3/helpers/errorUtil.cjs
CHANGED
|
@@ -4,6 +4,25 @@ exports.errorUtil = void 0;
|
|
|
4
4
|
var errorUtil;
|
|
5
5
|
(function (errorUtil) {
|
|
6
6
|
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
7
|
-
// biome-ignore lint:
|
|
7
|
+
// biome-ignore lint/suspicious/noShadowRestrictedNames: renaming churns 31 v3 call sites
|
|
8
8
|
errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
9
9
|
})(errorUtil || (exports.errorUtil = errorUtil = {}));
|
|
10
|
+
|
|
11
|
+
// seal-cjs-exports
|
|
12
|
+
(function () {
|
|
13
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
14
|
+
for (var i = 0; i < keys.length; i++) {
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
16
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
17
|
+
var value;
|
|
18
|
+
try {
|
|
19
|
+
value = desc.get();
|
|
20
|
+
} catch (e) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
24
|
+
if (value === undefined) continue;
|
|
25
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
26
|
+
}
|
|
27
|
+
Object.freeze(exports);
|
|
28
|
+
})();
|
package/v3/helpers/errorUtil.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var errorUtil;
|
|
2
2
|
(function (errorUtil) {
|
|
3
3
|
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
4
|
-
// biome-ignore lint:
|
|
4
|
+
// biome-ignore lint/suspicious/noShadowRestrictedNames: renaming churns 31 v3 call sites
|
|
5
5
|
errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
6
6
|
})(errorUtil || (errorUtil = {}));
|
package/v3/helpers/parseUtil.cjs
CHANGED
|
@@ -122,3 +122,22 @@ const isValid = (x) => x.status === "valid";
|
|
|
122
122
|
exports.isValid = isValid;
|
|
123
123
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
124
124
|
exports.isAsync = isAsync;
|
|
125
|
+
|
|
126
|
+
// seal-cjs-exports
|
|
127
|
+
(function () {
|
|
128
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
129
|
+
for (var i = 0; i < keys.length; i++) {
|
|
130
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
131
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
132
|
+
var value;
|
|
133
|
+
try {
|
|
134
|
+
value = desc.get();
|
|
135
|
+
} catch (e) {
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
139
|
+
if (value === undefined) continue;
|
|
140
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
141
|
+
}
|
|
142
|
+
Object.freeze(exports);
|
|
143
|
+
})();
|
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
|
|
4
|
+
// seal-cjs-exports
|
|
5
|
+
(function () {
|
|
6
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
7
|
+
for (var i = 0; i < keys.length; i++) {
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
9
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
10
|
+
var value;
|
|
11
|
+
try {
|
|
12
|
+
value = desc.get();
|
|
13
|
+
} catch (e) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
17
|
+
if (value === undefined) continue;
|
|
18
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
19
|
+
}
|
|
20
|
+
Object.freeze(exports);
|
|
21
|
+
})();
|
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
|
|
4
|
+
// seal-cjs-exports
|
|
5
|
+
(function () {
|
|
6
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
7
|
+
for (var i = 0; i < keys.length; i++) {
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
9
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
10
|
+
var value;
|
|
11
|
+
try {
|
|
12
|
+
value = desc.get();
|
|
13
|
+
} catch (e) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
17
|
+
if (value === undefined) continue;
|
|
18
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
19
|
+
}
|
|
20
|
+
Object.freeze(exports);
|
|
21
|
+
})();
|
package/v3/helpers/util.cjs
CHANGED
|
@@ -135,3 +135,22 @@ const getParsedType = (data) => {
|
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
exports.getParsedType = getParsedType;
|
|
138
|
+
|
|
139
|
+
// seal-cjs-exports
|
|
140
|
+
(function () {
|
|
141
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
142
|
+
for (var i = 0; i < keys.length; i++) {
|
|
143
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
144
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
145
|
+
var value;
|
|
146
|
+
try {
|
|
147
|
+
value = desc.get();
|
|
148
|
+
} catch (e) {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
152
|
+
if (value === undefined) continue;
|
|
153
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
154
|
+
}
|
|
155
|
+
Object.freeze(exports);
|
|
156
|
+
})();
|
package/v3/index.cjs
CHANGED
|
@@ -31,3 +31,22 @@ const z = __importStar(require("./external.cjs"));
|
|
|
31
31
|
exports.z = z;
|
|
32
32
|
__exportStar(require("./external.cjs"), exports);
|
|
33
33
|
exports.default = z;
|
|
34
|
+
|
|
35
|
+
// seal-cjs-exports
|
|
36
|
+
(function () {
|
|
37
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
38
|
+
for (var i = 0; i < keys.length; i++) {
|
|
39
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
40
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
41
|
+
var value;
|
|
42
|
+
try {
|
|
43
|
+
value = desc.get();
|
|
44
|
+
} catch (e) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
48
|
+
if (value === undefined) continue;
|
|
49
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
50
|
+
}
|
|
51
|
+
Object.freeze(exports);
|
|
52
|
+
})();
|
package/v3/standard-schema.cjs
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
|
|
4
|
+
// seal-cjs-exports
|
|
5
|
+
(function () {
|
|
6
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
7
|
+
for (var i = 0; i < keys.length; i++) {
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
9
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
10
|
+
var value;
|
|
11
|
+
try {
|
|
12
|
+
value = desc.get();
|
|
13
|
+
} catch (e) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
17
|
+
if (value === undefined) continue;
|
|
18
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
19
|
+
}
|
|
20
|
+
Object.freeze(exports);
|
|
21
|
+
})();
|
package/v3/types.cjs
CHANGED
|
@@ -3777,3 +3777,22 @@ exports.coerce = {
|
|
|
3777
3777
|
date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
|
|
3778
3778
|
};
|
|
3779
3779
|
exports.NEVER = parseUtil_js_1.INVALID;
|
|
3780
|
+
|
|
3781
|
+
// seal-cjs-exports
|
|
3782
|
+
(function () {
|
|
3783
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
3784
|
+
for (var i = 0; i < keys.length; i++) {
|
|
3785
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
3786
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
3787
|
+
var value;
|
|
3788
|
+
try {
|
|
3789
|
+
value = desc.get();
|
|
3790
|
+
} catch (e) {
|
|
3791
|
+
continue;
|
|
3792
|
+
}
|
|
3793
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
3794
|
+
if (value === undefined) continue;
|
|
3795
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
3796
|
+
}
|
|
3797
|
+
Object.freeze(exports);
|
|
3798
|
+
})();
|
package/v4/classic/checks.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.slugify = exports.toUpperCase = exports.toLowerCase = exports.trim = exports.normalize = exports.overwrite = exports.mime = exports.
|
|
3
|
+
exports.slugify = exports.toUpperCase = exports.toLowerCase = exports.trim = exports.normalize = exports.overwrite = exports.mime = exports.property = exports.endsWith = exports.startsWith = exports.includes = exports.uppercase = exports.lowercase = exports.regex = exports.length = exports.minLength = exports.maxLength = exports.size = exports.minSize = exports.maxSize = exports.multipleOf = exports.nonnegative = exports.nonpositive = exports.negative = exports.positive = exports.gte = exports.gt = exports.lte = exports.lt = void 0;
|
|
4
4
|
var index_js_1 = require("../core/index.cjs");
|
|
5
5
|
Object.defineProperty(exports, "lt", { enumerable: true, get: function () { return index_js_1._lt; } });
|
|
6
6
|
Object.defineProperty(exports, "lte", { enumerable: true, get: function () { return index_js_1._lte; } });
|
|
@@ -24,7 +24,6 @@ Object.defineProperty(exports, "includes", { enumerable: true, get: function ()
|
|
|
24
24
|
Object.defineProperty(exports, "startsWith", { enumerable: true, get: function () { return index_js_1._startsWith; } });
|
|
25
25
|
Object.defineProperty(exports, "endsWith", { enumerable: true, get: function () { return index_js_1._endsWith; } });
|
|
26
26
|
Object.defineProperty(exports, "property", { enumerable: true, get: function () { return index_js_1._property; } });
|
|
27
|
-
Object.defineProperty(exports, "properties", { enumerable: true, get: function () { return index_js_1._properties; } });
|
|
28
27
|
Object.defineProperty(exports, "mime", { enumerable: true, get: function () { return index_js_1._mime; } });
|
|
29
28
|
Object.defineProperty(exports, "overwrite", { enumerable: true, get: function () { return index_js_1._overwrite; } });
|
|
30
29
|
Object.defineProperty(exports, "normalize", { enumerable: true, get: function () { return index_js_1._normalize; } });
|
|
@@ -32,3 +31,22 @@ Object.defineProperty(exports, "trim", { enumerable: true, get: function () { re
|
|
|
32
31
|
Object.defineProperty(exports, "toLowerCase", { enumerable: true, get: function () { return index_js_1._toLowerCase; } });
|
|
33
32
|
Object.defineProperty(exports, "toUpperCase", { enumerable: true, get: function () { return index_js_1._toUpperCase; } });
|
|
34
33
|
Object.defineProperty(exports, "slugify", { enumerable: true, get: function () { return index_js_1._slugify; } });
|
|
34
|
+
|
|
35
|
+
// seal-cjs-exports
|
|
36
|
+
(function () {
|
|
37
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
38
|
+
for (var i = 0; i < keys.length; i++) {
|
|
39
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
40
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
41
|
+
var value;
|
|
42
|
+
try {
|
|
43
|
+
value = desc.get();
|
|
44
|
+
} catch (e) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
48
|
+
if (value === undefined) continue;
|
|
49
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
50
|
+
}
|
|
51
|
+
Object.freeze(exports);
|
|
52
|
+
})();
|
package/v4/classic/checks.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property,
|
|
1
|
+
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, type $RefinementCtx as RefinementCtx, } from "../core/index.cjs";
|
package/v4/classic/checks.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property,
|
|
1
|
+
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, type $RefinementCtx as RefinementCtx, } from "../core/index.js";
|
package/v4/classic/checks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property,
|
|
1
|
+
export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, } from "../core/index.js";
|
package/v4/classic/coerce.cjs
CHANGED
|
@@ -45,3 +45,22 @@ function bigint(params) {
|
|
|
45
45
|
function date(params) {
|
|
46
46
|
return core._coercedDate(schemas.ZodDate, params);
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
// seal-cjs-exports
|
|
50
|
+
(function () {
|
|
51
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
52
|
+
for (var i = 0; i < keys.length; i++) {
|
|
53
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
54
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
55
|
+
var value;
|
|
56
|
+
try {
|
|
57
|
+
value = desc.get();
|
|
58
|
+
} catch (e) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
62
|
+
if (value === undefined) continue;
|
|
63
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
64
|
+
}
|
|
65
|
+
Object.freeze(exports);
|
|
66
|
+
})();
|
package/v4/classic/compat.cjs
CHANGED
|
@@ -59,3 +59,22 @@ function getErrorMap() {
|
|
|
59
59
|
var ZodFirstPartyTypeKind;
|
|
60
60
|
(function (ZodFirstPartyTypeKind) {
|
|
61
61
|
})(ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = ZodFirstPartyTypeKind = {}));
|
|
62
|
+
|
|
63
|
+
// seal-cjs-exports
|
|
64
|
+
(function () {
|
|
65
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
66
|
+
for (var i = 0; i < keys.length; i++) {
|
|
67
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
68
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
69
|
+
var value;
|
|
70
|
+
try {
|
|
71
|
+
value = desc.get();
|
|
72
|
+
} catch (e) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
76
|
+
if (value === undefined) continue;
|
|
77
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
78
|
+
}
|
|
79
|
+
Object.freeze(exports);
|
|
80
|
+
})();
|
|
@@ -37,3 +37,22 @@ function deepPartial(schema) {
|
|
|
37
37
|
},
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
// seal-cjs-exports
|
|
42
|
+
(function () {
|
|
43
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
44
|
+
for (var i = 0; i < keys.length; i++) {
|
|
45
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
46
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
47
|
+
var value;
|
|
48
|
+
try {
|
|
49
|
+
value = desc.get();
|
|
50
|
+
} catch (e) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
54
|
+
if (value === undefined) continue;
|
|
55
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
56
|
+
}
|
|
57
|
+
Object.freeze(exports);
|
|
58
|
+
})();
|
package/v4/classic/errors.cjs
CHANGED
|
@@ -81,3 +81,22 @@ exports.ZodRealError = core.$constructor("ZodError", initializer, undefined, {
|
|
|
81
81
|
});
|
|
82
82
|
// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */
|
|
83
83
|
// export type ErrorMapCtx = core.$ZodErrorMapCtx;
|
|
84
|
+
|
|
85
|
+
// seal-cjs-exports
|
|
86
|
+
(function () {
|
|
87
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
88
|
+
for (var i = 0; i < keys.length; i++) {
|
|
89
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
90
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
91
|
+
var value;
|
|
92
|
+
try {
|
|
93
|
+
value = desc.get();
|
|
94
|
+
} catch (e) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
98
|
+
if (value === undefined) continue;
|
|
99
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
100
|
+
}
|
|
101
|
+
Object.freeze(exports);
|
|
102
|
+
})();
|
package/v4/classic/external.cjs
CHANGED
|
@@ -26,7 +26,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.coerce = exports.iso = exports.ZodISODuration = exports.ZodISOTime = exports.ZodISODate = exports.ZodISODateTime = exports.locales = exports.output = exports.input = exports.deepPartial = exports.fromJSONSchema = exports.toJSONSchema = exports.getDiscriminatedOption = exports.ZodCompileUnsupportedError = exports.ZodCompileAsyncError = exports.compile = exports.toZod = exports.NEVER = exports.util = exports.TimePrecision = exports.flattenError = exports.formatError = exports.prettifyError = exports.treeifyError = exports.regexes = exports.clone = exports.$brand = exports.$input = exports.$output = exports.memoizer = exports.config = exports.registry = exports.globalRegistry = exports.core = void 0;
|
|
29
|
+
exports.coerce = exports.iso = exports.ZodISODuration = exports.ZodISOTime = exports.ZodISODate = exports.ZodISODateTime = exports.locales = exports.output = exports.input = exports.deepPartial = exports.fromJSONSchema = exports.toJSONSchema = exports.getDiscriminatedOption = exports.ZodCompileUnsupportedError = exports.ZodCompileAsyncError = exports.withParser = exports.compile = exports.toZod = exports.INVALID = exports.NEVER = exports.util = exports.TimePrecision = exports.flattenError = exports.formatError = exports.prettifyError = exports.treeifyError = exports.regexes = exports.clone = exports.$brand = exports.$input = exports.$output = exports.memoizer = exports.config = exports.registry = exports.globalRegistry = exports.core = void 0;
|
|
30
30
|
exports.core = __importStar(require("../core/index.cjs"));
|
|
31
31
|
__exportStar(require("./schemas.cjs"), exports);
|
|
32
32
|
__exportStar(require("./checks.cjs"), exports);
|
|
@@ -50,8 +50,10 @@ Object.defineProperty(exports, "flattenError", { enumerable: true, get: function
|
|
|
50
50
|
Object.defineProperty(exports, "TimePrecision", { enumerable: true, get: function () { return index_js_1.TimePrecision; } });
|
|
51
51
|
Object.defineProperty(exports, "util", { enumerable: true, get: function () { return index_js_1.util; } });
|
|
52
52
|
Object.defineProperty(exports, "NEVER", { enumerable: true, get: function () { return index_js_1.NEVER; } });
|
|
53
|
+
Object.defineProperty(exports, "INVALID", { enumerable: true, get: function () { return index_js_1.INVALID; } });
|
|
53
54
|
Object.defineProperty(exports, "toZod", { enumerable: true, get: function () { return index_js_1.toZod; } });
|
|
54
55
|
Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return index_js_1.compile; } });
|
|
56
|
+
Object.defineProperty(exports, "withParser", { enumerable: true, get: function () { return index_js_1.withParser; } });
|
|
55
57
|
Object.defineProperty(exports, "ZodCompileAsyncError", { enumerable: true, get: function () { return index_js_1.ZodCompileAsyncError; } });
|
|
56
58
|
Object.defineProperty(exports, "ZodCompileUnsupportedError", { enumerable: true, get: function () { return index_js_1.ZodCompileUnsupportedError; } });
|
|
57
59
|
Object.defineProperty(exports, "getDiscriminatedOption", { enumerable: true, get: function () { return index_js_1.getDiscriminatedOption; } });
|
|
@@ -74,3 +76,22 @@ Object.defineProperty(exports, "ZodISOTime", { enumerable: true, get: function (
|
|
|
74
76
|
Object.defineProperty(exports, "ZodISODuration", { enumerable: true, get: function () { return iso_js_1.ZodISODuration; } });
|
|
75
77
|
exports.iso = __importStar(require("./iso.cjs"));
|
|
76
78
|
exports.coerce = __importStar(require("./coerce.cjs"));
|
|
79
|
+
|
|
80
|
+
// seal-cjs-exports
|
|
81
|
+
(function () {
|
|
82
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
83
|
+
for (var i = 0; i < keys.length; i++) {
|
|
84
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
85
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
86
|
+
var value;
|
|
87
|
+
try {
|
|
88
|
+
value = desc.get();
|
|
89
|
+
} catch (e) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
93
|
+
if (value === undefined) continue;
|
|
94
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
95
|
+
}
|
|
96
|
+
Object.freeze(exports);
|
|
97
|
+
})();
|
|
@@ -7,7 +7,7 @@ export * from "./compat.cjs";
|
|
|
7
7
|
export type { infer } from "../core/index.cjs";
|
|
8
8
|
export type { JSONType } from "../core/util.cjs";
|
|
9
9
|
export type { CompileOptions } from "../core/index.cjs";
|
|
10
|
-
export { globalRegistry, type GlobalMeta, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, toZod, compile, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.cjs";
|
|
10
|
+
export { globalRegistry, type GlobalMeta, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.cjs";
|
|
11
11
|
export { toJSONSchema } from "../core/json-schema-processors.cjs";
|
|
12
12
|
export { fromJSONSchema } from "./from-json-schema.cjs";
|
|
13
13
|
export { deepPartial } from "./deep-partial.cjs";
|
package/v4/classic/external.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export * from "./compat.js";
|
|
|
7
7
|
export type { infer } from "../core/index.js";
|
|
8
8
|
export type { JSONType } from "../core/util.js";
|
|
9
9
|
export type { CompileOptions } from "../core/index.js";
|
|
10
|
-
export { globalRegistry, type GlobalMeta, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, toZod, compile, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
|
|
10
|
+
export { globalRegistry, type GlobalMeta, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
|
|
11
11
|
export { toJSONSchema } from "../core/json-schema-processors.js";
|
|
12
12
|
export { fromJSONSchema } from "./from-json-schema.js";
|
|
13
13
|
export { deepPartial } from "./deep-partial.js";
|
package/v4/classic/external.js
CHANGED
|
@@ -4,7 +4,7 @@ export * from "./checks.js";
|
|
|
4
4
|
export * from "./errors.js";
|
|
5
5
|
export * from "./parse.js";
|
|
6
6
|
export * from "./compat.js";
|
|
7
|
-
export { globalRegistry, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, toZod, compile, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
|
|
7
|
+
export { globalRegistry, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
|
|
8
8
|
export { toJSONSchema } from "../core/json-schema-processors.js";
|
|
9
9
|
export { fromJSONSchema } from "./from-json-schema.js";
|
|
10
10
|
export { deepPartial } from "./deep-partial.js";
|