zod 3.25.13 → 3.25.15
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/dist/{commonjs/v3 → v3}/index.js +7 -17
- package/dist/v3/tests/all-errors.test.js +147 -0
- package/dist/v3/tests/anyunknown.test.js +47 -0
- package/dist/v3/tests/array.test.js +80 -0
- package/dist/v3/tests/async-parsing.test.d.ts +1 -0
- package/dist/v3/tests/async-parsing.test.js +381 -0
- package/dist/v3/tests/async-refinements.test.d.ts +1 -0
- package/dist/v3/tests/async-refinements.test.js +60 -0
- package/dist/v3/tests/base.test.d.ts +1 -0
- package/dist/v3/tests/base.test.js +47 -0
- package/dist/v3/tests/bigint.test.d.ts +1 -0
- package/dist/v3/tests/bigint.test.js +74 -0
- package/dist/v3/tests/branded.test.d.ts +1 -0
- package/dist/v3/tests/branded.test.js +58 -0
- package/dist/v3/tests/catch.test.d.ts +1 -0
- package/dist/v3/tests/catch.test.js +181 -0
- package/dist/v3/tests/coerce.test.d.ts +1 -0
- package/dist/v3/tests/coerce.test.js +152 -0
- package/dist/v3/tests/complex.test.d.ts +1 -0
- package/dist/v3/tests/complex.test.js +78 -0
- package/dist/v3/tests/custom.test.d.ts +1 -0
- package/dist/v3/tests/custom.test.js +51 -0
- package/dist/v3/tests/date.test.d.ts +1 -0
- package/dist/v3/tests/date.test.js +49 -0
- package/dist/v3/tests/deepmasking.test.d.ts +1 -0
- package/dist/v3/tests/deepmasking.test.js +187 -0
- package/dist/v3/tests/default.test.d.ts +1 -0
- package/dist/v3/tests/default.test.js +86 -0
- package/dist/v3/tests/description.test.d.ts +1 -0
- package/dist/v3/tests/description.test.js +51 -0
- package/dist/v3/tests/discriminated-unions.test.d.ts +1 -0
- package/dist/v3/tests/discriminated-unions.test.js +321 -0
- package/dist/v3/tests/enum.test.d.ts +1 -0
- package/dist/v3/tests/enum.test.js +91 -0
- package/dist/v3/tests/error.test.d.ts +1 -0
- package/dist/v3/tests/error.test.js +526 -0
- package/dist/v3/tests/firstparty.test.d.ts +1 -0
- package/dist/v3/tests/firstparty.test.js +109 -0
- package/dist/v3/tests/firstpartyschematypes.test.d.ts +1 -0
- package/dist/v3/tests/firstpartyschematypes.test.js +8 -0
- package/dist/v3/tests/function.test.d.ts +1 -0
- package/dist/v3/tests/function.test.js +236 -0
- package/dist/v3/tests/generics.test.d.ts +1 -0
- package/dist/v3/tests/generics.test.js +67 -0
- package/dist/v3/tests/instanceof.test.d.ts +1 -0
- package/dist/v3/tests/instanceof.test.js +60 -0
- package/dist/v3/tests/intersection.test.d.ts +1 -0
- package/dist/v3/tests/intersection.test.js +111 -0
- package/dist/{commonjs/v3 → v3}/tests/language-server.source.js +7 -17
- package/dist/v3/tests/language-server.test.d.ts +1 -0
- package/dist/v3/tests/language-server.test.js +177 -0
- package/dist/v3/tests/literal.test.d.ts +1 -0
- package/dist/v3/tests/literal.test.js +55 -0
- package/dist/v3/tests/map.test.d.ts +1 -0
- package/dist/v3/tests/map.test.js +112 -0
- package/dist/v3/tests/masking.test.d.ts +1 -0
- package/dist/v3/tests/masking.test.js +5 -0
- package/dist/v3/tests/mocker.test.d.ts +1 -0
- package/dist/v3/tests/mocker.test.js +19 -0
- package/dist/v3/tests/nan.test.d.ts +1 -0
- package/dist/v3/tests/nan.test.js +42 -0
- package/dist/v3/tests/nativeEnum.test.d.ts +1 -0
- package/dist/v3/tests/nativeEnum.test.js +100 -0
- package/dist/v3/tests/nullable.test.d.ts +1 -0
- package/dist/v3/tests/nullable.test.js +65 -0
- package/dist/v3/tests/number.test.d.ts +1 -0
- package/dist/v3/tests/number.test.js +189 -0
- package/dist/v3/tests/object-augmentation.test.d.ts +1 -0
- package/dist/v3/tests/object-augmentation.test.js +50 -0
- package/dist/v3/tests/object-in-es5-env.test.d.ts +1 -0
- package/dist/v3/tests/object-in-es5-env.test.js +49 -0
- package/dist/v3/tests/object.test.d.ts +1 -0
- package/dist/v3/tests/object.test.js +352 -0
- package/dist/v3/tests/optional.test.d.ts +1 -0
- package/dist/v3/tests/optional.test.js +65 -0
- package/dist/v3/tests/parseUtil.test.d.ts +1 -0
- package/dist/v3/tests/parseUtil.test.js +20 -0
- package/dist/v3/tests/parser.test.d.ts +1 -0
- package/dist/v3/tests/parser.test.js +55 -0
- package/dist/v3/tests/partials.test.d.ts +1 -0
- package/dist/v3/tests/partials.test.js +201 -0
- package/dist/v3/tests/pickomit.test.d.ts +1 -0
- package/dist/v3/tests/pickomit.test.js +113 -0
- package/dist/v3/tests/pipeline.test.d.ts +1 -0
- package/dist/v3/tests/pipeline.test.js +50 -0
- package/dist/v3/tests/preprocess.test.d.ts +1 -0
- package/dist/v3/tests/preprocess.test.js +181 -0
- package/dist/v3/tests/primitive.test.d.ts +1 -0
- package/dist/v3/tests/primitive.test.js +385 -0
- package/dist/v3/tests/promise.test.d.ts +1 -0
- package/dist/v3/tests/promise.test.js +98 -0
- package/dist/v3/tests/readonly.test.d.ts +1 -0
- package/dist/v3/tests/readonly.test.js +190 -0
- package/dist/v3/tests/record.test.d.ts +1 -0
- package/dist/v3/tests/record.test.js +153 -0
- package/dist/v3/tests/recursive.test.d.ts +1 -0
- package/dist/v3/tests/recursive.test.js +161 -0
- package/dist/v3/tests/refine.test.d.ts +1 -0
- package/dist/v3/tests/refine.test.js +279 -0
- package/dist/v3/tests/safeparse.test.d.ts +1 -0
- package/dist/v3/tests/safeparse.test.js +46 -0
- package/dist/v3/tests/set.test.d.ts +1 -0
- package/dist/v3/tests/set.test.js +144 -0
- package/dist/v3/tests/standard-schema.test.d.ts +1 -0
- package/dist/v3/tests/standard-schema.test.js +102 -0
- package/dist/v3/tests/string.test.d.ts +1 -0
- package/dist/v3/tests/string.test.js +842 -0
- package/dist/v3/tests/transformer.test.d.ts +1 -0
- package/dist/v3/tests/transformer.test.js +218 -0
- package/dist/v3/tests/tuple.test.d.ts +1 -0
- package/dist/v3/tests/tuple.test.js +97 -0
- package/dist/v3/tests/unions.test.d.ts +1 -0
- package/dist/v3/tests/unions.test.js +75 -0
- package/dist/v3/tests/validations.test.d.ts +1 -0
- package/dist/v3/tests/validations.test.js +155 -0
- package/dist/v3/tests/void.test.d.ts +1 -0
- package/dist/v3/tests/void.test.js +36 -0
- package/dist/{commonjs/v4 → v4}/classic/coerce.js +7 -17
- package/dist/{commonjs/v4 → v4}/classic/compat.js +7 -17
- package/dist/{commonjs/v4 → v4}/classic/errors.js +7 -17
- package/dist/{commonjs/v4 → v4}/classic/external.js +7 -17
- package/dist/{commonjs/v4 → v4}/classic/index.js +7 -17
- package/dist/{commonjs/v4 → v4}/classic/iso.js +7 -17
- package/dist/{commonjs/v4 → v4}/classic/parse.js +7 -17
- package/dist/{commonjs/v4 → v4}/classic/schemas.js +7 -17
- package/dist/v4/classic/tests/anyunknown.test.d.ts +1 -0
- package/dist/v4/classic/tests/anyunknown.test.js +45 -0
- package/dist/v4/classic/tests/array.test.d.ts +1 -0
- package/dist/v4/classic/tests/array.test.js +249 -0
- package/dist/v4/classic/tests/assignability.test.d.ts +1 -0
- package/dist/v4/classic/tests/assignability.test.js +110 -0
- package/dist/v4/classic/tests/async-parsing.test.d.ts +1 -0
- package/dist/v4/classic/tests/async-parsing.test.js +364 -0
- package/dist/v4/classic/tests/async-refinements.test.d.ts +1 -0
- package/dist/v4/classic/tests/async-refinements.test.js +82 -0
- package/dist/v4/classic/tests/base.test.d.ts +1 -0
- package/dist/v4/classic/tests/base.test.js +31 -0
- package/dist/v4/classic/tests/bigint.test.d.ts +1 -0
- package/dist/v4/classic/tests/bigint.test.js +73 -0
- package/dist/v4/classic/tests/brand.test.d.ts +1 -0
- package/dist/v4/classic/tests/brand.test.js +60 -0
- package/dist/v4/classic/tests/catch.test.d.ts +1 -0
- package/dist/v4/classic/tests/catch.test.js +214 -0
- package/dist/v4/classic/tests/coalesce.test.d.ts +1 -0
- package/dist/v4/classic/tests/coalesce.test.js +18 -0
- package/dist/v4/classic/tests/coerce.test.d.ts +1 -0
- package/dist/v4/classic/tests/coerce.test.js +175 -0
- package/dist/v4/classic/tests/custom.test.d.ts +1 -0
- package/dist/v4/classic/tests/custom.test.js +38 -0
- package/dist/v4/classic/tests/date.test.d.ts +1 -0
- package/dist/v4/classic/tests/date.test.js +48 -0
- package/dist/v4/classic/tests/default.test.d.ts +1 -0
- package/dist/v4/classic/tests/default.test.js +88 -0
- package/dist/v4/classic/tests/description.test.d.ts +1 -0
- package/dist/v4/classic/tests/description.test.js +51 -0
- package/dist/v4/classic/tests/discriminated-unions.test.d.ts +1 -0
- package/dist/v4/classic/tests/discriminated-unions.test.js +540 -0
- package/dist/v4/classic/tests/enum.test.d.ts +1 -0
- package/dist/v4/classic/tests/enum.test.js +260 -0
- package/dist/v4/classic/tests/error-utils.test.d.ts +1 -0
- package/dist/v4/classic/tests/error-utils.test.js +411 -0
- package/dist/v4/classic/tests/error.test.d.ts +1 -0
- package/dist/v4/classic/tests/error.test.js +651 -0
- package/dist/v4/classic/tests/file.test.d.ts +1 -0
- package/dist/v4/classic/tests/file.test.js +68 -0
- package/dist/v4/classic/tests/firstparty.test.d.ts +1 -0
- package/dist/v4/classic/tests/firstparty.test.js +198 -0
- package/dist/v4/classic/tests/function.test.d.ts +1 -0
- package/dist/v4/classic/tests/function.test.js +219 -0
- package/dist/v4/classic/tests/generics.test.d.ts +1 -0
- package/dist/v4/classic/tests/generics.test.js +72 -0
- package/dist/v4/classic/tests/index.test.d.ts +1 -0
- package/dist/v4/classic/tests/index.test.js +764 -0
- package/dist/v4/classic/tests/instanceof.test.d.ts +1 -0
- package/dist/v4/classic/tests/instanceof.test.js +58 -0
- package/dist/v4/classic/tests/intersection.test.d.ts +1 -0
- package/dist/v4/classic/tests/intersection.test.js +134 -0
- package/dist/v4/classic/tests/json-schema.test.d.ts +1 -0
- package/dist/v4/classic/tests/json-schema.test.js +1707 -0
- package/dist/v4/classic/tests/json.test.d.ts +1 -0
- package/dist/v4/classic/tests/json.test.js +105 -0
- package/dist/v4/classic/tests/lazy.test.d.ts +1 -0
- package/dist/v4/classic/tests/lazy.test.js +185 -0
- package/dist/v4/classic/tests/literal.test.d.ts +1 -0
- package/dist/v4/classic/tests/literal.test.js +94 -0
- package/dist/v4/classic/tests/map.test.d.ts +1 -0
- package/dist/v4/classic/tests/map.test.js +193 -0
- package/dist/v4/classic/tests/nan.test.d.ts +1 -0
- package/dist/v4/classic/tests/nan.test.js +42 -0
- package/dist/v4/classic/tests/nested-refine.test.d.ts +1 -0
- package/dist/v4/classic/tests/nested-refine.test.js +180 -0
- package/dist/v4/classic/tests/nonoptional.test.d.ts +1 -0
- package/dist/v4/classic/tests/nonoptional.test.js +80 -0
- package/dist/v4/classic/tests/nullable.test.d.ts +1 -0
- package/dist/v4/classic/tests/nullable.test.js +43 -0
- package/dist/v4/classic/tests/number.test.d.ts +1 -0
- package/dist/v4/classic/tests/number.test.js +241 -0
- package/dist/v4/classic/tests/object.test.d.ts +1 -0
- package/dist/v4/classic/tests/object.test.js +405 -0
- package/dist/v4/classic/tests/optional.test.d.ts +1 -0
- package/dist/v4/classic/tests/optional.test.js +98 -0
- package/dist/v4/classic/tests/partial.test.d.ts +1 -0
- package/dist/v4/classic/tests/partial.test.js +137 -0
- package/dist/v4/classic/tests/pickomit.test.d.ts +1 -0
- package/dist/v4/classic/tests/pickomit.test.js +125 -0
- package/dist/v4/classic/tests/pipe.test.d.ts +1 -0
- package/dist/v4/classic/tests/pipe.test.js +92 -0
- package/dist/v4/classic/tests/prefault.test.d.ts +1 -0
- package/dist/v4/classic/tests/prefault.test.js +22 -0
- package/dist/v4/classic/tests/preprocess.test.d.ts +1 -0
- package/dist/v4/classic/tests/preprocess.test.js +273 -0
- package/dist/v4/classic/tests/primitive.test.d.ts +1 -0
- package/dist/v4/classic/tests/primitive.test.js +184 -0
- package/dist/v4/classic/tests/promise.test.d.ts +1 -0
- package/dist/v4/classic/tests/promise.test.js +91 -0
- package/dist/v4/classic/tests/readonly.test.d.ts +1 -0
- package/dist/v4/classic/tests/readonly.test.js +241 -0
- package/dist/v4/classic/tests/record.test.d.ts +1 -0
- package/dist/v4/classic/tests/record.test.js +307 -0
- package/dist/v4/classic/tests/recursive-types.test.d.ts +1 -0
- package/dist/v4/classic/tests/recursive-types.test.js +108 -0
- package/dist/v4/classic/tests/refine.test.d.ts +1 -0
- package/dist/v4/classic/tests/refine.test.js +402 -0
- package/dist/v4/classic/tests/registries.test.d.ts +1 -0
- package/dist/v4/classic/tests/registries.test.js +155 -0
- package/dist/v4/classic/tests/set.test.d.ts +1 -0
- package/dist/v4/classic/tests/set.test.js +182 -0
- package/dist/v4/classic/tests/standard-schema.test.d.ts +1 -0
- package/dist/v4/classic/tests/standard-schema.test.js +77 -0
- package/dist/v4/classic/tests/string-formats.test.d.ts +1 -0
- package/dist/v4/classic/tests/string-formats.test.js +49 -0
- package/dist/v4/classic/tests/string.test.d.ts +1 -0
- package/dist/v4/classic/tests/string.test.js +980 -0
- package/dist/v4/classic/tests/template-literal.test.d.ts +1 -0
- package/dist/v4/classic/tests/template-literal.test.js +705 -0
- package/dist/v4/classic/tests/transform.test.d.ts +1 -0
- package/dist/v4/classic/tests/transform.test.js +239 -0
- package/dist/v4/classic/tests/tuple.test.d.ts +1 -0
- package/dist/v4/classic/tests/tuple.test.js +166 -0
- package/dist/v4/classic/tests/union.test.d.ts +1 -0
- package/dist/v4/classic/tests/union.test.js +107 -0
- package/dist/v4/classic/tests/validations.test.d.ts +1 -0
- package/dist/v4/classic/tests/validations.test.js +301 -0
- package/dist/v4/classic/tests/void.test.d.ts +1 -0
- package/dist/v4/classic/tests/void.test.js +34 -0
- package/dist/{commonjs/v4 → v4}/core/api.js +11 -17
- package/dist/{commonjs/v4 → v4}/core/checks.js +7 -17
- package/dist/{commonjs/v4 → v4}/core/errors.js +7 -17
- package/dist/{commonjs/v4 → v4}/core/function.js +7 -17
- package/dist/{commonjs/v4 → v4}/core/index.js +7 -17
- package/dist/v4/core/json-schema.mjs +1 -0
- package/dist/{commonjs/v4 → v4}/core/parse.js +7 -17
- package/dist/{commonjs/v4 → v4}/core/schemas.js +7 -17
- package/dist/v4/core/standard-schema.mjs +1 -0
- package/dist/v4/core/tests/index.test.d.ts +1 -0
- package/dist/v4/core/tests/index.test.js +66 -0
- package/dist/v4/core/tests/locales/be.test.d.ts +1 -0
- package/dist/v4/core/tests/locales/be.test.js +123 -0
- package/dist/v4/core/tests/locales/en.test.d.ts +1 -0
- package/dist/v4/core/tests/locales/en.test.js +21 -0
- package/dist/v4/core/tests/locales/ru.test.d.ts +1 -0
- package/dist/v4/core/tests/locales/ru.test.js +123 -0
- package/dist/v4/core/tests/locales/tr.test.d.ts +1 -0
- package/dist/v4/core/tests/locales/tr.test.js +79 -0
- package/dist/{commonjs/v4 → v4}/locales/ar.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/az.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/be.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/ca.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/cs.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/de.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/en.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/es.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/fa.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/fi.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/fr.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/frCA.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/he.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/hu.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/id.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/it.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/ja.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/ko.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/mk.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/ms.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/no.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/ota.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/pl.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/pt.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/ru.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/sl.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/ta.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/th.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/tr.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/ua.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/ur.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/vi.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/zh-CN.js +7 -17
- package/dist/{commonjs/v4 → v4}/locales/zh-tw.js +7 -17
- package/dist/{commonjs/v4 → v4}/mini/coerce.js +7 -17
- package/dist/{commonjs/v4 → v4}/mini/external.js +7 -17
- package/dist/{commonjs/v4 → v4}/mini/index.js +7 -17
- package/dist/{commonjs/v4 → v4}/mini/iso.js +7 -17
- package/dist/{commonjs/v4 → v4}/mini/schemas.js +7 -17
- package/dist/v4/mini/tests/assignability.test.d.ts +1 -0
- package/dist/v4/mini/tests/assignability.test.js +104 -0
- package/dist/v4/mini/tests/brand.test.d.ts +1 -0
- package/dist/v4/mini/tests/brand.test.js +58 -0
- package/dist/v4/mini/tests/checks.test.d.ts +1 -0
- package/dist/v4/mini/tests/checks.test.js +147 -0
- package/dist/v4/mini/tests/computed.test.d.ts +1 -0
- package/dist/v4/mini/tests/computed.test.js +55 -0
- package/dist/v4/mini/tests/error.test.d.ts +1 -0
- package/dist/v4/mini/tests/error.test.js +45 -0
- package/dist/v4/mini/tests/functions.test.d.ts +1 -0
- package/dist/v4/mini/tests/functions.test.js +37 -0
- package/dist/v4/mini/tests/index.test.d.ts +1 -0
- package/dist/v4/mini/tests/index.test.js +763 -0
- package/dist/v4/mini/tests/number.test.d.ts +1 -0
- package/dist/v4/mini/tests/number.test.js +109 -0
- package/dist/v4/mini/tests/object.test.d.ts +1 -0
- package/dist/v4/mini/tests/object.test.js +122 -0
- package/dist/v4/mini/tests/prototypes.test.d.ts +1 -0
- package/dist/v4/mini/tests/prototypes.test.js +44 -0
- package/dist/v4/mini/tests/recursive-types.test.d.ts +1 -0
- package/dist/v4/mini/tests/recursive-types.test.js +106 -0
- package/dist/v4/mini/tests/string.test.d.ts +1 -0
- package/dist/v4/mini/tests/string.test.js +265 -0
- package/package.json +35 -73
- package/src/v4/classic/tests/file.test.ts +1 -0
- package/dist/commonjs/package.json +0 -3
- package/dist/esm/index.js +0 -3
- package/dist/esm/package.json +0 -3
- package/dist/esm/v3/ZodError.d.ts +0 -164
- package/dist/esm/v3/benchmarks/datetime.d.ts +0 -5
- package/dist/esm/v3/benchmarks/discriminatedUnion.d.ts +0 -5
- package/dist/esm/v3/benchmarks/ipv4.d.ts +0 -5
- package/dist/esm/v3/benchmarks/object.d.ts +0 -5
- package/dist/esm/v3/benchmarks/primitives.d.ts +0 -5
- package/dist/esm/v3/benchmarks/realworld.d.ts +0 -5
- package/dist/esm/v3/benchmarks/string.d.ts +0 -5
- package/dist/esm/v3/benchmarks/union.d.ts +0 -5
- package/dist/esm/v3/errors.d.ts +0 -5
- package/dist/esm/v3/external.js +0 -6
- package/dist/esm/v3/helpers/enumUtil.d.ts +0 -8
- package/dist/esm/v3/helpers/errorUtil.d.ts +0 -9
- package/dist/esm/v3/helpers/parseUtil.d.ts +0 -78
- package/dist/esm/v3/helpers/partialUtil.d.ts +0 -8
- package/dist/esm/v3/helpers/typeAliases.d.ts +0 -2
- package/dist/esm/v3/helpers/util.d.ts +0 -85
- package/dist/esm/v3/index.js +0 -4
- package/dist/esm/v3/locales/en.d.ts +0 -3
- package/dist/esm/v3/standard-schema.d.ts +0 -102
- package/dist/esm/v3/tests/Mocker.d.ts +0 -17
- package/dist/esm/v3/tests/language-server.source.d.ts +0 -70
- package/dist/esm/v3/tests/language-server.source.js +0 -45
- package/dist/esm/v3/types.d.ts +0 -1031
- package/dist/esm/v4/classic/checks.js +0 -1
- package/dist/esm/v4/classic/coerce.d.ts +0 -17
- package/dist/esm/v4/classic/compat.d.ts +0 -48
- package/dist/esm/v4/classic/errors.d.ts +0 -30
- package/dist/esm/v4/classic/external.d.ts +0 -8
- package/dist/esm/v4/classic/index.js +0 -4
- package/dist/esm/v4/classic/iso.d.ts +0 -22
- package/dist/esm/v4/classic/parse.d.ts +0 -23
- package/dist/esm/v4/classic/schemas.d.ts +0 -653
- package/dist/esm/v4/core/api.d.ts +0 -273
- package/dist/esm/v4/core/checks.d.ts +0 -277
- package/dist/esm/v4/core/config.d.ts +0 -9
- package/dist/esm/v4/core/core.d.ts +0 -43
- package/dist/esm/v4/core/doc.d.ts +0 -14
- package/dist/esm/v4/core/errors.d.ts +0 -204
- package/dist/esm/v4/core/function.d.ts +0 -35
- package/dist/esm/v4/core/index.js +0 -15
- package/dist/esm/v4/core/json-schema.d.ts +0 -100
- package/dist/esm/v4/core/parse.d.ts +0 -25
- package/dist/esm/v4/core/regexes.d.ts +0 -62
- package/dist/esm/v4/core/registries.d.ts +0 -32
- package/dist/esm/v4/core/schemas.d.ts +0 -975
- package/dist/esm/v4/core/standard-schema.d.ts +0 -55
- package/dist/esm/v4/core/to-json-schema.d.ts +0 -84
- package/dist/esm/v4/core/util.d.ts +0 -186
- package/dist/esm/v4/core/versions.d.ts +0 -5
- package/dist/esm/v4/core/zsf.d.ts +0 -91
- package/dist/esm/v4/index.js +0 -3
- package/dist/esm/v4/locales/ar.d.ts +0 -7
- package/dist/esm/v4/locales/az.d.ts +0 -7
- package/dist/esm/v4/locales/be.d.ts +0 -7
- package/dist/esm/v4/locales/ca.d.ts +0 -7
- package/dist/esm/v4/locales/cs.d.ts +0 -7
- package/dist/esm/v4/locales/de.d.ts +0 -7
- package/dist/esm/v4/locales/en.d.ts +0 -7
- package/dist/esm/v4/locales/es.d.ts +0 -7
- package/dist/esm/v4/locales/fa.d.ts +0 -7
- package/dist/esm/v4/locales/fi.d.ts +0 -7
- package/dist/esm/v4/locales/fr.d.ts +0 -7
- package/dist/esm/v4/locales/frCA.d.ts +0 -7
- package/dist/esm/v4/locales/he.d.ts +0 -7
- package/dist/esm/v4/locales/hu.d.ts +0 -7
- package/dist/esm/v4/locales/id.d.ts +0 -7
- package/dist/esm/v4/locales/index.js +0 -34
- package/dist/esm/v4/locales/it.d.ts +0 -7
- package/dist/esm/v4/locales/ja.d.ts +0 -7
- package/dist/esm/v4/locales/ko.d.ts +0 -7
- package/dist/esm/v4/locales/mk.d.ts +0 -7
- package/dist/esm/v4/locales/ms.d.ts +0 -7
- package/dist/esm/v4/locales/no.d.ts +0 -7
- package/dist/esm/v4/locales/ota.d.ts +0 -7
- package/dist/esm/v4/locales/pl.d.ts +0 -7
- package/dist/esm/v4/locales/pt.d.ts +0 -7
- package/dist/esm/v4/locales/ru.d.ts +0 -7
- package/dist/esm/v4/locales/sl.d.ts +0 -7
- package/dist/esm/v4/locales/ta.d.ts +0 -7
- package/dist/esm/v4/locales/th.d.ts +0 -7
- package/dist/esm/v4/locales/tr.d.ts +0 -7
- package/dist/esm/v4/locales/ua.d.ts +0 -7
- package/dist/esm/v4/locales/ur.d.ts +0 -7
- package/dist/esm/v4/locales/vi.d.ts +0 -7
- package/dist/esm/v4/locales/zh-CN.d.ts +0 -7
- package/dist/esm/v4/locales/zh-tw.d.ts +0 -7
- package/dist/esm/v4/mini/checks.js +0 -1
- package/dist/esm/v4/mini/coerce.d.ts +0 -7
- package/dist/esm/v4/mini/external.d.ts +0 -7
- package/dist/esm/v4/mini/index.js +0 -3
- package/dist/esm/v4/mini/iso.d.ts +0 -22
- package/dist/esm/v4/mini/parse.js +0 -1
- package/dist/esm/v4/mini/schemas.d.ts +0 -405
- /package/dist/{commonjs/index.d.ts → index.d.ts} +0 -0
- /package/dist/{commonjs/index.js → index.js} +0 -0
- /package/dist/{esm/index.d.ts → index.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/ZodError.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/ZodError.js +0 -0
- /package/dist/{esm/v3/ZodError.js → v3/ZodError.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/datetime.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/datetime.js +0 -0
- /package/dist/{esm/v3/benchmarks/datetime.js → v3/benchmarks/datetime.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/discriminatedUnion.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/discriminatedUnion.js +0 -0
- /package/dist/{esm/v3/benchmarks/discriminatedUnion.js → v3/benchmarks/discriminatedUnion.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/index.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/index.js +0 -0
- /package/dist/{esm/v3/benchmarks/index.js → v3/benchmarks/index.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/ipv4.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/ipv4.js +0 -0
- /package/dist/{esm/v3/benchmarks/ipv4.js → v3/benchmarks/ipv4.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/object.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/object.js +0 -0
- /package/dist/{esm/v3/benchmarks/object.js → v3/benchmarks/object.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/primitives.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/primitives.js +0 -0
- /package/dist/{esm/v3/benchmarks/primitives.js → v3/benchmarks/primitives.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/realworld.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/realworld.js +0 -0
- /package/dist/{esm/v3/benchmarks/realworld.js → v3/benchmarks/realworld.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/string.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/string.js +0 -0
- /package/dist/{esm/v3/benchmarks/string.js → v3/benchmarks/string.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/union.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/benchmarks/union.js +0 -0
- /package/dist/{esm/v3/benchmarks/union.js → v3/benchmarks/union.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/errors.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/errors.js +0 -0
- /package/dist/{esm/v3/errors.js → v3/errors.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/external.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/external.js +0 -0
- /package/dist/{esm/v3/external.d.ts → v3/external.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/enumUtil.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/enumUtil.js +0 -0
- /package/dist/{esm/v3/benchmarks/index.d.ts → v3/helpers/enumUtil.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/errorUtil.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/errorUtil.js +0 -0
- /package/dist/{esm/v3/helpers/errorUtil.js → v3/helpers/errorUtil.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/parseUtil.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/parseUtil.js +0 -0
- /package/dist/{esm/v3/helpers/parseUtil.js → v3/helpers/parseUtil.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/partialUtil.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/partialUtil.js +0 -0
- /package/dist/{esm/v3/helpers/enumUtil.js → v3/helpers/partialUtil.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/typeAliases.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/typeAliases.js +0 -0
- /package/dist/{esm/v3/helpers/partialUtil.js → v3/helpers/typeAliases.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/util.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/helpers/util.js +0 -0
- /package/dist/{esm/v3/helpers/util.js → v3/helpers/util.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/index.d.ts +0 -0
- /package/dist/{esm/v3/index.d.ts → v3/index.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/locales/en.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/locales/en.js +0 -0
- /package/dist/{esm/v3/locales/en.js → v3/locales/en.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/standard-schema.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/standard-schema.js +0 -0
- /package/dist/{esm/v3/helpers/typeAliases.js → v3/standard-schema.mjs} +0 -0
- /package/dist/{commonjs/v3 → v3}/tests/Mocker.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/tests/Mocker.js +0 -0
- /package/dist/{esm/v3/tests/Mocker.js → v3/tests/Mocker.mjs} +0 -0
- /package/dist/{esm/v3/standard-schema.js → v3/tests/all-errors.test.d.ts} +0 -0
- /package/dist/{esm/v4/core/json-schema.js → v3/tests/anyunknown.test.d.ts} +0 -0
- /package/dist/{esm/v4/core/standard-schema.js → v3/tests/array.test.d.ts} +0 -0
- /package/dist/{commonjs/v3 → v3}/tests/language-server.source.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/types.d.ts +0 -0
- /package/dist/{commonjs/v3 → v3}/types.js +0 -0
- /package/dist/{esm/v3/types.js → v3/types.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/classic/checks.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/classic/checks.js +0 -0
- /package/dist/{esm/v4/classic/checks.d.ts → v4/classic/checks.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/classic/coerce.d.ts +0 -0
- /package/dist/{esm/v4/classic/coerce.js → v4/classic/coerce.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/classic/compat.d.ts +0 -0
- /package/dist/{esm/v4/classic/compat.js → v4/classic/compat.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/classic/errors.d.ts +0 -0
- /package/dist/{esm/v4/classic/errors.js → v4/classic/errors.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/classic/external.d.ts +0 -0
- /package/dist/{esm/v4/classic/external.js → v4/classic/external.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/classic/index.d.ts +0 -0
- /package/dist/{esm/v4/classic/index.d.ts → v4/classic/index.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/classic/iso.d.ts +0 -0
- /package/dist/{esm/v4/classic/iso.js → v4/classic/iso.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/classic/parse.d.ts +0 -0
- /package/dist/{esm/v4/classic/parse.js → v4/classic/parse.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/classic/schemas.d.ts +0 -0
- /package/dist/{esm/v4/classic/schemas.js → v4/classic/schemas.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/api.d.ts +0 -0
- /package/dist/{esm/v4/core/api.js → v4/core/api.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/checks.d.ts +0 -0
- /package/dist/{esm/v4/core/checks.js → v4/core/checks.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/config.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/config.js +0 -0
- /package/dist/{esm/v4/core/config.js → v4/core/config.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/core.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/core.js +0 -0
- /package/dist/{esm/v4/core/core.js → v4/core/core.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/doc.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/doc.js +0 -0
- /package/dist/{esm/v4/core/doc.js → v4/core/doc.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/errors.d.ts +0 -0
- /package/dist/{esm/v4/core/errors.js → v4/core/errors.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/function.d.ts +0 -0
- /package/dist/{esm/v4/core/function.js → v4/core/function.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/index.d.ts +0 -0
- /package/dist/{esm/v4/core/index.d.ts → v4/core/index.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/json-schema.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/json-schema.js +0 -0
- /package/dist/{commonjs/v4 → v4}/core/parse.d.ts +0 -0
- /package/dist/{esm/v4/core/parse.js → v4/core/parse.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/regexes.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/regexes.js +0 -0
- /package/dist/{esm/v4/core/regexes.js → v4/core/regexes.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/registries.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/registries.js +0 -0
- /package/dist/{esm/v4/core/registries.js → v4/core/registries.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/schemas.d.ts +0 -0
- /package/dist/{esm/v4/core/schemas.js → v4/core/schemas.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/standard-schema.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/standard-schema.js +0 -0
- /package/dist/{commonjs/v4 → v4}/core/to-json-schema.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/to-json-schema.js +0 -0
- /package/dist/{esm/v4/core/to-json-schema.js → v4/core/to-json-schema.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/util.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/util.js +0 -0
- /package/dist/{esm/v4/core/util.js → v4/core/util.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/versions.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/versions.js +0 -0
- /package/dist/{esm/v4/core/versions.js → v4/core/versions.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/core/zsf.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/core/zsf.js +0 -0
- /package/dist/{esm/v4/core/zsf.js → v4/core/zsf.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/index.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/index.js +0 -0
- /package/dist/{esm/v4/index.d.ts → v4/index.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/ar.d.ts +0 -0
- /package/dist/{esm/v4/locales/ar.js → v4/locales/ar.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/az.d.ts +0 -0
- /package/dist/{esm/v4/locales/az.js → v4/locales/az.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/be.d.ts +0 -0
- /package/dist/{esm/v4/locales/be.js → v4/locales/be.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/ca.d.ts +0 -0
- /package/dist/{esm/v4/locales/ca.js → v4/locales/ca.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/cs.d.ts +0 -0
- /package/dist/{esm/v4/locales/cs.js → v4/locales/cs.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/de.d.ts +0 -0
- /package/dist/{esm/v4/locales/de.js → v4/locales/de.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/en.d.ts +0 -0
- /package/dist/{esm/v4/locales/en.js → v4/locales/en.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/es.d.ts +0 -0
- /package/dist/{esm/v4/locales/es.js → v4/locales/es.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/fa.d.ts +0 -0
- /package/dist/{esm/v4/locales/fa.js → v4/locales/fa.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/fi.d.ts +0 -0
- /package/dist/{esm/v4/locales/fi.js → v4/locales/fi.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/fr.d.ts +0 -0
- /package/dist/{esm/v4/locales/fr.js → v4/locales/fr.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/frCA.d.ts +0 -0
- /package/dist/{esm/v4/locales/frCA.js → v4/locales/frCA.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/he.d.ts +0 -0
- /package/dist/{esm/v4/locales/he.js → v4/locales/he.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/hu.d.ts +0 -0
- /package/dist/{esm/v4/locales/hu.js → v4/locales/hu.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/id.d.ts +0 -0
- /package/dist/{esm/v4/locales/id.js → v4/locales/id.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/index.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/index.js +0 -0
- /package/dist/{esm/v4/locales/index.d.ts → v4/locales/index.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/it.d.ts +0 -0
- /package/dist/{esm/v4/locales/it.js → v4/locales/it.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/ja.d.ts +0 -0
- /package/dist/{esm/v4/locales/ja.js → v4/locales/ja.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/ko.d.ts +0 -0
- /package/dist/{esm/v4/locales/ko.js → v4/locales/ko.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/mk.d.ts +0 -0
- /package/dist/{esm/v4/locales/mk.js → v4/locales/mk.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/ms.d.ts +0 -0
- /package/dist/{esm/v4/locales/ms.js → v4/locales/ms.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/no.d.ts +0 -0
- /package/dist/{esm/v4/locales/no.js → v4/locales/no.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/ota.d.ts +0 -0
- /package/dist/{esm/v4/locales/ota.js → v4/locales/ota.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/pl.d.ts +0 -0
- /package/dist/{esm/v4/locales/pl.js → v4/locales/pl.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/pt.d.ts +0 -0
- /package/dist/{esm/v4/locales/pt.js → v4/locales/pt.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/ru.d.ts +0 -0
- /package/dist/{esm/v4/locales/ru.js → v4/locales/ru.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/sl.d.ts +0 -0
- /package/dist/{esm/v4/locales/sl.js → v4/locales/sl.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/ta.d.ts +0 -0
- /package/dist/{esm/v4/locales/ta.js → v4/locales/ta.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/th.d.ts +0 -0
- /package/dist/{esm/v4/locales/th.js → v4/locales/th.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/tr.d.ts +0 -0
- /package/dist/{esm/v4/locales/tr.js → v4/locales/tr.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/ua.d.ts +0 -0
- /package/dist/{esm/v4/locales/ua.js → v4/locales/ua.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/ur.d.ts +0 -0
- /package/dist/{esm/v4/locales/ur.js → v4/locales/ur.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/vi.d.ts +0 -0
- /package/dist/{esm/v4/locales/vi.js → v4/locales/vi.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/zh-CN.d.ts +0 -0
- /package/dist/{esm/v4/locales/zh-CN.js → v4/locales/zh-CN.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/locales/zh-tw.d.ts +0 -0
- /package/dist/{esm/v4/locales/zh-tw.js → v4/locales/zh-tw.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/mini/checks.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/mini/checks.js +0 -0
- /package/dist/{esm/v4/mini/checks.d.ts → v4/mini/checks.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/mini/coerce.d.ts +0 -0
- /package/dist/{esm/v4/mini/coerce.js → v4/mini/coerce.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/mini/external.d.ts +0 -0
- /package/dist/{esm/v4/mini/external.js → v4/mini/external.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/mini/index.d.ts +0 -0
- /package/dist/{esm/v4/mini/index.d.ts → v4/mini/index.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/mini/iso.d.ts +0 -0
- /package/dist/{esm/v4/mini/iso.js → v4/mini/iso.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/mini/parse.d.ts +0 -0
- /package/dist/{commonjs/v4 → v4}/mini/parse.js +0 -0
- /package/dist/{esm/v4/mini/parse.d.ts → v4/mini/parse.mjs} +0 -0
- /package/dist/{commonjs/v4 → v4}/mini/schemas.d.ts +0 -0
- /package/dist/{esm/v4/mini/schemas.js → v4/mini/schemas.mjs} +0 -0
|
@@ -0,0 +1,705 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const vitest_1 = require("vitest");
|
|
27
|
+
const z = __importStar(require("zod/v4"));
|
|
28
|
+
const empty = z.templateLiteral([]);
|
|
29
|
+
const hello = z.templateLiteral(["hello"]);
|
|
30
|
+
const world = z.templateLiteral(["", z.literal("world")]);
|
|
31
|
+
const one = z.templateLiteral([1]);
|
|
32
|
+
const two = z.templateLiteral(["", z.literal(2)]);
|
|
33
|
+
const truee = z.templateLiteral([true]);
|
|
34
|
+
const anotherTrue = z.templateLiteral(["", z.literal(true)]);
|
|
35
|
+
const falsee = z.templateLiteral([false]);
|
|
36
|
+
const anotherFalse = z.templateLiteral(["", z.literal(false)]);
|
|
37
|
+
const nulll = z.templateLiteral([null]);
|
|
38
|
+
const anotherNull = z.templateLiteral(["", z.null()]);
|
|
39
|
+
const undefinedd = z.templateLiteral([undefined]);
|
|
40
|
+
const anotherUndefined = z.templateLiteral(["", z.undefined()]);
|
|
41
|
+
const anyString = z.templateLiteral(["", z.string()]);
|
|
42
|
+
const lazyString = z.templateLiteral(["", z.lazy(() => z.string())]);
|
|
43
|
+
const anyNumber = z.templateLiteral(["", z.number()]);
|
|
44
|
+
const anyInt = z.templateLiteral(["", z.number().int()]);
|
|
45
|
+
// const anyFiniteNumber = z.templateLiteral(["", z.number().finite()]);
|
|
46
|
+
// const anyNegativeNumber = z.templateLiteral(["", z.number().negative()]);
|
|
47
|
+
// const anyPositiveNumber = z.templateLiteral(["", z.number().positive()]);
|
|
48
|
+
// const zeroButInADumbWay = z.templateLiteral(["", z.number().nonnegative().nonpositive()]);
|
|
49
|
+
// const finiteButInADumbWay = z.templateLiteral(["", z.number().min(5).max(10)]);
|
|
50
|
+
const bool = z.templateLiteral(["", z.boolean()]);
|
|
51
|
+
const bigone = z.templateLiteral(["", z.literal(BigInt(1))]);
|
|
52
|
+
const anyBigint = z.templateLiteral(["", z.bigint()]);
|
|
53
|
+
const nullableYo = z.templateLiteral(["", z.nullable(z.literal("yo"))]);
|
|
54
|
+
const nullableString = z.templateLiteral(["", z.nullable(z.string())]);
|
|
55
|
+
const optionalYeah = z.templateLiteral(["", z.literal("yeah").optional()]);
|
|
56
|
+
const optionalString = z.templateLiteral(["", z.string().optional()]);
|
|
57
|
+
const optionalNumber = z.templateLiteral(["", z.number().optional()]);
|
|
58
|
+
const nullishBruh = z.templateLiteral(["", z.literal("bruh").nullish()]);
|
|
59
|
+
const nullishString = z.templateLiteral(["", z.string().nullish()]);
|
|
60
|
+
const cuid = z.templateLiteral(["", z.string().cuid()]);
|
|
61
|
+
const cuidZZZ = z.templateLiteral(["", z.string().cuid(), "ZZZ"]);
|
|
62
|
+
const cuid2 = z.templateLiteral(["", z.string().cuid2()]);
|
|
63
|
+
const datetime = z.templateLiteral(["", z.string().datetime()]);
|
|
64
|
+
const email = z.templateLiteral(["", z.string().email()]);
|
|
65
|
+
// const ip = z.templateLiteral(["", z.string().ip()]);
|
|
66
|
+
const ipv4 = z.templateLiteral(["", z.string().ipv4()]);
|
|
67
|
+
const ipv6 = z.templateLiteral(["", z.string().ipv6()]);
|
|
68
|
+
const ulid = z.templateLiteral(["", z.string().ulid()]);
|
|
69
|
+
const uuid = z.templateLiteral(["", z.string().uuid()]);
|
|
70
|
+
const stringAToZ = z.templateLiteral(["", z.string().regex(/^[a-z]+$/)]);
|
|
71
|
+
const stringStartsWith = z.templateLiteral(["", z.string().startsWith("hello")]);
|
|
72
|
+
const stringEndsWith = z.templateLiteral(["", z.string().endsWith("world")]);
|
|
73
|
+
const stringMax5 = z.templateLiteral(["", z.string().max(5)]);
|
|
74
|
+
const stringMin5 = z.templateLiteral(["", z.string().min(5)]);
|
|
75
|
+
const stringLen5 = z.templateLiteral(["", z.string().length(5)]);
|
|
76
|
+
const stringMin5Max10 = z.templateLiteral(["", z.string().min(5).max(10)]);
|
|
77
|
+
const stringStartsWithMax5 = z.templateLiteral(["", z.string().startsWith("hello").max(5)]);
|
|
78
|
+
const brandedString = z.templateLiteral(["", z.string().min(1).brand("myBrand")]);
|
|
79
|
+
// const anything = z.templateLiteral(["", z.any()]);
|
|
80
|
+
const url = z.templateLiteral(["https://", z.string().regex(/\w+/), ".", z.enum(["com", "net"])]);
|
|
81
|
+
const measurement = z.templateLiteral([
|
|
82
|
+
"",
|
|
83
|
+
z.number().finite(),
|
|
84
|
+
z.enum(["px", "em", "rem", "vh", "vw", "vmin", "vmax"]).optional(),
|
|
85
|
+
]);
|
|
86
|
+
const connectionString = z.templateLiteral([
|
|
87
|
+
"mongodb://",
|
|
88
|
+
z
|
|
89
|
+
.templateLiteral([
|
|
90
|
+
"",
|
|
91
|
+
z.string().regex(/\w+/).describe("username"),
|
|
92
|
+
":",
|
|
93
|
+
z.string().regex(/\w+/).describe("password"),
|
|
94
|
+
"@",
|
|
95
|
+
])
|
|
96
|
+
.optional(),
|
|
97
|
+
z.string().regex(/\w+/).describe("host"),
|
|
98
|
+
":",
|
|
99
|
+
z.number().finite().int().positive().describe("port"),
|
|
100
|
+
z
|
|
101
|
+
.templateLiteral([
|
|
102
|
+
"/",
|
|
103
|
+
z.string().regex(/\w+/).optional().describe("defaultauthdb"),
|
|
104
|
+
z
|
|
105
|
+
.templateLiteral([
|
|
106
|
+
"?",
|
|
107
|
+
z
|
|
108
|
+
.string()
|
|
109
|
+
.regex(/^\w+=\w+(&\w+=\w+)*$/)
|
|
110
|
+
.optional()
|
|
111
|
+
.describe("options"),
|
|
112
|
+
])
|
|
113
|
+
.optional(),
|
|
114
|
+
])
|
|
115
|
+
.optional(),
|
|
116
|
+
]);
|
|
117
|
+
(0, vitest_1.test)("template literal type inference", () => {
|
|
118
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
119
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
120
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
121
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
122
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
123
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
124
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
125
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
126
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
127
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
128
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
129
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
130
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
131
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
132
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
133
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
134
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
135
|
+
// expectTypeOf<z.infer<typeof anyFiniteNumber>>().toEqualTypeOf<`${number}`>();
|
|
136
|
+
// expectTypeOf<z.infer<typeof anyNegativeNumber>>().toEqualTypeOf<`${number}`>();
|
|
137
|
+
// expectTypeOf<z.infer<typeof anyPositiveNumber>>().toEqualTypeOf<`${number}`>();
|
|
138
|
+
// expectTypeOf<z.infer<typeof zeroButInADumbWay>>().toEqualTypeOf<`${number}`>();
|
|
139
|
+
// expectTypeOf<z.infer<typeof finiteButInADumbWay>>().toEqualTypeOf<`${number}`>();
|
|
140
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
141
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
142
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
143
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
144
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
145
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
146
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
147
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
148
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
149
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
150
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
151
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
152
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
153
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
154
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
155
|
+
// expectTypeOf<z.infer<typeof ip>>().toEqualTypeOf<string>();
|
|
156
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
157
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
158
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
159
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
160
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
161
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
162
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
163
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
164
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
165
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
166
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
167
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
168
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
169
|
+
// expectTypeOf<z.infer<typeof anything>>().toEqualTypeOf<`${any}`>();
|
|
170
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
171
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
172
|
+
(0, vitest_1.expectTypeOf)().toEqualTypeOf();
|
|
173
|
+
});
|
|
174
|
+
(0, vitest_1.test)("template literal unsupported args", () => {
|
|
175
|
+
(0, vitest_1.expect)(() =>
|
|
176
|
+
// @ts-expect-error
|
|
177
|
+
z.templateLiteral([z.object({})])).toThrow();
|
|
178
|
+
(0, vitest_1.expect)(() =>
|
|
179
|
+
// @ts-expect-error
|
|
180
|
+
z.templateLiteral([z.array(z.object({}))])).toThrow();
|
|
181
|
+
(0, vitest_1.expect)(() =>
|
|
182
|
+
// @ts-expect-error
|
|
183
|
+
z.templateLiteral([z.union([z.object({}), z.string()])])).toThrow();
|
|
184
|
+
// @ts-expect-error
|
|
185
|
+
(0, vitest_1.expect)(() => z.templateLiteral([z.date()])).toThrow();
|
|
186
|
+
(0, vitest_1.expect)(() =>
|
|
187
|
+
// @ts-expect-error
|
|
188
|
+
z.templateLiteral([z.custom((_) => true)])).toThrow();
|
|
189
|
+
(0, vitest_1.expect)(() => z.templateLiteral([
|
|
190
|
+
// @ts-expect-error
|
|
191
|
+
z.discriminatedUnion("discriminator", [z.object({}), z.object({})]),
|
|
192
|
+
])).toThrow();
|
|
193
|
+
(0, vitest_1.expect)(() =>
|
|
194
|
+
// @ts-expect-error
|
|
195
|
+
z.templateLiteral([z.function()])).toThrow();
|
|
196
|
+
(0, vitest_1.expect)(() =>
|
|
197
|
+
// @ts-expect-error
|
|
198
|
+
z.templateLiteral([z.instanceof(class MyClass {
|
|
199
|
+
})])).toThrow();
|
|
200
|
+
(0, vitest_1.expect)(() =>
|
|
201
|
+
// @ts-expect-error
|
|
202
|
+
z.templateLiteral([z.intersection(z.object({}), z.object({}))])).toThrow();
|
|
203
|
+
(0, vitest_1.expect)(() =>
|
|
204
|
+
// @ts-expect-error
|
|
205
|
+
z.templateLiteral([z.map(z.string(), z.string())])).toThrow();
|
|
206
|
+
(0, vitest_1.expect)(() =>
|
|
207
|
+
// @ts-expect-error
|
|
208
|
+
z.templateLiteral([z.nullable(z.object({}))])).toThrow();
|
|
209
|
+
(0, vitest_1.expect)(() =>
|
|
210
|
+
// @ts-expect-error
|
|
211
|
+
z.templateLiteral([z.optional(z.object({}))])).toThrow();
|
|
212
|
+
(0, vitest_1.expect)(() =>
|
|
213
|
+
// @ts-expect-error
|
|
214
|
+
z.templateLiteral([z.promise()])).toThrow();
|
|
215
|
+
(0, vitest_1.expect)(() =>
|
|
216
|
+
// @ts-expect-error
|
|
217
|
+
z.templateLiteral([z.record(z.unknown())])).toThrow();
|
|
218
|
+
(0, vitest_1.expect)(() =>
|
|
219
|
+
// @ts-expect-error
|
|
220
|
+
z.templateLiteral([z.set(z.string())])).toThrow();
|
|
221
|
+
(0, vitest_1.expect)(() =>
|
|
222
|
+
// @ts-expect-error
|
|
223
|
+
z.templateLiteral([z.symbol()])).toThrow();
|
|
224
|
+
(0, vitest_1.expect)(() =>
|
|
225
|
+
// @ts-expect-error
|
|
226
|
+
z.templateLiteral([z.tuple([z.string()])])).toThrow();
|
|
227
|
+
(0, vitest_1.expect)(() =>
|
|
228
|
+
// @ts-expect-error
|
|
229
|
+
z.templateLiteral([z.unknown()])).toThrow();
|
|
230
|
+
(0, vitest_1.expect)(() =>
|
|
231
|
+
// @ts-expect-error
|
|
232
|
+
z.templateLiteral([z.void()])).toThrow();
|
|
233
|
+
(0, vitest_1.expect)(() =>
|
|
234
|
+
// @ts-expect-error
|
|
235
|
+
z.templateLiteral([z.never()])).toThrow();
|
|
236
|
+
// @ts-expect-error
|
|
237
|
+
(0, vitest_1.expect)(() => z.templateLiteral([z.nan()])).toThrow();
|
|
238
|
+
(0, vitest_1.expect)(() =>
|
|
239
|
+
// @ts-expect-error
|
|
240
|
+
z.templateLiteral([z.pipe(z.string(), z.string())])).toThrow();
|
|
241
|
+
(0, vitest_1.expect)(() =>
|
|
242
|
+
// @ts-expect-error
|
|
243
|
+
z.templateLiteral([z.preprocess(() => true, z.boolean())])).toThrow();
|
|
244
|
+
(0, vitest_1.expect)(() =>
|
|
245
|
+
// @ts-expect-error
|
|
246
|
+
z.templateLiteral([z.object({}).brand("brand")])).toThrow();
|
|
247
|
+
// these constraints aren't enforced but they shouldn't throw
|
|
248
|
+
z.templateLiteral([z.number().multipleOf(2)]);
|
|
249
|
+
z.templateLiteral([z.string().emoji()]);
|
|
250
|
+
z.templateLiteral([z.string().url()]);
|
|
251
|
+
z.templateLiteral([z.string().url()]);
|
|
252
|
+
z.templateLiteral([z.string().trim()]);
|
|
253
|
+
z.templateLiteral([z.string().includes("train")]);
|
|
254
|
+
z.templateLiteral([z.string().toLowerCase()]);
|
|
255
|
+
z.templateLiteral([z.string().toUpperCase()]);
|
|
256
|
+
});
|
|
257
|
+
(0, vitest_1.test)("template literal parsing - success - basic cases", () => {
|
|
258
|
+
(0, vitest_1.expect)(() => z.templateLiteral([]).parse(7)).toThrow();
|
|
259
|
+
empty.parse("");
|
|
260
|
+
hello.parse("hello");
|
|
261
|
+
world.parse("world");
|
|
262
|
+
one.parse("1");
|
|
263
|
+
two.parse("2");
|
|
264
|
+
truee.parse("true");
|
|
265
|
+
anotherTrue.parse("true");
|
|
266
|
+
falsee.parse("false");
|
|
267
|
+
anotherFalse.parse("false");
|
|
268
|
+
nulll.parse("null");
|
|
269
|
+
anotherNull.parse("null");
|
|
270
|
+
undefinedd.parse("undefined");
|
|
271
|
+
anotherUndefined.parse("undefined");
|
|
272
|
+
anyString.parse("blahblahblah");
|
|
273
|
+
anyString.parse("");
|
|
274
|
+
lazyString.parse("blahblahblah");
|
|
275
|
+
lazyString.parse("");
|
|
276
|
+
anyNumber.parse("123");
|
|
277
|
+
anyNumber.parse("1.23");
|
|
278
|
+
anyNumber.parse("0");
|
|
279
|
+
anyNumber.parse("-1.23");
|
|
280
|
+
anyNumber.parse("-123");
|
|
281
|
+
// anyNumber.parse("Infinity");
|
|
282
|
+
// anyNumber.parse("-Infinity");
|
|
283
|
+
anyInt.parse("123");
|
|
284
|
+
// anyInt.parse("-123");
|
|
285
|
+
// anyFiniteNumber.parse("123");
|
|
286
|
+
// anyFiniteNumber.parse("1.23");
|
|
287
|
+
// anyFiniteNumber.parse("0");
|
|
288
|
+
// anyFiniteNumber.parse("-1.23");
|
|
289
|
+
// anyFiniteNumber.parse("-123");
|
|
290
|
+
// anyNegativeNumber.parse("-123");
|
|
291
|
+
// anyNegativeNumber.parse("-1.23");
|
|
292
|
+
// anyNegativeNumber.parse("-Infinity");
|
|
293
|
+
// anyPositiveNumber.parse("123");
|
|
294
|
+
// anyPositiveNumber.parse("1.23");
|
|
295
|
+
// anyPositiveNumber.parse("Infinity");
|
|
296
|
+
// zeroButInADumbWay.parse("0");
|
|
297
|
+
// zeroButInADumbWay.parse("00000");
|
|
298
|
+
// finiteButInADumbWay.parse("5");
|
|
299
|
+
// finiteButInADumbWay.parse("10");
|
|
300
|
+
// finiteButInADumbWay.parse("6.66");
|
|
301
|
+
bool.parse("true");
|
|
302
|
+
bool.parse("false");
|
|
303
|
+
bigone.parse("1");
|
|
304
|
+
anyBigint.parse("123456");
|
|
305
|
+
anyBigint.parse("0");
|
|
306
|
+
// anyBigint.parse("-123456");
|
|
307
|
+
nullableYo.parse("yo");
|
|
308
|
+
nullableYo.parse("null");
|
|
309
|
+
nullableString.parse("abc");
|
|
310
|
+
nullableString.parse("null");
|
|
311
|
+
optionalYeah.parse("yeah");
|
|
312
|
+
optionalYeah.parse("");
|
|
313
|
+
optionalString.parse("abc");
|
|
314
|
+
optionalString.parse("");
|
|
315
|
+
optionalNumber.parse("123");
|
|
316
|
+
optionalNumber.parse("1.23");
|
|
317
|
+
optionalNumber.parse("0");
|
|
318
|
+
optionalNumber.parse("-1.23");
|
|
319
|
+
optionalNumber.parse("-123");
|
|
320
|
+
// optionalNumber.parse("Infinity");
|
|
321
|
+
// optionalNumber.parse("-Infinity");
|
|
322
|
+
nullishBruh.parse("bruh");
|
|
323
|
+
nullishBruh.parse("null");
|
|
324
|
+
nullishBruh.parse("");
|
|
325
|
+
cuid.parse("cjld2cyuq0000t3rmniod1foy");
|
|
326
|
+
cuidZZZ.parse("cjld2cyuq0000t3rmniod1foyZZZ");
|
|
327
|
+
cuid2.parse("tz4a98xxat96iws9zmbrgj3a");
|
|
328
|
+
datetime.parse(new Date().toISOString());
|
|
329
|
+
email.parse("info@example.com");
|
|
330
|
+
// ip.parse("213.174.246.205");
|
|
331
|
+
// ip.parse("c359:f57c:21e5:39eb:1187:e501:f936:b452");
|
|
332
|
+
ipv4.parse("213.174.246.205");
|
|
333
|
+
ipv6.parse("c359:f57c:21e5:39eb:1187:e501:f936:b452");
|
|
334
|
+
ulid.parse("01GW3D2QZJBYB6P1Z1AE997VPW");
|
|
335
|
+
uuid.parse("808989fd-3a6e-4af2-b607-737323a176f6");
|
|
336
|
+
stringAToZ.parse("asudgaskhdgashd");
|
|
337
|
+
stringStartsWith.parse("hello world");
|
|
338
|
+
stringEndsWith.parse("hello world");
|
|
339
|
+
stringMax5.parse("hello");
|
|
340
|
+
stringMin5.parse("hello");
|
|
341
|
+
stringLen5.parse("hello");
|
|
342
|
+
stringMin5Max10.parse("hello worl");
|
|
343
|
+
stringStartsWithMax5.parse("hello");
|
|
344
|
+
brandedString.parse("branded string");
|
|
345
|
+
});
|
|
346
|
+
(0, vitest_1.test)("template literal parsing - failure - basic cases", () => {
|
|
347
|
+
(0, vitest_1.expect)(() => empty.parse("a")).toThrow();
|
|
348
|
+
(0, vitest_1.expect)(() => hello.parse("hello!")).toThrow();
|
|
349
|
+
(0, vitest_1.expect)(() => hello.parse("!hello")).toThrow();
|
|
350
|
+
(0, vitest_1.expect)(() => world.parse("world!")).toThrow();
|
|
351
|
+
(0, vitest_1.expect)(() => world.parse("!world")).toThrow();
|
|
352
|
+
(0, vitest_1.expect)(() => one.parse("2")).toThrow();
|
|
353
|
+
(0, vitest_1.expect)(() => one.parse("12")).toThrow();
|
|
354
|
+
(0, vitest_1.expect)(() => one.parse("21")).toThrow();
|
|
355
|
+
(0, vitest_1.expect)(() => two.parse("1")).toThrow();
|
|
356
|
+
(0, vitest_1.expect)(() => two.parse("21")).toThrow();
|
|
357
|
+
(0, vitest_1.expect)(() => two.parse("12")).toThrow();
|
|
358
|
+
(0, vitest_1.expect)(() => truee.parse("false")).toThrow();
|
|
359
|
+
(0, vitest_1.expect)(() => truee.parse("1true")).toThrow();
|
|
360
|
+
(0, vitest_1.expect)(() => truee.parse("true1")).toThrow();
|
|
361
|
+
(0, vitest_1.expect)(() => anotherTrue.parse("false")).toThrow();
|
|
362
|
+
(0, vitest_1.expect)(() => anotherTrue.parse("1true")).toThrow();
|
|
363
|
+
(0, vitest_1.expect)(() => anotherTrue.parse("true1")).toThrow();
|
|
364
|
+
(0, vitest_1.expect)(() => falsee.parse("true")).toThrow();
|
|
365
|
+
(0, vitest_1.expect)(() => falsee.parse("1false")).toThrow();
|
|
366
|
+
(0, vitest_1.expect)(() => falsee.parse("false1")).toThrow();
|
|
367
|
+
(0, vitest_1.expect)(() => anotherFalse.parse("true")).toThrow();
|
|
368
|
+
(0, vitest_1.expect)(() => anotherFalse.parse("1false")).toThrow();
|
|
369
|
+
(0, vitest_1.expect)(() => anotherFalse.parse("false1")).toThrow();
|
|
370
|
+
(0, vitest_1.expect)(() => nulll.parse("123")).toThrow();
|
|
371
|
+
(0, vitest_1.expect)(() => nulll.parse("null1")).toThrow();
|
|
372
|
+
(0, vitest_1.expect)(() => nulll.parse("1null")).toThrow();
|
|
373
|
+
(0, vitest_1.expect)(() => anotherNull.parse("123")).toThrow();
|
|
374
|
+
(0, vitest_1.expect)(() => anotherNull.parse("null1")).toThrow();
|
|
375
|
+
(0, vitest_1.expect)(() => anotherNull.parse("1null")).toThrow();
|
|
376
|
+
(0, vitest_1.expect)(() => undefinedd.parse("123")).toThrow();
|
|
377
|
+
(0, vitest_1.expect)(() => undefinedd.parse("undefined1")).toThrow();
|
|
378
|
+
(0, vitest_1.expect)(() => undefinedd.parse("1undefined")).toThrow();
|
|
379
|
+
(0, vitest_1.expect)(() => anotherUndefined.parse("123")).toThrow();
|
|
380
|
+
(0, vitest_1.expect)(() => anotherUndefined.parse("undefined1")).toThrow();
|
|
381
|
+
(0, vitest_1.expect)(() => anotherUndefined.parse("1undefined")).toThrow();
|
|
382
|
+
(0, vitest_1.expect)(() => anyNumber.parse("2a")).toThrow();
|
|
383
|
+
(0, vitest_1.expect)(() => anyNumber.parse("a2")).toThrow();
|
|
384
|
+
(0, vitest_1.expect)(() => anyNumber.parse("-2a")).toThrow();
|
|
385
|
+
(0, vitest_1.expect)(() => anyNumber.parse("a-2")).toThrow();
|
|
386
|
+
(0, vitest_1.expect)(() => anyNumber.parse("2.5a")).toThrow();
|
|
387
|
+
(0, vitest_1.expect)(() => anyNumber.parse("a2.5")).toThrow();
|
|
388
|
+
(0, vitest_1.expect)(() => anyNumber.parse("Infinitya")).toThrow();
|
|
389
|
+
(0, vitest_1.expect)(() => anyNumber.parse("aInfinity")).toThrow();
|
|
390
|
+
(0, vitest_1.expect)(() => anyNumber.parse("-Infinitya")).toThrow();
|
|
391
|
+
(0, vitest_1.expect)(() => anyNumber.parse("a-Infinity")).toThrow();
|
|
392
|
+
(0, vitest_1.expect)(() => anyNumber.parse("2e5")).toThrow();
|
|
393
|
+
(0, vitest_1.expect)(() => anyNumber.parse("2e-5")).toThrow();
|
|
394
|
+
(0, vitest_1.expect)(() => anyNumber.parse("2e+5")).toThrow();
|
|
395
|
+
(0, vitest_1.expect)(() => anyNumber.parse("-2e5")).toThrow();
|
|
396
|
+
(0, vitest_1.expect)(() => anyNumber.parse("-2e-5")).toThrow();
|
|
397
|
+
(0, vitest_1.expect)(() => anyNumber.parse("-2e+5")).toThrow();
|
|
398
|
+
(0, vitest_1.expect)(() => anyNumber.parse("2.1e5")).toThrow();
|
|
399
|
+
(0, vitest_1.expect)(() => anyNumber.parse("2.1e-5")).toThrow();
|
|
400
|
+
(0, vitest_1.expect)(() => anyNumber.parse("2.1e+5")).toThrow();
|
|
401
|
+
(0, vitest_1.expect)(() => anyNumber.parse("-2.1e5")).toThrow();
|
|
402
|
+
(0, vitest_1.expect)(() => anyNumber.parse("-2.1e-5")).toThrow();
|
|
403
|
+
(0, vitest_1.expect)(() => anyNumber.parse("-2.1e+5")).toThrow();
|
|
404
|
+
(0, vitest_1.expect)(() => anyNumber.parse("-Infinity")).toThrow();
|
|
405
|
+
(0, vitest_1.expect)(() => anyNumber.parse("Infinity")).toThrow();
|
|
406
|
+
(0, vitest_1.expect)(() => anyInt.parse("1.23")).toThrow();
|
|
407
|
+
(0, vitest_1.expect)(() => anyInt.parse("-1.23")).toThrow();
|
|
408
|
+
(0, vitest_1.expect)(() => anyInt.parse("d1")).toThrow();
|
|
409
|
+
(0, vitest_1.expect)(() => anyInt.parse("1d")).toThrow();
|
|
410
|
+
// expect(() => anyFiniteNumber.parse("Infinity")).toThrow();
|
|
411
|
+
// expect(() => anyFiniteNumber.parse("-Infinity")).toThrow();
|
|
412
|
+
// expect(() => anyFiniteNumber.parse("123a")).toThrow();
|
|
413
|
+
// expect(() => anyFiniteNumber.parse("a123")).toThrow();
|
|
414
|
+
// expect(() => anyNegativeNumber.parse("0")).toThrow();
|
|
415
|
+
// expect(() => anyNegativeNumber.parse("1")).toThrow();
|
|
416
|
+
// expect(() => anyNegativeNumber.parse("Infinity")).toThrow();
|
|
417
|
+
// expect(() => anyPositiveNumber.parse("0")).toThrow();
|
|
418
|
+
// expect(() => anyPositiveNumber.parse("-1")).toThrow();
|
|
419
|
+
// expect(() => anyPositiveNumber.parse("-Infinity")).toThrow();
|
|
420
|
+
// expect(() => zeroButInADumbWay.parse("1")).toThrow();
|
|
421
|
+
// expect(() => zeroButInADumbWay.parse("-1")).toThrow();
|
|
422
|
+
// expect(() => finiteButInADumbWay.parse("Infinity")).toThrow();
|
|
423
|
+
// expect(() => finiteButInADumbWay.parse("-Infinity")).toThrow();
|
|
424
|
+
// expect(() => finiteButInADumbWay.parse("-5")).toThrow();
|
|
425
|
+
// expect(() => finiteButInADumbWay.parse("10a")).toThrow();
|
|
426
|
+
// expect(() => finiteButInADumbWay.parse("a10")).toThrow();
|
|
427
|
+
(0, vitest_1.expect)(() => bool.parse("123")).toThrow();
|
|
428
|
+
(0, vitest_1.expect)(() => bigone.parse("2")).toThrow();
|
|
429
|
+
(0, vitest_1.expect)(() => bigone.parse("c1")).toThrow();
|
|
430
|
+
(0, vitest_1.expect)(() => anyBigint.parse("1.23")).toThrow();
|
|
431
|
+
(0, vitest_1.expect)(() => anyBigint.parse("-1.23")).toThrow();
|
|
432
|
+
(0, vitest_1.expect)(() => anyBigint.parse("c123")).toThrow();
|
|
433
|
+
(0, vitest_1.expect)(() => nullableYo.parse("yo1")).toThrow();
|
|
434
|
+
(0, vitest_1.expect)(() => nullableYo.parse("1yo")).toThrow();
|
|
435
|
+
(0, vitest_1.expect)(() => nullableYo.parse("null1")).toThrow();
|
|
436
|
+
(0, vitest_1.expect)(() => nullableYo.parse("1null")).toThrow();
|
|
437
|
+
(0, vitest_1.expect)(() => optionalYeah.parse("yeah1")).toThrow();
|
|
438
|
+
(0, vitest_1.expect)(() => optionalYeah.parse("1yeah")).toThrow();
|
|
439
|
+
(0, vitest_1.expect)(() => optionalYeah.parse("undefined")).toThrow();
|
|
440
|
+
(0, vitest_1.expect)(() => optionalNumber.parse("123a")).toThrow();
|
|
441
|
+
(0, vitest_1.expect)(() => optionalNumber.parse("a123")).toThrow();
|
|
442
|
+
// expect(() => optionalNumber.parse("Infinitya")).toThrow();
|
|
443
|
+
// expect(() => optionalNumber.parse("aInfinity")).toThrow();
|
|
444
|
+
(0, vitest_1.expect)(() => nullishBruh.parse("bruh1")).toThrow();
|
|
445
|
+
(0, vitest_1.expect)(() => nullishBruh.parse("1bruh")).toThrow();
|
|
446
|
+
(0, vitest_1.expect)(() => nullishBruh.parse("null1")).toThrow();
|
|
447
|
+
(0, vitest_1.expect)(() => nullishBruh.parse("1null")).toThrow();
|
|
448
|
+
(0, vitest_1.expect)(() => nullishBruh.parse("undefined")).toThrow();
|
|
449
|
+
(0, vitest_1.expect)(() => cuid.parse("bjld2cyuq0000t3rmniod1foy")).toThrow();
|
|
450
|
+
(0, vitest_1.expect)(() => cuid.parse("cjld2cyu")).toThrow();
|
|
451
|
+
(0, vitest_1.expect)(() => cuid.parse("cjld2 cyu")).toThrow();
|
|
452
|
+
(0, vitest_1.expect)(() => cuid.parse("cjld2cyuq0000t3rmniod1foy ")).toThrow();
|
|
453
|
+
(0, vitest_1.expect)(() => cuid.parse("1cjld2cyuq0000t3rmniod1foy")).toThrow();
|
|
454
|
+
(0, vitest_1.expect)(() => cuidZZZ.parse("cjld2cyuq0000t3rmniod1foy")).toThrow();
|
|
455
|
+
(0, vitest_1.expect)(() => cuidZZZ.parse("cjld2cyuq0000t3rmniod1foyZZY")).toThrow();
|
|
456
|
+
(0, vitest_1.expect)(() => cuidZZZ.parse("cjld2cyuq0000t3rmniod1foyZZZ1")).toThrow();
|
|
457
|
+
(0, vitest_1.expect)(() => cuidZZZ.parse("1cjld2cyuq0000t3rmniod1foyZZZ")).toThrow();
|
|
458
|
+
(0, vitest_1.expect)(() => cuid2.parse("A9z4a98xxat96iws9zmbrgj3a")).toThrow();
|
|
459
|
+
(0, vitest_1.expect)(() => cuid2.parse("tz4a98xxat96iws9zmbrgj3!")).toThrow();
|
|
460
|
+
(0, vitest_1.expect)(() => datetime.parse("2022-01-01 00:00:00")).toThrow();
|
|
461
|
+
(0, vitest_1.expect)(() => email.parse("info@example.com@")).toThrow();
|
|
462
|
+
// expect(() => ip.parse("213.174.246:205")).toThrow();
|
|
463
|
+
// expect(() => ip.parse("c359.f57c:21e5:39eb:1187:e501:f936:b452")).toThrow();
|
|
464
|
+
(0, vitest_1.expect)(() => ipv4.parse("1213.174.246.205")).toThrow();
|
|
465
|
+
(0, vitest_1.expect)(() => ipv4.parse("c359:f57c:21e5:39eb:1187:e501:f936:b452")).toThrow();
|
|
466
|
+
(0, vitest_1.expect)(() => ipv6.parse("c359:f57c:21e5:39eb:1187:e501:f936:b4521")).toThrow();
|
|
467
|
+
(0, vitest_1.expect)(() => ipv6.parse("213.174.246.205")).toThrow();
|
|
468
|
+
(0, vitest_1.expect)(() => ulid.parse("01GW3D2QZJBYB6P1Z1AE997VPW!")).toThrow();
|
|
469
|
+
(0, vitest_1.expect)(() => uuid.parse("808989fd-3a6e-4af2-b607-737323a176f6Z")).toThrow();
|
|
470
|
+
(0, vitest_1.expect)(() => uuid.parse("Z808989fd-3a6e-4af2-b607-737323a176f6")).toThrow();
|
|
471
|
+
(0, vitest_1.expect)(() => stringAToZ.parse("asdasdasd1")).toThrow();
|
|
472
|
+
(0, vitest_1.expect)(() => stringAToZ.parse("1asdasdasd")).toThrow();
|
|
473
|
+
(0, vitest_1.expect)(() => stringStartsWith.parse("ahello")).toThrow();
|
|
474
|
+
(0, vitest_1.expect)(() => stringEndsWith.parse("worlda")).toThrow();
|
|
475
|
+
(0, vitest_1.expect)(() => stringMax5.parse("123456")).toThrow();
|
|
476
|
+
(0, vitest_1.expect)(() => stringMin5.parse("1234")).toThrow();
|
|
477
|
+
(0, vitest_1.expect)(() => stringLen5.parse("123456")).toThrow();
|
|
478
|
+
(0, vitest_1.expect)(() => stringLen5.parse("1234")).toThrow();
|
|
479
|
+
(0, vitest_1.expect)(() => stringMin5Max10.parse("1234")).toThrow();
|
|
480
|
+
(0, vitest_1.expect)(() => stringMin5Max10.parse("12345678901")).toThrow();
|
|
481
|
+
// the "startswith" overrides the max length
|
|
482
|
+
// expect(() => stringStartsWithMax5.parse("hello1")).toThrow();
|
|
483
|
+
(0, vitest_1.expect)(() => stringStartsWithMax5.parse("1hell")).toThrow();
|
|
484
|
+
(0, vitest_1.expect)(() => brandedString.parse("")).toThrow();
|
|
485
|
+
});
|
|
486
|
+
(0, vitest_1.test)("regexes", () => {
|
|
487
|
+
(0, vitest_1.expect)(empty._zod.pattern.source).toMatchInlineSnapshot(`"^$"`);
|
|
488
|
+
(0, vitest_1.expect)(hello._zod.pattern.source).toMatchInlineSnapshot(`"^hello$"`);
|
|
489
|
+
(0, vitest_1.expect)(world._zod.pattern.source).toMatchInlineSnapshot(`"^(world)$"`);
|
|
490
|
+
(0, vitest_1.expect)(one._zod.pattern.source).toMatchInlineSnapshot(`"^1$"`);
|
|
491
|
+
(0, vitest_1.expect)(two._zod.pattern.source).toMatchInlineSnapshot(`"^(2)$"`);
|
|
492
|
+
(0, vitest_1.expect)(truee._zod.pattern.source).toMatchInlineSnapshot(`"^true$"`);
|
|
493
|
+
(0, vitest_1.expect)(anotherTrue._zod.pattern.source).toMatchInlineSnapshot(`"^(true)$"`);
|
|
494
|
+
(0, vitest_1.expect)(falsee._zod.pattern.source).toMatchInlineSnapshot(`"^false$"`);
|
|
495
|
+
(0, vitest_1.expect)(anotherFalse._zod.pattern.source).toMatchInlineSnapshot(`"^(false)$"`);
|
|
496
|
+
(0, vitest_1.expect)(nulll._zod.pattern.source).toMatchInlineSnapshot(`"^null$"`);
|
|
497
|
+
(0, vitest_1.expect)(anotherNull._zod.pattern.source).toMatchInlineSnapshot(`"^null$"`);
|
|
498
|
+
(0, vitest_1.expect)(undefinedd._zod.pattern.source).toMatchInlineSnapshot(`"^undefined$"`);
|
|
499
|
+
(0, vitest_1.expect)(anotherUndefined._zod.pattern.source).toMatchInlineSnapshot(`"^undefined$"`);
|
|
500
|
+
(0, vitest_1.expect)(anyString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,}$"`);
|
|
501
|
+
(0, vitest_1.expect)(lazyString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,}$"`);
|
|
502
|
+
(0, vitest_1.expect)(anyNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
|
|
503
|
+
(0, vitest_1.expect)(anyInt._zod.pattern.source).toMatchInlineSnapshot(`"^\\d+$"`);
|
|
504
|
+
// expect(anyFiniteNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
|
|
505
|
+
// expect(anyNegativeNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
|
|
506
|
+
// expect(anyPositiveNumber._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
|
|
507
|
+
// expect(zeroButInADumbWay._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
|
|
508
|
+
// expect(finiteButInADumbWay._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?$"`);
|
|
509
|
+
(0, vitest_1.expect)(bool._zod.pattern.source).toMatchInlineSnapshot(`"^true|false$"`);
|
|
510
|
+
(0, vitest_1.expect)(bigone._zod.pattern.source).toMatchInlineSnapshot(`"^(1)$"`);
|
|
511
|
+
(0, vitest_1.expect)(anyBigint._zod.pattern.source).toMatchInlineSnapshot(`"^\\d+n?$"`);
|
|
512
|
+
(0, vitest_1.expect)(nullableYo._zod.pattern.source).toMatchInlineSnapshot(`"^((yo)|null)$"`);
|
|
513
|
+
(0, vitest_1.expect)(nullableString._zod.pattern.source).toMatchInlineSnapshot(`"^([\\s\\S]{0,}|null)$"`);
|
|
514
|
+
(0, vitest_1.expect)(optionalYeah._zod.pattern.source).toMatchInlineSnapshot(`"^((yeah))?$"`);
|
|
515
|
+
(0, vitest_1.expect)(optionalString._zod.pattern.source).toMatchInlineSnapshot(`"^([\\s\\S]{0,})?$"`);
|
|
516
|
+
(0, vitest_1.expect)(optionalNumber._zod.pattern.source).toMatchInlineSnapshot(`"^(-?\\d+(?:\\.\\d+)?)?$"`);
|
|
517
|
+
(0, vitest_1.expect)(nullishBruh._zod.pattern.source).toMatchInlineSnapshot(`"^(((bruh)|null))?$"`);
|
|
518
|
+
(0, vitest_1.expect)(nullishString._zod.pattern.source).toMatchInlineSnapshot(`"^(([\\s\\S]{0,}|null))?$"`);
|
|
519
|
+
(0, vitest_1.expect)(cuid._zod.pattern.source).toMatchInlineSnapshot(`"^[cC][^\\s-]{8,}$"`);
|
|
520
|
+
(0, vitest_1.expect)(cuidZZZ._zod.pattern.source).toMatchInlineSnapshot(`"^[cC][^\\s-]{8,}ZZZ$"`);
|
|
521
|
+
(0, vitest_1.expect)(cuid2._zod.pattern.source).toMatchInlineSnapshot(`"^[0-9a-z]+$"`);
|
|
522
|
+
(0, vitest_1.expect)(datetime._zod.pattern.source).toMatchInlineSnapshot(`"^((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))T([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(\\.\\d+)?(Z)$"`);
|
|
523
|
+
(0, vitest_1.expect)(email._zod.pattern.source).toMatchInlineSnapshot(`"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"`);
|
|
524
|
+
// expect(ip._zod.pattern.source).toMatchInlineSnapshot(
|
|
525
|
+
// `"^(^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$)|(^(([a-fA-F0-9]{1,4}:){7}|::([a-fA-F0-9]{1,4}:){0,6}|([a-fA-F0-9]{1,4}:){1}:([a-fA-F0-9]{1,4}:){0,5}|([a-fA-F0-9]{1,4}:){2}:([a-fA-F0-9]{1,4}:){0,4}|([a-fA-F0-9]{1,4}:){3}:([a-fA-F0-9]{1,4}:){0,3}|([a-fA-F0-9]{1,4}:){4}:([a-fA-F0-9]{1,4}:){0,2}|([a-fA-F0-9]{1,4}:){5}:([a-fA-F0-9]{1,4}:){0,1})([a-fA-F0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$)$"`
|
|
526
|
+
// );
|
|
527
|
+
(0, vitest_1.expect)(ipv4._zod.pattern.source).toMatchInlineSnapshot(`"^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$"`);
|
|
528
|
+
(0, vitest_1.expect)(ipv6._zod.pattern.source).toMatchInlineSnapshot(`"^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$"`);
|
|
529
|
+
(0, vitest_1.expect)(ulid._zod.pattern.source).toMatchInlineSnapshot(`"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"`);
|
|
530
|
+
(0, vitest_1.expect)(uuid._zod.pattern.source).toMatchInlineSnapshot(`"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"`);
|
|
531
|
+
(0, vitest_1.expect)(stringAToZ._zod.pattern.source).toMatchInlineSnapshot(`"^[a-z]+$"`);
|
|
532
|
+
(0, vitest_1.expect)(stringStartsWith._zod.pattern.source).toMatchInlineSnapshot(`"^hello.*$"`);
|
|
533
|
+
(0, vitest_1.expect)(stringEndsWith._zod.pattern.source).toMatchInlineSnapshot(`"^.*world$"`);
|
|
534
|
+
(0, vitest_1.expect)(stringMax5._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{0,5}$"`);
|
|
535
|
+
(0, vitest_1.expect)(stringMin5._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{5,}$"`);
|
|
536
|
+
(0, vitest_1.expect)(stringLen5._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{5,5}$"`);
|
|
537
|
+
(0, vitest_1.expect)(stringMin5Max10._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{5,10}$"`);
|
|
538
|
+
(0, vitest_1.expect)(brandedString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{1,}$"`);
|
|
539
|
+
(0, vitest_1.expect)(url._zod.pattern.source).toMatchInlineSnapshot(`"^https:\\/\\/\\w+\\.(com|net)$"`);
|
|
540
|
+
(0, vitest_1.expect)(measurement._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?((px|em|rem|vh|vw|vmin|vmax))?$"`);
|
|
541
|
+
(0, vitest_1.expect)(connectionString._zod.pattern.source).toMatchInlineSnapshot(`"^mongodb:\\/\\/(\\w+:\\w+@)?\\w+:\\d+(\\/(\\w+)?(\\?(\\w+=\\w+(&\\w+=\\w+)*)?)?)?$"`);
|
|
542
|
+
});
|
|
543
|
+
(0, vitest_1.test)("template literal parsing - success - complex cases", () => {
|
|
544
|
+
url.parse("https://example.com");
|
|
545
|
+
url.parse("https://speedtest.net");
|
|
546
|
+
// measurement.parse(1);
|
|
547
|
+
// measurement.parse(1.1);
|
|
548
|
+
// measurement.parse(0);
|
|
549
|
+
// measurement.parse(-1.1);
|
|
550
|
+
// measurement.parse(-1);
|
|
551
|
+
measurement.parse("1");
|
|
552
|
+
measurement.parse("1.1");
|
|
553
|
+
measurement.parse("0");
|
|
554
|
+
measurement.parse("-1");
|
|
555
|
+
measurement.parse("-1.1");
|
|
556
|
+
measurement.parse("1px");
|
|
557
|
+
measurement.parse("1.1px");
|
|
558
|
+
measurement.parse("0px");
|
|
559
|
+
measurement.parse("-1px");
|
|
560
|
+
measurement.parse("-1.1px");
|
|
561
|
+
measurement.parse("1em");
|
|
562
|
+
measurement.parse("1.1em");
|
|
563
|
+
measurement.parse("0em");
|
|
564
|
+
measurement.parse("-1em");
|
|
565
|
+
measurement.parse("-1.1em");
|
|
566
|
+
measurement.parse("1rem");
|
|
567
|
+
measurement.parse("1.1rem");
|
|
568
|
+
measurement.parse("0rem");
|
|
569
|
+
measurement.parse("-1rem");
|
|
570
|
+
measurement.parse("-1.1rem");
|
|
571
|
+
measurement.parse("1vh");
|
|
572
|
+
measurement.parse("1.1vh");
|
|
573
|
+
measurement.parse("0vh");
|
|
574
|
+
measurement.parse("-1vh");
|
|
575
|
+
measurement.parse("-1.1vh");
|
|
576
|
+
measurement.parse("1vw");
|
|
577
|
+
measurement.parse("1.1vw");
|
|
578
|
+
measurement.parse("0vw");
|
|
579
|
+
measurement.parse("-1vw");
|
|
580
|
+
measurement.parse("-1.1vw");
|
|
581
|
+
measurement.parse("1vmin");
|
|
582
|
+
measurement.parse("1.1vmin");
|
|
583
|
+
measurement.parse("0vmin");
|
|
584
|
+
measurement.parse("-1vmin");
|
|
585
|
+
measurement.parse("-1.1vmin");
|
|
586
|
+
measurement.parse("1vmax");
|
|
587
|
+
measurement.parse("1.1vmax");
|
|
588
|
+
measurement.parse("0vmax");
|
|
589
|
+
measurement.parse("-1vmax");
|
|
590
|
+
measurement.parse("-1.1vmax");
|
|
591
|
+
connectionString.parse("mongodb://host:1234");
|
|
592
|
+
connectionString.parse("mongodb://host:1234/");
|
|
593
|
+
connectionString.parse("mongodb://host:1234/defaultauthdb");
|
|
594
|
+
connectionString.parse("mongodb://host:1234/defaultauthdb?authSource=admin");
|
|
595
|
+
connectionString.parse("mongodb://host:1234/defaultauthdb?authSource=admin&connectTimeoutMS=300000");
|
|
596
|
+
connectionString.parse("mongodb://host:1234/?authSource=admin");
|
|
597
|
+
connectionString.parse("mongodb://host:1234/?authSource=admin&connectTimeoutMS=300000");
|
|
598
|
+
connectionString.parse("mongodb://username:password@host:1234");
|
|
599
|
+
connectionString.parse("mongodb://username:password@host:1234/");
|
|
600
|
+
connectionString.parse("mongodb://username:password@host:1234/defaultauthdb");
|
|
601
|
+
connectionString.parse("mongodb://username:password@host:1234/defaultauthdb?authSource=admin");
|
|
602
|
+
connectionString.parse("mongodb://username:password@host:1234/defaultauthdb?authSource=admin&connectTimeoutMS=300000");
|
|
603
|
+
connectionString.parse("mongodb://username:password@host:1234/?authSource=admin");
|
|
604
|
+
connectionString.parse("mongodb://username:password@host:1234/?authSource=admin&connectTimeoutMS=300000");
|
|
605
|
+
});
|
|
606
|
+
(0, vitest_1.test)("template literal parsing - failure - complex cases", () => {
|
|
607
|
+
(0, vitest_1.expect)(() => url.parse("http://example.com")).toThrow();
|
|
608
|
+
(0, vitest_1.expect)(() => url.parse("https://.com")).toThrow();
|
|
609
|
+
(0, vitest_1.expect)(() => url.parse("https://examplecom")).toThrow();
|
|
610
|
+
(0, vitest_1.expect)(() => url.parse("https://example.org")).toThrow();
|
|
611
|
+
(0, vitest_1.expect)(() => url.parse("https://example.net.il")).toThrow();
|
|
612
|
+
(0, vitest_1.expect)(() => measurement.parse("1.1.1")).toThrow();
|
|
613
|
+
(0, vitest_1.expect)(() => measurement.parse("Infinity")).toThrow();
|
|
614
|
+
(0, vitest_1.expect)(() => measurement.parse("-Infinity")).toThrow();
|
|
615
|
+
(0, vitest_1.expect)(() => measurement.parse("NaN")).toThrow();
|
|
616
|
+
(0, vitest_1.expect)(() => measurement.parse("1%")).toThrow();
|
|
617
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongod://host:1234")).toThrow();
|
|
618
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://:1234")).toThrow();
|
|
619
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://host1234")).toThrow();
|
|
620
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://host:d234")).toThrow();
|
|
621
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://host:12.34")).toThrow();
|
|
622
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://host:-1234")).toThrow();
|
|
623
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://host:-12.34")).toThrow();
|
|
624
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://host:")).toThrow();
|
|
625
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://:password@host:1234")).toThrow();
|
|
626
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://usernamepassword@host:1234")).toThrow();
|
|
627
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://username:@host:1234")).toThrow();
|
|
628
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://@host:1234")).toThrow();
|
|
629
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://host:1234/defaultauthdb?authSourceadmin")).toThrow();
|
|
630
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://host:1234/?authSourceadmin")).toThrow();
|
|
631
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://host:1234/defaultauthdb?&authSource=admin")).toThrow();
|
|
632
|
+
(0, vitest_1.expect)(() => connectionString.parse("mongodb://host:1234/?&authSource=admin")).toThrow();
|
|
633
|
+
});
|
|
634
|
+
(0, vitest_1.test)("template literal parsing - failure - issue format", () => {
|
|
635
|
+
(0, vitest_1.expect)(anotherNull.safeParse("1null")).toMatchInlineSnapshot(`
|
|
636
|
+
{
|
|
637
|
+
"error": [ZodError: [
|
|
638
|
+
{
|
|
639
|
+
"code": "invalid_format",
|
|
640
|
+
"format": "template_literal",
|
|
641
|
+
"pattern": "^null$",
|
|
642
|
+
"path": [],
|
|
643
|
+
"message": "Invalid input"
|
|
644
|
+
}
|
|
645
|
+
]],
|
|
646
|
+
"success": false,
|
|
647
|
+
}
|
|
648
|
+
`);
|
|
649
|
+
(0, vitest_1.expect)(cuidZZZ.safeParse("1cjld2cyuq0000t3rmniod1foyZZZ")).toMatchInlineSnapshot(`
|
|
650
|
+
{
|
|
651
|
+
"error": [ZodError: [
|
|
652
|
+
{
|
|
653
|
+
"code": "invalid_format",
|
|
654
|
+
"format": "template_literal",
|
|
655
|
+
"pattern": "^[cC][^\\\\s-]{8,}ZZZ$",
|
|
656
|
+
"path": [],
|
|
657
|
+
"message": "Invalid input"
|
|
658
|
+
}
|
|
659
|
+
]],
|
|
660
|
+
"success": false,
|
|
661
|
+
}
|
|
662
|
+
`);
|
|
663
|
+
(0, vitest_1.expect)(stringMin5Max10.safeParse("1234")).toMatchInlineSnapshot(`
|
|
664
|
+
{
|
|
665
|
+
"error": [ZodError: [
|
|
666
|
+
{
|
|
667
|
+
"code": "invalid_format",
|
|
668
|
+
"format": "template_literal",
|
|
669
|
+
"pattern": "^[\\\\s\\\\S]{5,10}$",
|
|
670
|
+
"path": [],
|
|
671
|
+
"message": "Invalid input"
|
|
672
|
+
}
|
|
673
|
+
]],
|
|
674
|
+
"success": false,
|
|
675
|
+
}
|
|
676
|
+
`);
|
|
677
|
+
(0, vitest_1.expect)(connectionString.safeParse("mongodb://host:1234/defaultauthdb?authSourceadmin")).toMatchInlineSnapshot(`
|
|
678
|
+
{
|
|
679
|
+
"error": [ZodError: [
|
|
680
|
+
{
|
|
681
|
+
"code": "invalid_format",
|
|
682
|
+
"format": "template_literal",
|
|
683
|
+
"pattern": "^mongodb:\\\\/\\\\/(\\\\w+:\\\\w+@)?\\\\w+:\\\\d+(\\\\/(\\\\w+)?(\\\\?(\\\\w+=\\\\w+(&\\\\w+=\\\\w+)*)?)?)?$",
|
|
684
|
+
"path": [],
|
|
685
|
+
"message": "Invalid input"
|
|
686
|
+
}
|
|
687
|
+
]],
|
|
688
|
+
"success": false,
|
|
689
|
+
}
|
|
690
|
+
`);
|
|
691
|
+
(0, vitest_1.expect)(stringStartsWithMax5.safeParse("1hell")).toMatchInlineSnapshot(`
|
|
692
|
+
{
|
|
693
|
+
"error": [ZodError: [
|
|
694
|
+
{
|
|
695
|
+
"code": "invalid_format",
|
|
696
|
+
"format": "template_literal",
|
|
697
|
+
"pattern": "^hello.*$",
|
|
698
|
+
"path": [],
|
|
699
|
+
"message": "Invalid input"
|
|
700
|
+
}
|
|
701
|
+
]],
|
|
702
|
+
"success": false,
|
|
703
|
+
}
|
|
704
|
+
`);
|
|
705
|
+
});
|