zod 3.25.67 → 3.25.68-alpha.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/README.md +2 -2
- package/dist/{types → commonjs}/package.json +1 -1
- package/dist/{cjs/v4/classic → commonjs/v3}/index.js +17 -7
- package/dist/{cjs → commonjs}/v3/locales/en.js +2 -0
- package/dist/commonjs/v3/tests/language-server.source.d.ts +70 -0
- package/dist/commonjs/v3/tests/language-server.source.js +81 -0
- package/dist/{cjs → commonjs}/v4/classic/coerce.js +17 -7
- package/dist/{cjs → commonjs}/v4/classic/compat.js +17 -7
- package/dist/{cjs → commonjs}/v4/classic/errors.js +17 -7
- package/dist/{cjs → commonjs}/v4/classic/external.js +17 -7
- package/dist/{cjs/v3 → commonjs/v4/classic}/index.js +17 -7
- package/dist/{cjs → commonjs}/v4/classic/iso.js +17 -7
- package/dist/{cjs → commonjs}/v4/classic/parse.js +17 -7
- package/dist/{types → commonjs}/v4/classic/schemas.d.ts +6 -1
- package/dist/{cjs → commonjs}/v4/classic/schemas.js +28 -9
- package/dist/{types → commonjs}/v4/core/api.d.ts +3 -0
- package/dist/{cjs → commonjs}/v4/core/api.js +34 -11
- package/dist/{types → commonjs}/v4/core/checks.d.ts +2 -2
- package/dist/{cjs → commonjs}/v4/core/checks.js +37 -24
- package/dist/{cjs → commonjs}/v4/core/errors.js +17 -7
- package/dist/{cjs → commonjs}/v4/core/function.js +17 -7
- package/dist/{cjs → commonjs}/v4/core/index.js +17 -7
- package/dist/{cjs → commonjs}/v4/core/parse.js +17 -7
- package/dist/{types → commonjs}/v4/core/registries.d.ts +0 -5
- package/dist/{types → commonjs}/v4/core/schemas.d.ts +13 -3
- package/dist/{cjs → commonjs}/v4/core/schemas.js +33 -9
- package/dist/{cjs → commonjs}/v4/locales/ar.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/az.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/be.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/ca.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/cs.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/de.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/en.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/es.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/fa.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/fi.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/fr-CA.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/fr.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/he.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/hu.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/id.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/it.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/ja.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/kh.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/ko.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/mk.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/ms.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/nl.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/no.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/ota.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/pl.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/ps.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/pt.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/ru.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/sl.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/sv.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/ta.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/th.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/tr.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/ua.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/ur.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/vi.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/zh-CN.js +17 -7
- package/dist/{cjs → commonjs}/v4/locales/zh-TW.js +17 -7
- package/dist/{cjs → commonjs}/v4/mini/coerce.js +17 -7
- package/dist/{cjs → commonjs}/v4/mini/external.js +17 -7
- package/dist/{cjs → commonjs}/v4/mini/index.js +17 -7
- package/dist/{cjs → commonjs}/v4/mini/iso.js +17 -7
- package/dist/{types → commonjs}/v4/mini/schemas.d.ts +6 -1
- package/dist/{cjs → commonjs}/v4/mini/schemas.js +27 -9
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/package.json +1 -1
- package/dist/esm/v3/ZodError.d.ts +164 -0
- package/dist/esm/v3/benchmarks/datetime.d.ts +5 -0
- package/dist/esm/v3/benchmarks/discriminatedUnion.d.ts +5 -0
- package/dist/esm/v3/benchmarks/index.d.ts +1 -0
- package/dist/esm/v3/benchmarks/ipv4.d.ts +5 -0
- package/dist/esm/v3/benchmarks/object.d.ts +5 -0
- package/dist/esm/v3/benchmarks/primitives.d.ts +5 -0
- package/dist/esm/v3/benchmarks/realworld.d.ts +5 -0
- package/dist/esm/v3/benchmarks/string.d.ts +5 -0
- package/dist/esm/v3/benchmarks/union.d.ts +5 -0
- package/dist/esm/v3/errors.d.ts +5 -0
- package/dist/esm/v3/external.d.ts +6 -0
- package/dist/esm/v3/helpers/enumUtil.d.ts +8 -0
- package/dist/esm/v3/helpers/errorUtil.d.ts +9 -0
- package/dist/esm/v3/helpers/parseUtil.d.ts +78 -0
- package/dist/esm/v3/helpers/partialUtil.d.ts +8 -0
- package/dist/esm/v3/helpers/typeAliases.d.ts +2 -0
- package/dist/esm/v3/helpers/util.d.ts +85 -0
- package/dist/esm/v3/index.d.ts +4 -0
- package/dist/esm/v3/locales/en.d.ts +3 -0
- package/dist/esm/v3/locales/en.js +2 -0
- package/dist/esm/v3/standard-schema.d.ts +102 -0
- package/dist/esm/v3/tests/Mocker.d.ts +17 -0
- package/dist/esm/v3/tests/language-server.source.d.ts +70 -0
- package/dist/esm/v3/tests/language-server.source.js +45 -0
- package/dist/esm/v3/types.d.ts +1031 -0
- package/dist/esm/v4/classic/checks.d.ts +1 -0
- package/dist/esm/v4/classic/coerce.d.ts +17 -0
- package/dist/esm/v4/classic/compat.d.ts +48 -0
- package/dist/esm/v4/classic/errors.d.ts +30 -0
- package/dist/esm/v4/classic/external.d.ts +13 -0
- package/dist/esm/v4/classic/index.d.ts +4 -0
- package/dist/esm/v4/classic/iso.d.ts +22 -0
- package/dist/esm/v4/classic/parse.d.ts +23 -0
- package/dist/esm/v4/classic/schemas.d.ts +629 -0
- package/dist/esm/v4/classic/schemas.js +8 -0
- package/dist/esm/v4/core/api.d.ts +284 -0
- package/dist/esm/v4/core/api.js +16 -0
- package/dist/esm/v4/core/checks.d.ts +277 -0
- package/dist/esm/v4/core/checks.js +20 -17
- package/dist/esm/v4/core/config.d.ts +9 -0
- package/dist/esm/v4/core/core.d.ts +47 -0
- package/dist/esm/v4/core/doc.d.ts +14 -0
- package/dist/esm/v4/core/errors.d.ts +204 -0
- package/dist/esm/v4/core/function.d.ts +52 -0
- package/dist/esm/v4/core/index.d.ts +15 -0
- package/dist/esm/v4/core/json-schema.d.ts +87 -0
- package/dist/esm/v4/core/parse.d.ts +25 -0
- package/dist/esm/v4/core/regexes.d.ts +62 -0
- package/dist/esm/v4/core/registries.d.ts +34 -0
- package/dist/esm/v4/core/schemas.d.ts +1015 -0
- package/dist/esm/v4/core/schemas.js +14 -0
- package/dist/esm/v4/core/standard-schema.d.ts +55 -0
- package/dist/esm/v4/core/to-json-schema.d.ts +84 -0
- package/dist/esm/v4/core/util.d.ts +183 -0
- package/dist/esm/v4/core/versions.d.ts +5 -0
- package/dist/esm/v4/core/zsf.d.ts +91 -0
- package/dist/esm/v4/index.d.ts +3 -0
- package/dist/esm/v4/locales/ar.d.ts +4 -0
- package/dist/esm/v4/locales/az.d.ts +4 -0
- package/dist/esm/v4/locales/be.d.ts +4 -0
- package/dist/esm/v4/locales/ca.d.ts +4 -0
- package/dist/esm/v4/locales/cs.d.ts +4 -0
- package/dist/esm/v4/locales/de.d.ts +4 -0
- package/dist/esm/v4/locales/en.d.ts +5 -0
- package/dist/esm/v4/locales/es.d.ts +4 -0
- package/dist/esm/v4/locales/fa.d.ts +4 -0
- package/dist/esm/v4/locales/fi.d.ts +4 -0
- package/dist/esm/v4/locales/fr-CA.d.ts +4 -0
- package/dist/esm/v4/locales/fr.d.ts +4 -0
- package/dist/esm/v4/locales/he.d.ts +4 -0
- package/dist/esm/v4/locales/hu.d.ts +4 -0
- package/dist/esm/v4/locales/id.d.ts +4 -0
- package/dist/esm/v4/locales/index.d.ts +38 -0
- package/dist/esm/v4/locales/it.d.ts +4 -0
- package/dist/esm/v4/locales/ja.d.ts +4 -0
- package/dist/esm/v4/locales/kh.d.ts +4 -0
- package/dist/esm/v4/locales/ko.d.ts +4 -0
- package/dist/esm/v4/locales/mk.d.ts +4 -0
- package/dist/esm/v4/locales/ms.d.ts +4 -0
- package/dist/esm/v4/locales/nl.d.ts +4 -0
- package/dist/esm/v4/locales/no.d.ts +4 -0
- package/dist/esm/v4/locales/ota.d.ts +4 -0
- package/dist/esm/v4/locales/pl.d.ts +4 -0
- package/dist/esm/v4/locales/ps.d.ts +4 -0
- package/dist/esm/v4/locales/pt.d.ts +4 -0
- package/dist/esm/v4/locales/ru.d.ts +4 -0
- package/dist/esm/v4/locales/sl.d.ts +4 -0
- package/dist/esm/v4/locales/sv.d.ts +4 -0
- package/dist/esm/v4/locales/ta.d.ts +4 -0
- package/dist/esm/v4/locales/th.d.ts +4 -0
- package/dist/esm/v4/locales/tr.d.ts +5 -0
- package/dist/esm/v4/locales/ua.d.ts +4 -0
- package/dist/esm/v4/locales/ur.d.ts +4 -0
- package/dist/esm/v4/locales/vi.d.ts +4 -0
- package/dist/esm/v4/locales/zh-CN.d.ts +4 -0
- package/dist/esm/v4/locales/zh-TW.d.ts +4 -0
- package/dist/esm/v4/mini/checks.d.ts +1 -0
- package/dist/esm/v4/mini/coerce.d.ts +7 -0
- package/dist/esm/v4/mini/external.d.ts +11 -0
- package/dist/esm/v4/mini/index.d.ts +3 -0
- package/dist/esm/v4/mini/iso.d.ts +22 -0
- package/dist/esm/v4/mini/parse.d.ts +1 -0
- package/dist/esm/v4/mini/schemas.d.ts +356 -0
- package/dist/esm/v4/mini/schemas.js +7 -0
- package/package.json +58 -40
- package/dist/cjs/package.json +0 -3
- /package/dist/{types → commonjs}/index.d.ts +0 -0
- /package/dist/{cjs → commonjs}/index.js +0 -0
- /package/dist/{types → commonjs}/v3/ZodError.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/ZodError.js +0 -0
- /package/dist/{types → commonjs}/v3/benchmarks/datetime.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/benchmarks/datetime.js +0 -0
- /package/dist/{types → commonjs}/v3/benchmarks/discriminatedUnion.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/benchmarks/discriminatedUnion.js +0 -0
- /package/dist/{types → commonjs}/v3/benchmarks/index.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/benchmarks/index.js +0 -0
- /package/dist/{types → commonjs}/v3/benchmarks/ipv4.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/benchmarks/ipv4.js +0 -0
- /package/dist/{types → commonjs}/v3/benchmarks/object.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/benchmarks/object.js +0 -0
- /package/dist/{types → commonjs}/v3/benchmarks/primitives.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/benchmarks/primitives.js +0 -0
- /package/dist/{types → commonjs}/v3/benchmarks/realworld.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/benchmarks/realworld.js +0 -0
- /package/dist/{types → commonjs}/v3/benchmarks/string.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/benchmarks/string.js +0 -0
- /package/dist/{types → commonjs}/v3/benchmarks/union.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/benchmarks/union.js +0 -0
- /package/dist/{types → commonjs}/v3/errors.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/errors.js +0 -0
- /package/dist/{types → commonjs}/v3/external.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/external.js +0 -0
- /package/dist/{types → commonjs}/v3/helpers/enumUtil.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/helpers/enumUtil.js +0 -0
- /package/dist/{types → commonjs}/v3/helpers/errorUtil.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/helpers/errorUtil.js +0 -0
- /package/dist/{types → commonjs}/v3/helpers/parseUtil.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/helpers/parseUtil.js +0 -0
- /package/dist/{types → commonjs}/v3/helpers/partialUtil.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/helpers/partialUtil.js +0 -0
- /package/dist/{types → commonjs}/v3/helpers/typeAliases.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/helpers/typeAliases.js +0 -0
- /package/dist/{types → commonjs}/v3/helpers/util.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/helpers/util.js +0 -0
- /package/dist/{types → commonjs}/v3/index.d.ts +0 -0
- /package/dist/{types → commonjs}/v3/locales/en.d.ts +0 -0
- /package/dist/{types → commonjs}/v3/standard-schema.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/standard-schema.js +0 -0
- /package/dist/{types → commonjs}/v3/tests/Mocker.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/tests/Mocker.js +0 -0
- /package/dist/{types → commonjs}/v3/types.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v3/types.js +0 -0
- /package/dist/{types → commonjs}/v4/classic/checks.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/classic/checks.js +0 -0
- /package/dist/{types → commonjs}/v4/classic/coerce.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/classic/compat.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/classic/errors.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/classic/external.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/classic/index.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/classic/iso.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/classic/parse.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/core/config.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/core/config.js +0 -0
- /package/dist/{types → commonjs}/v4/core/core.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/core/core.js +0 -0
- /package/dist/{types → commonjs}/v4/core/doc.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/core/doc.js +0 -0
- /package/dist/{types → commonjs}/v4/core/errors.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/core/function.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/core/index.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/core/json-schema.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/core/json-schema.js +0 -0
- /package/dist/{types → commonjs}/v4/core/parse.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/core/regexes.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/core/regexes.js +0 -0
- /package/dist/{cjs → commonjs}/v4/core/registries.js +0 -0
- /package/dist/{types → commonjs}/v4/core/standard-schema.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/core/standard-schema.js +0 -0
- /package/dist/{types → commonjs}/v4/core/to-json-schema.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/core/to-json-schema.js +0 -0
- /package/dist/{types → commonjs}/v4/core/util.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/core/util.js +0 -0
- /package/dist/{types → commonjs}/v4/core/versions.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/core/versions.js +0 -0
- /package/dist/{types → commonjs}/v4/core/zsf.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/core/zsf.js +0 -0
- /package/dist/{types → commonjs}/v4/index.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/index.js +0 -0
- /package/dist/{types → commonjs}/v4/locales/ar.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/az.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/be.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/ca.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/cs.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/de.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/en.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/es.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/fa.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/fi.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/fr-CA.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/fr.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/he.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/hu.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/id.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/index.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/locales/index.js +0 -0
- /package/dist/{types → commonjs}/v4/locales/it.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/ja.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/kh.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/ko.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/mk.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/ms.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/nl.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/no.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/ota.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/pl.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/ps.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/pt.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/ru.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/sl.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/sv.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/ta.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/th.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/tr.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/ua.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/ur.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/vi.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/zh-CN.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/locales/zh-TW.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/mini/checks.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/mini/checks.js +0 -0
- /package/dist/{types → commonjs}/v4/mini/coerce.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/mini/external.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/mini/index.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/mini/iso.d.ts +0 -0
- /package/dist/{types → commonjs}/v4/mini/parse.d.ts +0 -0
- /package/dist/{cjs → commonjs}/v4/mini/parse.js +0 -0
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
Zod is a TypeScript-first validation library. Define a schema and parse some data with it. You'll get back a strongly typed, validated result.
|
|
59
59
|
|
|
60
60
|
```ts
|
|
61
|
-
import
|
|
61
|
+
import * as z from "zod/v4";
|
|
62
62
|
|
|
63
63
|
const User = z.object({
|
|
64
64
|
name: z.string(),
|
|
@@ -104,7 +104,7 @@ npm install zod
|
|
|
104
104
|
Before you can do anything else, you need to define a schema. For the purposes of this guide, we'll use a simple object schema.
|
|
105
105
|
|
|
106
106
|
```ts
|
|
107
|
-
import
|
|
107
|
+
import * as z from "zod/v4";
|
|
108
108
|
|
|
109
109
|
const Player = z.object({
|
|
110
110
|
username: z.string(),
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
|
@@ -69,6 +69,8 @@ const errorMap = (issue, _ctx) => {
|
|
|
69
69
|
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
70
70
|
else if (issue.type === "number")
|
|
71
71
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
72
|
+
else if (issue.type === "bigint")
|
|
73
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
72
74
|
else if (issue.type === "date")
|
|
73
75
|
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
74
76
|
else
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as z from "zod/v3";
|
|
2
|
+
export declare const filePath: string;
|
|
3
|
+
export declare const Test: z.ZodObject<{
|
|
4
|
+
f1: z.ZodNumber;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
f1: number;
|
|
7
|
+
}, {
|
|
8
|
+
f1: number;
|
|
9
|
+
}>;
|
|
10
|
+
export type Test = z.infer<typeof Test>;
|
|
11
|
+
export declare const instanceOfTest: Test;
|
|
12
|
+
export declare const TestMerge: z.ZodObject<{
|
|
13
|
+
f2: z.ZodOptional<z.ZodString>;
|
|
14
|
+
} & {
|
|
15
|
+
f1: z.ZodNumber;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
f1: number;
|
|
18
|
+
f2?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
f1: number;
|
|
21
|
+
f2?: string | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export type TestMerge = z.infer<typeof TestMerge>;
|
|
24
|
+
export declare const instanceOfTestMerge: TestMerge;
|
|
25
|
+
export declare const TestUnion: z.ZodUnion<[z.ZodObject<{
|
|
26
|
+
f2: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
f2?: string | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
f2?: string | undefined;
|
|
31
|
+
}>, z.ZodObject<{
|
|
32
|
+
f1: z.ZodNumber;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
f1: number;
|
|
35
|
+
}, {
|
|
36
|
+
f1: number;
|
|
37
|
+
}>]>;
|
|
38
|
+
export type TestUnion = z.infer<typeof TestUnion>;
|
|
39
|
+
export declare const instanceOfTestUnion: TestUnion;
|
|
40
|
+
export declare const TestPartial: z.ZodObject<{
|
|
41
|
+
f1: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
f1?: number | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
f1?: number | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
export type TestPartial = z.infer<typeof TestPartial>;
|
|
48
|
+
export declare const instanceOfTestPartial: TestPartial;
|
|
49
|
+
export declare const TestPick: z.ZodObject<Pick<{
|
|
50
|
+
f2: z.ZodOptional<z.ZodString>;
|
|
51
|
+
} & {
|
|
52
|
+
f1: z.ZodNumber;
|
|
53
|
+
}, "f1">, "strip", z.ZodTypeAny, {
|
|
54
|
+
f1: number;
|
|
55
|
+
}, {
|
|
56
|
+
f1: number;
|
|
57
|
+
}>;
|
|
58
|
+
export type TestPick = z.infer<typeof TestPick>;
|
|
59
|
+
export declare const instanceOfTestPick: TestPick;
|
|
60
|
+
export declare const TestOmit: z.ZodObject<Omit<{
|
|
61
|
+
f2: z.ZodOptional<z.ZodString>;
|
|
62
|
+
} & {
|
|
63
|
+
f1: z.ZodNumber;
|
|
64
|
+
}, "f2">, "strip", z.ZodTypeAny, {
|
|
65
|
+
f1: number;
|
|
66
|
+
}, {
|
|
67
|
+
f1: number;
|
|
68
|
+
}>;
|
|
69
|
+
export type TestOmit = z.infer<typeof TestOmit>;
|
|
70
|
+
export declare const instanceOfTestOmit: TestOmit;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.instanceOfTestOmit = exports.TestOmit = exports.instanceOfTestPick = exports.TestPick = exports.instanceOfTestPartial = exports.TestPartial = exports.instanceOfTestUnion = exports.TestUnion = exports.instanceOfTestMerge = exports.TestMerge = exports.instanceOfTest = exports.Test = exports.filePath = void 0;
|
|
37
|
+
const z = __importStar(require("zod/v3"));
|
|
38
|
+
exports.filePath = __filename;
|
|
39
|
+
// z.object()
|
|
40
|
+
exports.Test = z.object({
|
|
41
|
+
f1: z.number(),
|
|
42
|
+
});
|
|
43
|
+
exports.instanceOfTest = {
|
|
44
|
+
f1: 1,
|
|
45
|
+
};
|
|
46
|
+
// z.object().merge()
|
|
47
|
+
exports.TestMerge = z
|
|
48
|
+
.object({
|
|
49
|
+
f2: z.string().optional(),
|
|
50
|
+
})
|
|
51
|
+
.merge(exports.Test);
|
|
52
|
+
exports.instanceOfTestMerge = {
|
|
53
|
+
f1: 1,
|
|
54
|
+
f2: "string",
|
|
55
|
+
};
|
|
56
|
+
// z.union()
|
|
57
|
+
exports.TestUnion = z.union([
|
|
58
|
+
z.object({
|
|
59
|
+
f2: z.string().optional(),
|
|
60
|
+
}),
|
|
61
|
+
exports.Test,
|
|
62
|
+
]);
|
|
63
|
+
exports.instanceOfTestUnion = {
|
|
64
|
+
f1: 1,
|
|
65
|
+
f2: "string",
|
|
66
|
+
};
|
|
67
|
+
// z.object().partial()
|
|
68
|
+
exports.TestPartial = exports.Test.partial();
|
|
69
|
+
exports.instanceOfTestPartial = {
|
|
70
|
+
f1: 1,
|
|
71
|
+
};
|
|
72
|
+
// z.object().pick()
|
|
73
|
+
exports.TestPick = exports.TestMerge.pick({ f1: true });
|
|
74
|
+
exports.instanceOfTestPick = {
|
|
75
|
+
f1: 1,
|
|
76
|
+
};
|
|
77
|
+
// z.object().omit()
|
|
78
|
+
exports.TestOmit = exports.TestMerge.omit({ f2: true });
|
|
79
|
+
exports.instanceOfTestOmit = {
|
|
80
|
+
f1: 1,
|
|
81
|
+
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.string = string;
|
|
27
37
|
exports.number = number;
|
|
@@ -16,13 +16,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
16
16
|
}) : function(o, v) {
|
|
17
17
|
o["default"] = v;
|
|
18
18
|
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
26
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
37
|
exports.config = exports.$brand = exports.NEVER = exports.ZodIssueCode = void 0;
|
|
28
38
|
exports.setErrorMap = setErrorMap;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.ZodRealError = exports.ZodError = void 0;
|
|
27
37
|
const core = __importStar(require("zod/v4/core"));
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.ZodISODuration = exports.ZodISOTime = exports.ZodISODate = exports.ZodISODateTime = void 0;
|
|
27
37
|
exports.datetime = datetime;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.safeParseAsync = exports.safeParse = exports.parseAsync = exports.parse = void 0;
|
|
27
37
|
const core = __importStar(require("zod/v4/core"));
|
|
@@ -151,7 +151,7 @@ export interface ZodString extends _ZodString<core.$ZodStringInternals<string>>
|
|
|
151
151
|
}
|
|
152
152
|
export declare const ZodString: core.$constructor<ZodString>;
|
|
153
153
|
export declare function string(params?: string | core.$ZodStringParams): ZodString;
|
|
154
|
-
export interface ZodStringFormat<Format extends
|
|
154
|
+
export interface ZodStringFormat<Format extends string = string> extends _ZodString<core.$ZodStringFormatInternals<Format>> {
|
|
155
155
|
}
|
|
156
156
|
export declare const ZodStringFormat: core.$constructor<ZodStringFormat>;
|
|
157
157
|
export interface ZodEmail extends ZodStringFormat<"email"> {
|
|
@@ -252,6 +252,11 @@ export interface ZodJWT extends ZodStringFormat<"jwt"> {
|
|
|
252
252
|
}
|
|
253
253
|
export declare const ZodJWT: core.$constructor<ZodJWT>;
|
|
254
254
|
export declare function jwt(params?: string | core.$ZodJWTParams): ZodJWT;
|
|
255
|
+
export interface ZodCustomStringFormat<Format extends string = string> extends ZodStringFormat<Format>, core.$ZodCustomStringFormat<Format> {
|
|
256
|
+
_zod: core.$ZodCustomStringFormatInternals<Format>;
|
|
257
|
+
}
|
|
258
|
+
export declare const ZodCustomStringFormat: core.$constructor<ZodCustomStringFormat>;
|
|
259
|
+
export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<Format>;
|
|
255
260
|
export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals> extends _ZodType<Internals> {
|
|
256
261
|
gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
|
|
257
262
|
/** Identical to .min() */
|
|
@@ -15,16 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
27
|
-
exports.stringbool = exports.ZodCustom = exports.ZodPromise = exports.ZodLazy = exports.ZodTemplateLiteral = exports.ZodReadonly = exports.ZodPipe = exports.ZodNaN = exports.ZodCatch = exports.ZodSuccess = exports.ZodNonOptional = exports.ZodPrefault = exports.ZodDefault = exports.ZodNullable = void 0;
|
|
36
|
+
exports.ZodTransform = exports.ZodFile = exports.ZodLiteral = exports.ZodEnum = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodDate = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodBigIntFormat = exports.ZodBigInt = exports.ZodBoolean = exports.ZodNumberFormat = exports.ZodNumber = exports.ZodCustomStringFormat = exports.ZodJWT = exports.ZodE164 = exports.ZodBase64URL = exports.ZodBase64 = exports.ZodCIDRv6 = exports.ZodCIDRv4 = exports.ZodIPv6 = exports.ZodIPv4 = exports.ZodKSUID = exports.ZodXID = exports.ZodULID = exports.ZodCUID2 = exports.ZodCUID = exports.ZodNanoID = exports.ZodEmoji = exports.ZodURL = exports.ZodUUID = exports.ZodGUID = exports.ZodEmail = exports.ZodStringFormat = exports.ZodString = exports._ZodString = exports.ZodType = void 0;
|
|
37
|
+
exports.stringbool = exports.ZodCustom = exports.ZodPromise = exports.ZodLazy = exports.ZodTemplateLiteral = exports.ZodReadonly = exports.ZodPipe = exports.ZodNaN = exports.ZodCatch = exports.ZodSuccess = exports.ZodNonOptional = exports.ZodPrefault = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = void 0;
|
|
28
38
|
exports.string = string;
|
|
29
39
|
exports.email = email;
|
|
30
40
|
exports.guid = guid;
|
|
@@ -48,6 +58,7 @@ exports.base64 = base64;
|
|
|
48
58
|
exports.base64url = base64url;
|
|
49
59
|
exports.e164 = e164;
|
|
50
60
|
exports.jwt = jwt;
|
|
61
|
+
exports.stringFormat = stringFormat;
|
|
51
62
|
exports.number = number;
|
|
52
63
|
exports.int = int;
|
|
53
64
|
exports.float32 = float32;
|
|
@@ -407,6 +418,14 @@ exports.ZodJWT = core.$constructor("ZodJWT", (inst, def) => {
|
|
|
407
418
|
function jwt(params) {
|
|
408
419
|
return core._jwt(exports.ZodJWT, params);
|
|
409
420
|
}
|
|
421
|
+
exports.ZodCustomStringFormat = core.$constructor("ZodCustomStringFormat", (inst, def) => {
|
|
422
|
+
// ZodStringFormat.init(inst, def);
|
|
423
|
+
core.$ZodCustomStringFormat.init(inst, def);
|
|
424
|
+
exports.ZodStringFormat.init(inst, def);
|
|
425
|
+
});
|
|
426
|
+
function stringFormat(format, fnOrRegex, _params = {}) {
|
|
427
|
+
return core._stringFormat(exports.ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
428
|
+
}
|
|
410
429
|
exports.ZodNumber = core.$constructor("ZodNumber", (inst, def) => {
|
|
411
430
|
core.$ZodNumber.init(inst, def);
|
|
412
431
|
exports.ZodType.init(inst, def);
|
|
@@ -19,6 +19,8 @@ export type CheckTypeParams<T extends schemas.$ZodType & checks.$ZodCheck = sche
|
|
|
19
19
|
export type $ZodStringParams = TypeParams<schemas.$ZodString<string>, "coerce">;
|
|
20
20
|
export declare function _string<T extends schemas.$ZodString>(Class: util.SchemaClass<T>, params?: string | $ZodStringParams): T;
|
|
21
21
|
export declare function _coercedString<T extends schemas.$ZodString>(Class: util.SchemaClass<T>, params?: string | $ZodStringParams): T;
|
|
22
|
+
export type $ZodStringFormatParams = CheckTypeParams<schemas.$ZodStringFormat, "format" | "coerce">;
|
|
23
|
+
export type $ZodCheckStringFormatParams = CheckParams<checks.$ZodCheckStringFormat, "format">;
|
|
22
24
|
export type $ZodEmailParams = StringFormatParams<schemas.$ZodEmail>;
|
|
23
25
|
export type $ZodCheckEmailParams = CheckStringFormatParams<schemas.$ZodEmail>;
|
|
24
26
|
export declare function _email<T extends schemas.$ZodEmail>(Class: util.SchemaClass<T>, params?: string | $ZodEmailParams | $ZodCheckEmailParams): T;
|
|
@@ -279,3 +281,4 @@ export declare function _stringbool(Classes: {
|
|
|
279
281
|
Transform?: typeof schemas.$ZodTransform;
|
|
280
282
|
String?: typeof schemas.$ZodString;
|
|
281
283
|
}, _params?: string | $ZodStringBoolParams): schemas.$ZodPipe<schemas.$ZodPipe<schemas.$ZodString, schemas.$ZodTransform<boolean, string>>, schemas.$ZodBoolean<boolean>>;
|
|
284
|
+
export declare function _stringFormat<Format extends string>(Class: typeof schemas.$ZodCustomStringFormat, format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | $ZodStringFormatParams): schemas.$ZodCustomStringFormat<Format>;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.TimePrecision = void 0;
|
|
27
37
|
exports._string = _string;
|
|
@@ -78,13 +88,9 @@ exports._nan = _nan;
|
|
|
78
88
|
exports._lt = _lt;
|
|
79
89
|
exports._lte = _lte;
|
|
80
90
|
exports._max = _lte;
|
|
81
|
-
exports._lte = _lte;
|
|
82
|
-
exports._max = _lte;
|
|
83
91
|
exports._gt = _gt;
|
|
84
92
|
exports._gte = _gte;
|
|
85
93
|
exports._min = _gte;
|
|
86
|
-
exports._gte = _gte;
|
|
87
|
-
exports._min = _gte;
|
|
88
94
|
exports._positive = _positive;
|
|
89
95
|
exports._negative = _negative;
|
|
90
96
|
exports._nonpositive = _nonpositive;
|
|
@@ -136,6 +142,7 @@ exports._promise = _promise;
|
|
|
136
142
|
exports._custom = _custom;
|
|
137
143
|
exports._refine = _refine;
|
|
138
144
|
exports._stringbool = _stringbool;
|
|
145
|
+
exports._stringFormat = _stringFormat;
|
|
139
146
|
const checks = __importStar(require("./checks.js"));
|
|
140
147
|
const schemas = __importStar(require("./schemas.js"));
|
|
141
148
|
const util = __importStar(require("./util.js"));
|
|
@@ -1019,3 +1026,19 @@ function _stringbool(Classes, _params) {
|
|
|
1019
1026
|
});
|
|
1020
1027
|
return outerPipe;
|
|
1021
1028
|
}
|
|
1029
|
+
function _stringFormat(Class, format, fnOrRegex, _params = {}) {
|
|
1030
|
+
const params = util.normalizeParams(_params);
|
|
1031
|
+
const def = {
|
|
1032
|
+
...util.normalizeParams(_params),
|
|
1033
|
+
check: "string_format",
|
|
1034
|
+
type: "string",
|
|
1035
|
+
format,
|
|
1036
|
+
fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
|
|
1037
|
+
...params,
|
|
1038
|
+
};
|
|
1039
|
+
if (fnOrRegex instanceof RegExp) {
|
|
1040
|
+
def.pattern = fnOrRegex;
|
|
1041
|
+
}
|
|
1042
|
+
const inst = new Class(def);
|
|
1043
|
+
return inst;
|
|
1044
|
+
}
|
|
@@ -157,7 +157,7 @@ export interface $ZodCheckLengthEquals<T extends util.HasLength = util.HasLength
|
|
|
157
157
|
}
|
|
158
158
|
export declare const $ZodCheckLengthEquals: core.$constructor<$ZodCheckLengthEquals>;
|
|
159
159
|
export type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
|
|
160
|
-
export interface $ZodCheckStringFormatDef<Format extends
|
|
160
|
+
export interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
|
|
161
161
|
check: "string_format";
|
|
162
162
|
format: Format;
|
|
163
163
|
pattern?: RegExp | undefined;
|
|
@@ -274,4 +274,4 @@ export interface $ZodCheckOverwrite<T = unknown> extends $ZodCheck<T> {
|
|
|
274
274
|
}
|
|
275
275
|
export declare const $ZodCheckOverwrite: core.$constructor<$ZodCheckOverwrite>;
|
|
276
276
|
export type $ZodChecks = $ZodCheckLessThan | $ZodCheckGreaterThan | $ZodCheckMultipleOf | $ZodCheckNumberFormat | $ZodCheckBigIntFormat | $ZodCheckMaxSize | $ZodCheckMinSize | $ZodCheckSizeEquals | $ZodCheckMaxLength | $ZodCheckMinLength | $ZodCheckLengthEquals | $ZodCheckStringFormat | $ZodCheckProperty | $ZodCheckMimeType | $ZodCheckOverwrite;
|
|
277
|
-
export type $ZodStringFormatChecks = $ZodCheckRegex | $ZodCheckLowerCase | $ZodCheckUpperCase | $ZodCheckIncludes | $ZodCheckStartsWith | $ZodCheckEndsWith | schemas.$
|
|
277
|
+
export type $ZodStringFormatChecks = $ZodCheckRegex | $ZodCheckLowerCase | $ZodCheckUpperCase | $ZodCheckIncludes | $ZodCheckStartsWith | $ZodCheckEndsWith | schemas.$ZodStringFormatTypes;
|