makecoder 1.0.25
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/LICENSE +21 -0
- package/README.md +281 -0
- package/claude/commands/dev/ultra-think.md +153 -0
- package/claude/commands/docs/generate-api-documentation.md +80 -0
- package/claude/commands/git/commit.md +63 -0
- package/claude/commands/git/status.md +39 -0
- package/claude/commands/setup/migrate-to-typescript.md +76 -0
- package/claude/commands/test/generate-test-cases.md +76 -0
- package/dist/cc.mjs +4654 -0
- package/dist/coder.js +201 -0
- package/dist/codex +0 -0
- package/dist/codex.exe +0 -0
- package/dist/codex.mjs +162 -0
- package/dist/gcli.mjs +3162 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/annotations-23.0.0.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.12-beta-searchableOptions.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.12-beta.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/config-1.4.3.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/jansi-2.4.1.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/kotlin-logging-jvm-7.0.0.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/kotlin-reflect-2.0.21.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/kotlin-sdk-jvm-0.4.0.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/kotlin-stdlib-2.1.20.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/kotlinx-coroutines-core-jvm-1.9.0.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/kotlinx-coroutines-slf4j-1.9.0.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/kotlinx-io-bytestring-jvm-0.5.4.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/kotlinx-io-core-jvm-0.5.4.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/kotlinx-serialization-core-jvm-1.8.1.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/kotlinx-serialization-json-jvm-1.8.1.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-client-cio-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-client-core-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-events-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-http-cio-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-http-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-io-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-network-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-network-tls-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-serialization-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-server-cio-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-server-core-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-server-sse-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-server-websockets-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-sse-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-utils-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-websocket-serialization-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/ktor-websockets-jvm-3.0.2.jar +0 -0
- package/dist/vendor/claude-code-jetbrains-plugin/lib/slf4j-api-2.0.16.jar +0 -0
- package/dist/vendor/ripgrep/COPYING +3 -0
- package/dist/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/dist/vendor/ripgrep/arm64-darwin/ripgrep.node +0 -0
- package/dist/vendor/ripgrep/arm64-linux/rg +0 -0
- package/dist/vendor/ripgrep/arm64-linux/ripgrep.node +0 -0
- package/dist/vendor/ripgrep/x64-darwin/rg +0 -0
- package/dist/vendor/ripgrep/x64-darwin/ripgrep.node +0 -0
- package/dist/vendor/ripgrep/x64-linux/rg +0 -0
- package/dist/vendor/ripgrep/x64-linux/ripgrep.node +0 -0
- package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/dist/vendor/ripgrep/x64-win32/ripgrep.node +0 -0
- package/dist/zod/LICENSE +21 -0
- package/dist/zod/README.md +208 -0
- package/dist/zod/index.cjs +33 -0
- package/dist/zod/index.d.cts +4 -0
- package/dist/zod/index.d.ts +4 -0
- package/dist/zod/index.js +4 -0
- package/dist/zod/package.json +118 -0
- package/dist/zod/src/index.ts +4 -0
- package/dist/zod/src/v3/ZodError.ts +330 -0
- package/dist/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/dist/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/dist/zod/src/v3/benchmarks/index.ts +59 -0
- package/dist/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/dist/zod/src/v3/benchmarks/object.ts +69 -0
- package/dist/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/dist/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/dist/zod/src/v3/benchmarks/string.ts +55 -0
- package/dist/zod/src/v3/benchmarks/union.ts +80 -0
- package/dist/zod/src/v3/errors.ts +13 -0
- package/dist/zod/src/v3/external.ts +6 -0
- package/dist/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/dist/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/dist/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/dist/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/dist/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/dist/zod/src/v3/helpers/util.ts +224 -0
- package/dist/zod/src/v3/index.ts +4 -0
- package/dist/zod/src/v3/locales/en.ts +124 -0
- package/dist/zod/src/v3/standard-schema.ts +113 -0
- package/dist/zod/src/v3/tests/Mocker.ts +54 -0
- package/dist/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/dist/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/dist/zod/src/v3/tests/array.test.ts +71 -0
- package/dist/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/dist/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/dist/zod/src/v3/tests/base.test.ts +29 -0
- package/dist/zod/src/v3/tests/bigint.test.ts +55 -0
- package/dist/zod/src/v3/tests/branded.test.ts +53 -0
- package/dist/zod/src/v3/tests/catch.test.ts +220 -0
- package/dist/zod/src/v3/tests/coerce.test.ts +133 -0
- package/dist/zod/src/v3/tests/complex.test.ts +56 -0
- package/dist/zod/src/v3/tests/custom.test.ts +31 -0
- package/dist/zod/src/v3/tests/date.test.ts +32 -0
- package/dist/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/dist/zod/src/v3/tests/default.test.ts +112 -0
- package/dist/zod/src/v3/tests/description.test.ts +33 -0
- package/dist/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/dist/zod/src/v3/tests/enum.test.ts +80 -0
- package/dist/zod/src/v3/tests/error.test.ts +551 -0
- package/dist/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/dist/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/dist/zod/src/v3/tests/function.test.ts +257 -0
- package/dist/zod/src/v3/tests/generics.test.ts +48 -0
- package/dist/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/dist/zod/src/v3/tests/intersection.test.ts +110 -0
- package/dist/zod/src/v3/tests/language-server.source.ts +76 -0
- package/dist/zod/src/v3/tests/language-server.test.ts +207 -0
- package/dist/zod/src/v3/tests/literal.test.ts +36 -0
- package/dist/zod/src/v3/tests/map.test.ts +110 -0
- package/dist/zod/src/v3/tests/masking.test.ts +4 -0
- package/dist/zod/src/v3/tests/mocker.test.ts +19 -0
- package/dist/zod/src/v3/tests/nan.test.ts +21 -0
- package/dist/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/dist/zod/src/v3/tests/nullable.test.ts +42 -0
- package/dist/zod/src/v3/tests/number.test.ts +176 -0
- package/dist/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/dist/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/dist/zod/src/v3/tests/object.test.ts +434 -0
- package/dist/zod/src/v3/tests/optional.test.ts +42 -0
- package/dist/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/dist/zod/src/v3/tests/parser.test.ts +41 -0
- package/dist/zod/src/v3/tests/partials.test.ts +243 -0
- package/dist/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/dist/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/dist/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/dist/zod/src/v3/tests/primitive.test.ts +440 -0
- package/dist/zod/src/v3/tests/promise.test.ts +90 -0
- package/dist/zod/src/v3/tests/readonly.test.ts +194 -0
- package/dist/zod/src/v3/tests/record.test.ts +171 -0
- package/dist/zod/src/v3/tests/recursive.test.ts +197 -0
- package/dist/zod/src/v3/tests/refine.test.ts +313 -0
- package/dist/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/dist/zod/src/v3/tests/set.test.ts +142 -0
- package/dist/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/dist/zod/src/v3/tests/string.test.ts +916 -0
- package/dist/zod/src/v3/tests/transformer.test.ts +233 -0
- package/dist/zod/src/v3/tests/tuple.test.ts +90 -0
- package/dist/zod/src/v3/tests/unions.test.ts +57 -0
- package/dist/zod/src/v3/tests/validations.test.ts +133 -0
- package/dist/zod/src/v3/tests/void.test.ts +15 -0
- package/dist/zod/src/v3/types.ts +5136 -0
- package/dist/zod/src/v4/classic/checks.ts +30 -0
- package/dist/zod/src/v4/classic/coerce.ts +27 -0
- package/dist/zod/src/v4/classic/compat.ts +66 -0
- package/dist/zod/src/v4/classic/errors.ts +75 -0
- package/dist/zod/src/v4/classic/external.ts +50 -0
- package/dist/zod/src/v4/classic/index.ts +5 -0
- package/dist/zod/src/v4/classic/iso.ts +90 -0
- package/dist/zod/src/v4/classic/parse.ts +33 -0
- package/dist/zod/src/v4/classic/schemas.ts +2054 -0
- package/dist/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/dist/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/dist/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/dist/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/dist/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/dist/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/dist/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/dist/zod/src/v4/classic/tests/brand.test.ts +63 -0
- package/dist/zod/src/v4/classic/tests/catch.test.ts +252 -0
- package/dist/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/dist/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/dist/zod/src/v4/classic/tests/continuability.test.ts +352 -0
- package/dist/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/dist/zod/src/v4/classic/tests/date.test.ts +31 -0
- package/dist/zod/src/v4/classic/tests/datetime.test.ts +296 -0
- package/dist/zod/src/v4/classic/tests/default.test.ts +313 -0
- package/dist/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/dist/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
- package/dist/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/dist/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
- package/dist/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/dist/zod/src/v4/classic/tests/file.test.ts +91 -0
- package/dist/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
- package/dist/zod/src/v4/classic/tests/function.test.ts +268 -0
- package/dist/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/dist/zod/src/v4/classic/tests/index.test.ts +829 -0
- package/dist/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
- package/dist/zod/src/v4/classic/tests/intersection.test.ts +171 -0
- package/dist/zod/src/v4/classic/tests/json.test.ts +108 -0
- package/dist/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/dist/zod/src/v4/classic/tests/literal.test.ts +92 -0
- package/dist/zod/src/v4/classic/tests/map.test.ts +196 -0
- package/dist/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/dist/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/dist/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
- package/dist/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/dist/zod/src/v4/classic/tests/number.test.ts +247 -0
- package/dist/zod/src/v4/classic/tests/object.test.ts +563 -0
- package/dist/zod/src/v4/classic/tests/optional.test.ts +123 -0
- package/dist/zod/src/v4/classic/tests/partial.test.ts +147 -0
- package/dist/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
- package/dist/zod/src/v4/classic/tests/pipe.test.ts +81 -0
- package/dist/zod/src/v4/classic/tests/prefault.test.ts +37 -0
- package/dist/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
- package/dist/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/dist/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/dist/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/dist/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/dist/zod/src/v4/classic/tests/record.test.ts +342 -0
- package/dist/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
- package/dist/zod/src/v4/classic/tests/refine.test.ts +532 -0
- package/dist/zod/src/v4/classic/tests/registries.test.ts +204 -0
- package/dist/zod/src/v4/classic/tests/set.test.ts +179 -0
- package/dist/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
- package/dist/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
- package/dist/zod/src/v4/classic/tests/string.test.ts +881 -0
- package/dist/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
- package/dist/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
- package/dist/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
- package/dist/zod/src/v4/classic/tests/transform.test.ts +250 -0
- package/dist/zod/src/v4/classic/tests/tuple.test.ts +163 -0
- package/dist/zod/src/v4/classic/tests/union.test.ts +94 -0
- package/dist/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/dist/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/dist/zod/src/v4/core/api.ts +1594 -0
- package/dist/zod/src/v4/core/checks.ts +1283 -0
- package/dist/zod/src/v4/core/config.ts +15 -0
- package/dist/zod/src/v4/core/core.ts +134 -0
- package/dist/zod/src/v4/core/doc.ts +44 -0
- package/dist/zod/src/v4/core/errors.ts +424 -0
- package/dist/zod/src/v4/core/function.ts +176 -0
- package/dist/zod/src/v4/core/index.ts +15 -0
- package/dist/zod/src/v4/core/json-schema.ts +143 -0
- package/dist/zod/src/v4/core/parse.ts +94 -0
- package/dist/zod/src/v4/core/regexes.ts +135 -0
- package/dist/zod/src/v4/core/registries.ts +96 -0
- package/dist/zod/src/v4/core/schemas.ts +3842 -0
- package/dist/zod/src/v4/core/standard-schema.ts +64 -0
- package/dist/zod/src/v4/core/tests/index.test.ts +46 -0
- package/dist/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/dist/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/dist/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/dist/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/dist/zod/src/v4/core/to-json-schema.ts +977 -0
- package/dist/zod/src/v4/core/util.ts +775 -0
- package/dist/zod/src/v4/core/versions.ts +5 -0
- package/dist/zod/src/v4/core/zsf.ts +323 -0
- package/dist/zod/src/v4/index.ts +4 -0
- package/dist/zod/src/v4/locales/ar.ts +125 -0
- package/dist/zod/src/v4/locales/az.ts +121 -0
- package/dist/zod/src/v4/locales/be.ts +184 -0
- package/dist/zod/src/v4/locales/ca.ts +127 -0
- package/dist/zod/src/v4/locales/cs.ts +142 -0
- package/dist/zod/src/v4/locales/de.ts +124 -0
- package/dist/zod/src/v4/locales/en.ts +127 -0
- package/dist/zod/src/v4/locales/eo.ts +125 -0
- package/dist/zod/src/v4/locales/es.ts +125 -0
- package/dist/zod/src/v4/locales/fa.ts +134 -0
- package/dist/zod/src/v4/locales/fi.ts +131 -0
- package/dist/zod/src/v4/locales/fr-CA.ts +126 -0
- package/dist/zod/src/v4/locales/fr.ts +124 -0
- package/dist/zod/src/v4/locales/he.ts +125 -0
- package/dist/zod/src/v4/locales/hu.ts +126 -0
- package/dist/zod/src/v4/locales/id.ts +125 -0
- package/dist/zod/src/v4/locales/index.ts +39 -0
- package/dist/zod/src/v4/locales/it.ts +125 -0
- package/dist/zod/src/v4/locales/ja.ts +122 -0
- package/dist/zod/src/v4/locales/kh.ts +126 -0
- package/dist/zod/src/v4/locales/ko.ts +131 -0
- package/dist/zod/src/v4/locales/mk.ts +127 -0
- package/dist/zod/src/v4/locales/ms.ts +124 -0
- package/dist/zod/src/v4/locales/nl.ts +126 -0
- package/dist/zod/src/v4/locales/no.ts +124 -0
- package/dist/zod/src/v4/locales/ota.ts +125 -0
- package/dist/zod/src/v4/locales/pl.ts +126 -0
- package/dist/zod/src/v4/locales/ps.ts +133 -0
- package/dist/zod/src/v4/locales/pt.ts +123 -0
- package/dist/zod/src/v4/locales/ru.ts +184 -0
- package/dist/zod/src/v4/locales/sl.ts +126 -0
- package/dist/zod/src/v4/locales/sv.ts +127 -0
- package/dist/zod/src/v4/locales/ta.ts +125 -0
- package/dist/zod/src/v4/locales/th.ts +126 -0
- package/dist/zod/src/v4/locales/tr.ts +121 -0
- package/dist/zod/src/v4/locales/ua.ts +126 -0
- package/dist/zod/src/v4/locales/ur.ts +126 -0
- package/dist/zod/src/v4/locales/vi.ts +125 -0
- package/dist/zod/src/v4/locales/zh-CN.ts +123 -0
- package/dist/zod/src/v4/locales/zh-TW.ts +125 -0
- package/dist/zod/src/v4/mini/checks.ts +32 -0
- package/dist/zod/src/v4/mini/coerce.ts +22 -0
- package/dist/zod/src/v4/mini/external.ts +40 -0
- package/dist/zod/src/v4/mini/index.ts +3 -0
- package/dist/zod/src/v4/mini/iso.ts +62 -0
- package/dist/zod/src/v4/mini/parse.ts +1 -0
- package/dist/zod/src/v4/mini/schemas.ts +1579 -0
- package/dist/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/dist/zod/src/v4/mini/tests/brand.test.ts +51 -0
- package/dist/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/dist/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/dist/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/dist/zod/src/v4/mini/tests/functions.test.ts +43 -0
- package/dist/zod/src/v4/mini/tests/index.test.ts +871 -0
- package/dist/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/dist/zod/src/v4/mini/tests/object.test.ts +185 -0
- package/dist/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/dist/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/dist/zod/src/v4/mini/tests/string.test.ts +299 -0
- package/dist/zod/src/v4-mini/index.ts +1 -0
- package/dist/zod/v3/ZodError.cjs +138 -0
- package/dist/zod/v3/ZodError.d.cts +164 -0
- package/dist/zod/v3/ZodError.d.ts +164 -0
- package/dist/zod/v3/ZodError.js +133 -0
- package/dist/zod/v3/errors.cjs +17 -0
- package/dist/zod/v3/errors.d.cts +5 -0
- package/dist/zod/v3/errors.d.ts +5 -0
- package/dist/zod/v3/errors.js +9 -0
- package/dist/zod/v3/external.cjs +22 -0
- package/dist/zod/v3/external.d.cts +6 -0
- package/dist/zod/v3/external.d.ts +6 -0
- package/dist/zod/v3/external.js +6 -0
- package/dist/zod/v3/helpers/enumUtil.cjs +2 -0
- package/dist/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/dist/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/dist/zod/v3/helpers/enumUtil.js +1 -0
- package/dist/zod/v3/helpers/errorUtil.cjs +9 -0
- package/dist/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/dist/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/dist/zod/v3/helpers/errorUtil.js +6 -0
- package/dist/zod/v3/helpers/parseUtil.cjs +124 -0
- package/dist/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/dist/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/dist/zod/v3/helpers/parseUtil.js +109 -0
- package/dist/zod/v3/helpers/partialUtil.cjs +2 -0
- package/dist/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/dist/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/dist/zod/v3/helpers/partialUtil.js +1 -0
- package/dist/zod/v3/helpers/typeAliases.cjs +2 -0
- package/dist/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/dist/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/dist/zod/v3/helpers/typeAliases.js +1 -0
- package/dist/zod/v3/helpers/util.cjs +137 -0
- package/dist/zod/v3/helpers/util.d.cts +85 -0
- package/dist/zod/v3/helpers/util.d.ts +85 -0
- package/dist/zod/v3/helpers/util.js +133 -0
- package/dist/zod/v3/index.cjs +33 -0
- package/dist/zod/v3/index.d.cts +4 -0
- package/dist/zod/v3/index.d.ts +4 -0
- package/dist/zod/v3/index.js +4 -0
- package/dist/zod/v3/locales/en.cjs +111 -0
- package/dist/zod/v3/locales/en.d.cts +3 -0
- package/dist/zod/v3/locales/en.d.ts +3 -0
- package/dist/zod/v3/locales/en.js +109 -0
- package/dist/zod/v3/standard-schema.cjs +2 -0
- package/dist/zod/v3/standard-schema.d.cts +102 -0
- package/dist/zod/v3/standard-schema.d.ts +102 -0
- package/dist/zod/v3/standard-schema.js +1 -0
- package/dist/zod/v3/types.cjs +3775 -0
- package/dist/zod/v3/types.d.cts +1031 -0
- package/dist/zod/v3/types.d.ts +1031 -0
- package/dist/zod/v3/types.js +3693 -0
- package/dist/zod/v4/classic/checks.cjs +32 -0
- package/dist/zod/v4/classic/checks.d.cts +1 -0
- package/dist/zod/v4/classic/checks.d.ts +1 -0
- package/dist/zod/v4/classic/checks.js +1 -0
- package/dist/zod/v4/classic/coerce.cjs +47 -0
- package/dist/zod/v4/classic/coerce.d.cts +17 -0
- package/dist/zod/v4/classic/coerce.d.ts +17 -0
- package/dist/zod/v4/classic/coerce.js +17 -0
- package/dist/zod/v4/classic/compat.cjs +57 -0
- package/dist/zod/v4/classic/compat.d.cts +46 -0
- package/dist/zod/v4/classic/compat.d.ts +46 -0
- package/dist/zod/v4/classic/compat.js +27 -0
- package/dist/zod/v4/classic/errors.cjs +67 -0
- package/dist/zod/v4/classic/errors.d.cts +30 -0
- package/dist/zod/v4/classic/errors.d.ts +30 -0
- package/dist/zod/v4/classic/errors.js +41 -0
- package/dist/zod/v4/classic/external.cjs +70 -0
- package/dist/zod/v4/classic/external.d.cts +13 -0
- package/dist/zod/v4/classic/external.d.ts +13 -0
- package/dist/zod/v4/classic/external.js +18 -0
- package/dist/zod/v4/classic/index.cjs +33 -0
- package/dist/zod/v4/classic/index.d.cts +4 -0
- package/dist/zod/v4/classic/index.d.ts +4 -0
- package/dist/zod/v4/classic/index.js +4 -0
- package/dist/zod/v4/classic/iso.cjs +60 -0
- package/dist/zod/v4/classic/iso.d.cts +22 -0
- package/dist/zod/v4/classic/iso.d.ts +22 -0
- package/dist/zod/v4/classic/iso.js +30 -0
- package/dist/zod/v4/classic/parse.cjs +32 -0
- package/dist/zod/v4/classic/parse.d.cts +23 -0
- package/dist/zod/v4/classic/parse.d.ts +23 -0
- package/dist/zod/v4/classic/parse.js +6 -0
- package/dist/zod/v4/classic/schemas.cjs +1109 -0
- package/dist/zod/v4/classic/schemas.d.cts +630 -0
- package/dist/zod/v4/classic/schemas.d.ts +630 -0
- package/dist/zod/v4/classic/schemas.js +1006 -0
- package/dist/zod/v4/core/api.cjs +1039 -0
- package/dist/zod/v4/core/api.d.cts +284 -0
- package/dist/zod/v4/core/api.d.ts +284 -0
- package/dist/zod/v4/core/api.js +906 -0
- package/dist/zod/v4/core/checks.cjs +591 -0
- package/dist/zod/v4/core/checks.d.cts +278 -0
- package/dist/zod/v4/core/checks.d.ts +278 -0
- package/dist/zod/v4/core/checks.js +565 -0
- package/dist/zod/v4/core/core.cjs +67 -0
- package/dist/zod/v4/core/core.d.cts +49 -0
- package/dist/zod/v4/core/core.d.ts +49 -0
- package/dist/zod/v4/core/core.js +61 -0
- package/dist/zod/v4/core/doc.cjs +39 -0
- package/dist/zod/v4/core/doc.d.cts +14 -0
- package/dist/zod/v4/core/doc.d.ts +14 -0
- package/dist/zod/v4/core/doc.js +35 -0
- package/dist/zod/v4/core/errors.cjs +226 -0
- package/dist/zod/v4/core/errors.d.cts +208 -0
- package/dist/zod/v4/core/errors.d.ts +208 -0
- package/dist/zod/v4/core/errors.js +195 -0
- package/dist/zod/v4/core/function.cjs +102 -0
- package/dist/zod/v4/core/function.d.cts +52 -0
- package/dist/zod/v4/core/function.d.ts +52 -0
- package/dist/zod/v4/core/function.js +75 -0
- package/dist/zod/v4/core/index.cjs +44 -0
- package/dist/zod/v4/core/index.d.cts +15 -0
- package/dist/zod/v4/core/index.d.ts +15 -0
- package/dist/zod/v4/core/index.js +15 -0
- package/dist/zod/v4/core/json-schema.cjs +2 -0
- package/dist/zod/v4/core/json-schema.d.cts +87 -0
- package/dist/zod/v4/core/json-schema.d.ts +87 -0
- package/dist/zod/v4/core/json-schema.js +1 -0
- package/dist/zod/v4/core/parse.cjs +87 -0
- package/dist/zod/v4/core/parse.d.cts +25 -0
- package/dist/zod/v4/core/parse.d.ts +25 -0
- package/dist/zod/v4/core/parse.js +57 -0
- package/dist/zod/v4/core/regexes.cjs +103 -0
- package/dist/zod/v4/core/regexes.d.cts +62 -0
- package/dist/zod/v4/core/regexes.d.ts +62 -0
- package/dist/zod/v4/core/regexes.js +95 -0
- package/dist/zod/v4/core/registries.cjs +56 -0
- package/dist/zod/v4/core/registries.d.cts +35 -0
- package/dist/zod/v4/core/registries.d.ts +35 -0
- package/dist/zod/v4/core/registries.js +51 -0
- package/dist/zod/v4/core/schemas.cjs +1748 -0
- package/dist/zod/v4/core/schemas.d.cts +1041 -0
- package/dist/zod/v4/core/schemas.d.ts +1041 -0
- package/dist/zod/v4/core/schemas.js +1717 -0
- package/dist/zod/v4/core/standard-schema.cjs +2 -0
- package/dist/zod/v4/core/standard-schema.d.cts +55 -0
- package/dist/zod/v4/core/standard-schema.d.ts +55 -0
- package/dist/zod/v4/core/standard-schema.js +1 -0
- package/dist/zod/v4/core/to-json-schema.cjs +854 -0
- package/dist/zod/v4/core/to-json-schema.d.cts +88 -0
- package/dist/zod/v4/core/to-json-schema.d.ts +88 -0
- package/dist/zod/v4/core/to-json-schema.js +849 -0
- package/dist/zod/v4/core/util.cjs +539 -0
- package/dist/zod/v4/core/util.d.cts +183 -0
- package/dist/zod/v4/core/util.d.ts +183 -0
- package/dist/zod/v4/core/util.js +493 -0
- package/dist/zod/v4/core/versions.cjs +8 -0
- package/dist/zod/v4/core/versions.d.cts +5 -0
- package/dist/zod/v4/core/versions.d.ts +5 -0
- package/dist/zod/v4/core/versions.js +5 -0
- package/dist/zod/v4/index.cjs +22 -0
- package/dist/zod/v4/index.d.cts +3 -0
- package/dist/zod/v4/index.d.ts +3 -0
- package/dist/zod/v4/index.js +3 -0
- package/dist/zod/v4/locales/ar.cjs +142 -0
- package/dist/zod/v4/locales/ar.d.cts +4 -0
- package/dist/zod/v4/locales/ar.d.ts +4 -0
- package/dist/zod/v4/locales/ar.js +116 -0
- package/dist/zod/v4/locales/az.cjs +141 -0
- package/dist/zod/v4/locales/az.d.cts +4 -0
- package/dist/zod/v4/locales/az.d.ts +4 -0
- package/dist/zod/v4/locales/az.js +115 -0
- package/dist/zod/v4/locales/be.cjs +190 -0
- package/dist/zod/v4/locales/be.d.cts +4 -0
- package/dist/zod/v4/locales/be.d.ts +4 -0
- package/dist/zod/v4/locales/be.js +164 -0
- package/dist/zod/v4/locales/ca.cjs +144 -0
- package/dist/zod/v4/locales/ca.d.cts +4 -0
- package/dist/zod/v4/locales/ca.d.ts +4 -0
- package/dist/zod/v4/locales/ca.js +118 -0
- package/dist/zod/v4/locales/cs.cjs +161 -0
- package/dist/zod/v4/locales/cs.d.cts +4 -0
- package/dist/zod/v4/locales/cs.d.ts +4 -0
- package/dist/zod/v4/locales/cs.js +135 -0
- package/dist/zod/v4/locales/de.cjs +142 -0
- package/dist/zod/v4/locales/de.d.cts +4 -0
- package/dist/zod/v4/locales/de.d.ts +4 -0
- package/dist/zod/v4/locales/de.js +116 -0
- package/dist/zod/v4/locales/en.cjs +145 -0
- package/dist/zod/v4/locales/en.d.cts +5 -0
- package/dist/zod/v4/locales/en.d.ts +5 -0
- package/dist/zod/v4/locales/en.js +117 -0
- package/dist/zod/v4/locales/eo.cjs +144 -0
- package/dist/zod/v4/locales/eo.d.cts +5 -0
- package/dist/zod/v4/locales/eo.d.ts +5 -0
- package/dist/zod/v4/locales/eo.js +116 -0
- package/dist/zod/v4/locales/es.cjs +143 -0
- package/dist/zod/v4/locales/es.d.cts +4 -0
- package/dist/zod/v4/locales/es.d.ts +4 -0
- package/dist/zod/v4/locales/es.js +117 -0
- package/dist/zod/v4/locales/fa.cjs +148 -0
- package/dist/zod/v4/locales/fa.d.cts +4 -0
- package/dist/zod/v4/locales/fa.d.ts +4 -0
- package/dist/zod/v4/locales/fa.js +122 -0
- package/dist/zod/v4/locales/fi.cjs +148 -0
- package/dist/zod/v4/locales/fi.d.cts +4 -0
- package/dist/zod/v4/locales/fi.d.ts +4 -0
- package/dist/zod/v4/locales/fi.js +122 -0
- package/dist/zod/v4/locales/fr-CA.cjs +143 -0
- package/dist/zod/v4/locales/fr-CA.d.cts +4 -0
- package/dist/zod/v4/locales/fr-CA.d.ts +4 -0
- package/dist/zod/v4/locales/fr-CA.js +117 -0
- package/dist/zod/v4/locales/fr.cjs +142 -0
- package/dist/zod/v4/locales/fr.d.cts +4 -0
- package/dist/zod/v4/locales/fr.d.ts +4 -0
- package/dist/zod/v4/locales/fr.js +116 -0
- package/dist/zod/v4/locales/he.cjs +143 -0
- package/dist/zod/v4/locales/he.d.cts +4 -0
- package/dist/zod/v4/locales/he.d.ts +4 -0
- package/dist/zod/v4/locales/he.js +117 -0
- package/dist/zod/v4/locales/hu.cjs +143 -0
- package/dist/zod/v4/locales/hu.d.cts +4 -0
- package/dist/zod/v4/locales/hu.d.ts +4 -0
- package/dist/zod/v4/locales/hu.js +117 -0
- package/dist/zod/v4/locales/id.cjs +142 -0
- package/dist/zod/v4/locales/id.d.cts +4 -0
- package/dist/zod/v4/locales/id.d.ts +4 -0
- package/dist/zod/v4/locales/id.js +116 -0
- package/dist/zod/v4/locales/index.cjs +84 -0
- package/dist/zod/v4/locales/index.d.cts +39 -0
- package/dist/zod/v4/locales/index.d.ts +39 -0
- package/dist/zod/v4/locales/index.js +39 -0
- package/dist/zod/v4/locales/it.cjs +143 -0
- package/dist/zod/v4/locales/it.d.cts +4 -0
- package/dist/zod/v4/locales/it.d.ts +4 -0
- package/dist/zod/v4/locales/it.js +117 -0
- package/dist/zod/v4/locales/ja.cjs +141 -0
- package/dist/zod/v4/locales/ja.d.cts +4 -0
- package/dist/zod/v4/locales/ja.d.ts +4 -0
- package/dist/zod/v4/locales/ja.js +115 -0
- package/dist/zod/v4/locales/kh.cjs +143 -0
- package/dist/zod/v4/locales/kh.d.cts +4 -0
- package/dist/zod/v4/locales/kh.d.ts +4 -0
- package/dist/zod/v4/locales/kh.js +117 -0
- package/dist/zod/v4/locales/ko.cjs +147 -0
- package/dist/zod/v4/locales/ko.d.cts +4 -0
- package/dist/zod/v4/locales/ko.d.ts +4 -0
- package/dist/zod/v4/locales/ko.js +121 -0
- package/dist/zod/v4/locales/mk.cjs +144 -0
- package/dist/zod/v4/locales/mk.d.cts +4 -0
- package/dist/zod/v4/locales/mk.d.ts +4 -0
- package/dist/zod/v4/locales/mk.js +118 -0
- package/dist/zod/v4/locales/ms.cjs +142 -0
- package/dist/zod/v4/locales/ms.d.cts +4 -0
- package/dist/zod/v4/locales/ms.d.ts +4 -0
- package/dist/zod/v4/locales/ms.js +116 -0
- package/dist/zod/v4/locales/nl.cjs +143 -0
- package/dist/zod/v4/locales/nl.d.cts +4 -0
- package/dist/zod/v4/locales/nl.d.ts +4 -0
- package/dist/zod/v4/locales/nl.js +117 -0
- package/dist/zod/v4/locales/no.cjs +142 -0
- package/dist/zod/v4/locales/no.d.cts +4 -0
- package/dist/zod/v4/locales/no.d.ts +4 -0
- package/dist/zod/v4/locales/no.js +116 -0
- package/dist/zod/v4/locales/ota.cjs +143 -0
- package/dist/zod/v4/locales/ota.d.cts +4 -0
- package/dist/zod/v4/locales/ota.d.ts +4 -0
- package/dist/zod/v4/locales/ota.js +117 -0
- package/dist/zod/v4/locales/pl.cjs +143 -0
- package/dist/zod/v4/locales/pl.d.cts +4 -0
- package/dist/zod/v4/locales/pl.d.ts +4 -0
- package/dist/zod/v4/locales/pl.js +117 -0
- package/dist/zod/v4/locales/ps.cjs +148 -0
- package/dist/zod/v4/locales/ps.d.cts +4 -0
- package/dist/zod/v4/locales/ps.d.ts +4 -0
- package/dist/zod/v4/locales/ps.js +122 -0
- package/dist/zod/v4/locales/pt.cjs +142 -0
- package/dist/zod/v4/locales/pt.d.cts +4 -0
- package/dist/zod/v4/locales/pt.d.ts +4 -0
- package/dist/zod/v4/locales/pt.js +116 -0
- package/dist/zod/v4/locales/ru.cjs +190 -0
- package/dist/zod/v4/locales/ru.d.cts +4 -0
- package/dist/zod/v4/locales/ru.d.ts +4 -0
- package/dist/zod/v4/locales/ru.js +164 -0
- package/dist/zod/v4/locales/sl.cjs +143 -0
- package/dist/zod/v4/locales/sl.d.cts +4 -0
- package/dist/zod/v4/locales/sl.d.ts +4 -0
- package/dist/zod/v4/locales/sl.js +117 -0
- package/dist/zod/v4/locales/sv.cjs +144 -0
- package/dist/zod/v4/locales/sv.d.cts +4 -0
- package/dist/zod/v4/locales/sv.d.ts +4 -0
- package/dist/zod/v4/locales/sv.js +118 -0
- package/dist/zod/v4/locales/ta.cjs +143 -0
- package/dist/zod/v4/locales/ta.d.cts +4 -0
- package/dist/zod/v4/locales/ta.d.ts +4 -0
- package/dist/zod/v4/locales/ta.js +117 -0
- package/dist/zod/v4/locales/th.cjs +143 -0
- package/dist/zod/v4/locales/th.d.cts +4 -0
- package/dist/zod/v4/locales/th.d.ts +4 -0
- package/dist/zod/v4/locales/th.js +117 -0
- package/dist/zod/v4/locales/tr.cjs +143 -0
- package/dist/zod/v4/locales/tr.d.cts +5 -0
- package/dist/zod/v4/locales/tr.d.ts +5 -0
- package/dist/zod/v4/locales/tr.js +115 -0
- package/dist/zod/v4/locales/ua.cjs +143 -0
- package/dist/zod/v4/locales/ua.d.cts +4 -0
- package/dist/zod/v4/locales/ua.d.ts +4 -0
- package/dist/zod/v4/locales/ua.js +117 -0
- package/dist/zod/v4/locales/ur.cjs +143 -0
- package/dist/zod/v4/locales/ur.d.cts +4 -0
- package/dist/zod/v4/locales/ur.d.ts +4 -0
- package/dist/zod/v4/locales/ur.js +117 -0
- package/dist/zod/v4/locales/vi.cjs +142 -0
- package/dist/zod/v4/locales/vi.d.cts +4 -0
- package/dist/zod/v4/locales/vi.d.ts +4 -0
- package/dist/zod/v4/locales/vi.js +116 -0
- package/dist/zod/v4/locales/zh-CN.cjs +142 -0
- package/dist/zod/v4/locales/zh-CN.d.cts +4 -0
- package/dist/zod/v4/locales/zh-CN.d.ts +4 -0
- package/dist/zod/v4/locales/zh-CN.js +116 -0
- package/dist/zod/v4/locales/zh-TW.cjs +143 -0
- package/dist/zod/v4/locales/zh-TW.d.cts +4 -0
- package/dist/zod/v4/locales/zh-TW.d.ts +4 -0
- package/dist/zod/v4/locales/zh-TW.js +117 -0
- package/dist/zod/v4/mini/checks.cjs +34 -0
- package/dist/zod/v4/mini/checks.d.cts +1 -0
- package/dist/zod/v4/mini/checks.d.ts +1 -0
- package/dist/zod/v4/mini/checks.js +1 -0
- package/dist/zod/v4/mini/coerce.cjs +47 -0
- package/dist/zod/v4/mini/coerce.d.cts +7 -0
- package/dist/zod/v4/mini/coerce.d.ts +7 -0
- package/dist/zod/v4/mini/coerce.js +17 -0
- package/dist/zod/v4/mini/external.cjs +62 -0
- package/dist/zod/v4/mini/external.d.cts +11 -0
- package/dist/zod/v4/mini/external.d.ts +11 -0
- package/dist/zod/v4/mini/external.js +13 -0
- package/dist/zod/v4/mini/index.cjs +32 -0
- package/dist/zod/v4/mini/index.d.cts +3 -0
- package/dist/zod/v4/mini/index.d.ts +3 -0
- package/dist/zod/v4/mini/index.js +3 -0
- package/dist/zod/v4/mini/iso.cjs +60 -0
- package/dist/zod/v4/mini/iso.d.cts +22 -0
- package/dist/zod/v4/mini/iso.d.ts +22 -0
- package/dist/zod/v4/mini/iso.js +30 -0
- package/dist/zod/v4/mini/parse.cjs +8 -0
- package/dist/zod/v4/mini/parse.d.cts +1 -0
- package/dist/zod/v4/mini/parse.d.ts +1 -0
- package/dist/zod/v4/mini/parse.js +1 -0
- package/dist/zod/v4/mini/schemas.cjs +839 -0
- package/dist/zod/v4/mini/schemas.d.cts +356 -0
- package/dist/zod/v4/mini/schemas.d.ts +356 -0
- package/dist/zod/v4/mini/schemas.js +732 -0
- package/dist/zod/v4-mini/index.cjs +17 -0
- package/dist/zod/v4-mini/index.d.cts +1 -0
- package/dist/zod/v4-mini/index.d.ts +1 -0
- package/dist/zod/v4-mini/index.js +1 -0
- package/package.json +42 -0
- package/scripts/postinstall.js +75 -0
|
@@ -0,0 +1,591 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { $ZodType } from "./schemas.js";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.$ZodCheckOverwrite = exports.$ZodCheckMimeType = exports.$ZodCheckProperty = exports.$ZodCheckEndsWith = exports.$ZodCheckStartsWith = exports.$ZodCheckIncludes = exports.$ZodCheckUpperCase = exports.$ZodCheckLowerCase = exports.$ZodCheckRegex = exports.$ZodCheckStringFormat = exports.$ZodCheckLengthEquals = exports.$ZodCheckMinLength = exports.$ZodCheckMaxLength = exports.$ZodCheckSizeEquals = exports.$ZodCheckMinSize = exports.$ZodCheckMaxSize = exports.$ZodCheckBigIntFormat = exports.$ZodCheckNumberFormat = exports.$ZodCheckMultipleOf = exports.$ZodCheckGreaterThan = exports.$ZodCheckLessThan = exports.$ZodCheck = void 0;
|
|
28
|
+
const core = __importStar(require("./core.cjs"));
|
|
29
|
+
const regexes = __importStar(require("./regexes.cjs"));
|
|
30
|
+
const util = __importStar(require("./util.cjs"));
|
|
31
|
+
exports.$ZodCheck = core.$constructor("$ZodCheck", (inst, def) => {
|
|
32
|
+
var _a;
|
|
33
|
+
inst._zod ?? (inst._zod = {});
|
|
34
|
+
inst._zod.def = def;
|
|
35
|
+
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
36
|
+
});
|
|
37
|
+
const numericOriginMap = {
|
|
38
|
+
number: "number",
|
|
39
|
+
bigint: "bigint",
|
|
40
|
+
object: "date",
|
|
41
|
+
};
|
|
42
|
+
exports.$ZodCheckLessThan = core.$constructor("$ZodCheckLessThan", (inst, def) => {
|
|
43
|
+
exports.$ZodCheck.init(inst, def);
|
|
44
|
+
const origin = numericOriginMap[typeof def.value];
|
|
45
|
+
inst._zod.onattach.push((inst) => {
|
|
46
|
+
const bag = inst._zod.bag;
|
|
47
|
+
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
48
|
+
if (def.value < curr) {
|
|
49
|
+
if (def.inclusive)
|
|
50
|
+
bag.maximum = def.value;
|
|
51
|
+
else
|
|
52
|
+
bag.exclusiveMaximum = def.value;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
inst._zod.check = (payload) => {
|
|
56
|
+
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
payload.issues.push({
|
|
60
|
+
origin,
|
|
61
|
+
code: "too_big",
|
|
62
|
+
maximum: def.value,
|
|
63
|
+
input: payload.value,
|
|
64
|
+
inclusive: def.inclusive,
|
|
65
|
+
inst,
|
|
66
|
+
continue: !def.abort,
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
exports.$ZodCheckGreaterThan = core.$constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
71
|
+
exports.$ZodCheck.init(inst, def);
|
|
72
|
+
const origin = numericOriginMap[typeof def.value];
|
|
73
|
+
inst._zod.onattach.push((inst) => {
|
|
74
|
+
const bag = inst._zod.bag;
|
|
75
|
+
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
76
|
+
if (def.value > curr) {
|
|
77
|
+
if (def.inclusive)
|
|
78
|
+
bag.minimum = def.value;
|
|
79
|
+
else
|
|
80
|
+
bag.exclusiveMinimum = def.value;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
inst._zod.check = (payload) => {
|
|
84
|
+
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
payload.issues.push({
|
|
88
|
+
origin,
|
|
89
|
+
code: "too_small",
|
|
90
|
+
minimum: def.value,
|
|
91
|
+
input: payload.value,
|
|
92
|
+
inclusive: def.inclusive,
|
|
93
|
+
inst,
|
|
94
|
+
continue: !def.abort,
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
exports.$ZodCheckMultipleOf =
|
|
99
|
+
/*@__PURE__*/ core.$constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
100
|
+
exports.$ZodCheck.init(inst, def);
|
|
101
|
+
inst._zod.onattach.push((inst) => {
|
|
102
|
+
var _a;
|
|
103
|
+
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
104
|
+
});
|
|
105
|
+
inst._zod.check = (payload) => {
|
|
106
|
+
if (typeof payload.value !== typeof def.value)
|
|
107
|
+
throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
108
|
+
const isMultiple = typeof payload.value === "bigint"
|
|
109
|
+
? payload.value % def.value === BigInt(0)
|
|
110
|
+
: util.floatSafeRemainder(payload.value, def.value) === 0;
|
|
111
|
+
if (isMultiple)
|
|
112
|
+
return;
|
|
113
|
+
payload.issues.push({
|
|
114
|
+
origin: typeof payload.value,
|
|
115
|
+
code: "not_multiple_of",
|
|
116
|
+
divisor: def.value,
|
|
117
|
+
input: payload.value,
|
|
118
|
+
inst,
|
|
119
|
+
continue: !def.abort,
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
exports.$ZodCheckNumberFormat = core.$constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
124
|
+
exports.$ZodCheck.init(inst, def); // no format checks
|
|
125
|
+
def.format = def.format || "float64";
|
|
126
|
+
const isInt = def.format?.includes("int");
|
|
127
|
+
const origin = isInt ? "int" : "number";
|
|
128
|
+
const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];
|
|
129
|
+
inst._zod.onattach.push((inst) => {
|
|
130
|
+
const bag = inst._zod.bag;
|
|
131
|
+
bag.format = def.format;
|
|
132
|
+
bag.minimum = minimum;
|
|
133
|
+
bag.maximum = maximum;
|
|
134
|
+
if (isInt)
|
|
135
|
+
bag.pattern = regexes.integer;
|
|
136
|
+
});
|
|
137
|
+
inst._zod.check = (payload) => {
|
|
138
|
+
const input = payload.value;
|
|
139
|
+
if (isInt) {
|
|
140
|
+
if (!Number.isInteger(input)) {
|
|
141
|
+
// invalid_format issue
|
|
142
|
+
// payload.issues.push({
|
|
143
|
+
// expected: def.format,
|
|
144
|
+
// format: def.format,
|
|
145
|
+
// code: "invalid_format",
|
|
146
|
+
// input,
|
|
147
|
+
// inst,
|
|
148
|
+
// });
|
|
149
|
+
// invalid_type issue
|
|
150
|
+
payload.issues.push({
|
|
151
|
+
expected: origin,
|
|
152
|
+
format: def.format,
|
|
153
|
+
code: "invalid_type",
|
|
154
|
+
input,
|
|
155
|
+
inst,
|
|
156
|
+
});
|
|
157
|
+
return;
|
|
158
|
+
// not_multiple_of issue
|
|
159
|
+
// payload.issues.push({
|
|
160
|
+
// code: "not_multiple_of",
|
|
161
|
+
// origin: "number",
|
|
162
|
+
// input,
|
|
163
|
+
// inst,
|
|
164
|
+
// divisor: 1,
|
|
165
|
+
// });
|
|
166
|
+
}
|
|
167
|
+
if (!Number.isSafeInteger(input)) {
|
|
168
|
+
if (input > 0) {
|
|
169
|
+
// too_big
|
|
170
|
+
payload.issues.push({
|
|
171
|
+
input,
|
|
172
|
+
code: "too_big",
|
|
173
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
174
|
+
note: "Integers must be within the safe integer range.",
|
|
175
|
+
inst,
|
|
176
|
+
origin,
|
|
177
|
+
continue: !def.abort,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
// too_small
|
|
182
|
+
payload.issues.push({
|
|
183
|
+
input,
|
|
184
|
+
code: "too_small",
|
|
185
|
+
minimum: Number.MIN_SAFE_INTEGER,
|
|
186
|
+
note: "Integers must be within the safe integer range.",
|
|
187
|
+
inst,
|
|
188
|
+
origin,
|
|
189
|
+
continue: !def.abort,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (input < minimum) {
|
|
196
|
+
payload.issues.push({
|
|
197
|
+
origin: "number",
|
|
198
|
+
input,
|
|
199
|
+
code: "too_small",
|
|
200
|
+
minimum,
|
|
201
|
+
inclusive: true,
|
|
202
|
+
inst,
|
|
203
|
+
continue: !def.abort,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
if (input > maximum) {
|
|
207
|
+
payload.issues.push({
|
|
208
|
+
origin: "number",
|
|
209
|
+
input,
|
|
210
|
+
code: "too_big",
|
|
211
|
+
maximum,
|
|
212
|
+
inst,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
});
|
|
217
|
+
exports.$ZodCheckBigIntFormat = core.$constructor("$ZodCheckBigIntFormat", (inst, def) => {
|
|
218
|
+
exports.$ZodCheck.init(inst, def); // no format checks
|
|
219
|
+
const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];
|
|
220
|
+
inst._zod.onattach.push((inst) => {
|
|
221
|
+
const bag = inst._zod.bag;
|
|
222
|
+
bag.format = def.format;
|
|
223
|
+
bag.minimum = minimum;
|
|
224
|
+
bag.maximum = maximum;
|
|
225
|
+
});
|
|
226
|
+
inst._zod.check = (payload) => {
|
|
227
|
+
const input = payload.value;
|
|
228
|
+
if (input < minimum) {
|
|
229
|
+
payload.issues.push({
|
|
230
|
+
origin: "bigint",
|
|
231
|
+
input,
|
|
232
|
+
code: "too_small",
|
|
233
|
+
minimum: minimum,
|
|
234
|
+
inclusive: true,
|
|
235
|
+
inst,
|
|
236
|
+
continue: !def.abort,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
if (input > maximum) {
|
|
240
|
+
payload.issues.push({
|
|
241
|
+
origin: "bigint",
|
|
242
|
+
input,
|
|
243
|
+
code: "too_big",
|
|
244
|
+
maximum,
|
|
245
|
+
inst,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
});
|
|
250
|
+
exports.$ZodCheckMaxSize = core.$constructor("$ZodCheckMaxSize", (inst, def) => {
|
|
251
|
+
var _a;
|
|
252
|
+
exports.$ZodCheck.init(inst, def);
|
|
253
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
254
|
+
const val = payload.value;
|
|
255
|
+
return !util.nullish(val) && val.size !== undefined;
|
|
256
|
+
});
|
|
257
|
+
inst._zod.onattach.push((inst) => {
|
|
258
|
+
const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);
|
|
259
|
+
if (def.maximum < curr)
|
|
260
|
+
inst._zod.bag.maximum = def.maximum;
|
|
261
|
+
});
|
|
262
|
+
inst._zod.check = (payload) => {
|
|
263
|
+
const input = payload.value;
|
|
264
|
+
const size = input.size;
|
|
265
|
+
if (size <= def.maximum)
|
|
266
|
+
return;
|
|
267
|
+
payload.issues.push({
|
|
268
|
+
origin: util.getSizableOrigin(input),
|
|
269
|
+
code: "too_big",
|
|
270
|
+
maximum: def.maximum,
|
|
271
|
+
input,
|
|
272
|
+
inst,
|
|
273
|
+
continue: !def.abort,
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
});
|
|
277
|
+
exports.$ZodCheckMinSize = core.$constructor("$ZodCheckMinSize", (inst, def) => {
|
|
278
|
+
var _a;
|
|
279
|
+
exports.$ZodCheck.init(inst, def);
|
|
280
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
281
|
+
const val = payload.value;
|
|
282
|
+
return !util.nullish(val) && val.size !== undefined;
|
|
283
|
+
});
|
|
284
|
+
inst._zod.onattach.push((inst) => {
|
|
285
|
+
const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);
|
|
286
|
+
if (def.minimum > curr)
|
|
287
|
+
inst._zod.bag.minimum = def.minimum;
|
|
288
|
+
});
|
|
289
|
+
inst._zod.check = (payload) => {
|
|
290
|
+
const input = payload.value;
|
|
291
|
+
const size = input.size;
|
|
292
|
+
if (size >= def.minimum)
|
|
293
|
+
return;
|
|
294
|
+
payload.issues.push({
|
|
295
|
+
origin: util.getSizableOrigin(input),
|
|
296
|
+
code: "too_small",
|
|
297
|
+
minimum: def.minimum,
|
|
298
|
+
input,
|
|
299
|
+
inst,
|
|
300
|
+
continue: !def.abort,
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
});
|
|
304
|
+
exports.$ZodCheckSizeEquals = core.$constructor("$ZodCheckSizeEquals", (inst, def) => {
|
|
305
|
+
var _a;
|
|
306
|
+
exports.$ZodCheck.init(inst, def);
|
|
307
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
308
|
+
const val = payload.value;
|
|
309
|
+
return !util.nullish(val) && val.size !== undefined;
|
|
310
|
+
});
|
|
311
|
+
inst._zod.onattach.push((inst) => {
|
|
312
|
+
const bag = inst._zod.bag;
|
|
313
|
+
bag.minimum = def.size;
|
|
314
|
+
bag.maximum = def.size;
|
|
315
|
+
bag.size = def.size;
|
|
316
|
+
});
|
|
317
|
+
inst._zod.check = (payload) => {
|
|
318
|
+
const input = payload.value;
|
|
319
|
+
const size = input.size;
|
|
320
|
+
if (size === def.size)
|
|
321
|
+
return;
|
|
322
|
+
const tooBig = size > def.size;
|
|
323
|
+
payload.issues.push({
|
|
324
|
+
origin: util.getSizableOrigin(input),
|
|
325
|
+
...(tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size }),
|
|
326
|
+
inclusive: true,
|
|
327
|
+
exact: true,
|
|
328
|
+
input: payload.value,
|
|
329
|
+
inst,
|
|
330
|
+
continue: !def.abort,
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
});
|
|
334
|
+
exports.$ZodCheckMaxLength = core.$constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
335
|
+
var _a;
|
|
336
|
+
exports.$ZodCheck.init(inst, def);
|
|
337
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
338
|
+
const val = payload.value;
|
|
339
|
+
return !util.nullish(val) && val.length !== undefined;
|
|
340
|
+
});
|
|
341
|
+
inst._zod.onattach.push((inst) => {
|
|
342
|
+
const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);
|
|
343
|
+
if (def.maximum < curr)
|
|
344
|
+
inst._zod.bag.maximum = def.maximum;
|
|
345
|
+
});
|
|
346
|
+
inst._zod.check = (payload) => {
|
|
347
|
+
const input = payload.value;
|
|
348
|
+
const length = input.length;
|
|
349
|
+
if (length <= def.maximum)
|
|
350
|
+
return;
|
|
351
|
+
const origin = util.getLengthableOrigin(input);
|
|
352
|
+
payload.issues.push({
|
|
353
|
+
origin,
|
|
354
|
+
code: "too_big",
|
|
355
|
+
maximum: def.maximum,
|
|
356
|
+
inclusive: true,
|
|
357
|
+
input,
|
|
358
|
+
inst,
|
|
359
|
+
continue: !def.abort,
|
|
360
|
+
});
|
|
361
|
+
};
|
|
362
|
+
});
|
|
363
|
+
exports.$ZodCheckMinLength = core.$constructor("$ZodCheckMinLength", (inst, def) => {
|
|
364
|
+
var _a;
|
|
365
|
+
exports.$ZodCheck.init(inst, def);
|
|
366
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
367
|
+
const val = payload.value;
|
|
368
|
+
return !util.nullish(val) && val.length !== undefined;
|
|
369
|
+
});
|
|
370
|
+
inst._zod.onattach.push((inst) => {
|
|
371
|
+
const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);
|
|
372
|
+
if (def.minimum > curr)
|
|
373
|
+
inst._zod.bag.minimum = def.minimum;
|
|
374
|
+
});
|
|
375
|
+
inst._zod.check = (payload) => {
|
|
376
|
+
const input = payload.value;
|
|
377
|
+
const length = input.length;
|
|
378
|
+
if (length >= def.minimum)
|
|
379
|
+
return;
|
|
380
|
+
const origin = util.getLengthableOrigin(input);
|
|
381
|
+
payload.issues.push({
|
|
382
|
+
origin,
|
|
383
|
+
code: "too_small",
|
|
384
|
+
minimum: def.minimum,
|
|
385
|
+
inclusive: true,
|
|
386
|
+
input,
|
|
387
|
+
inst,
|
|
388
|
+
continue: !def.abort,
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
});
|
|
392
|
+
exports.$ZodCheckLengthEquals = core.$constructor("$ZodCheckLengthEquals", (inst, def) => {
|
|
393
|
+
var _a;
|
|
394
|
+
exports.$ZodCheck.init(inst, def);
|
|
395
|
+
(_a = inst._zod.def).when ?? (_a.when = (payload) => {
|
|
396
|
+
const val = payload.value;
|
|
397
|
+
return !util.nullish(val) && val.length !== undefined;
|
|
398
|
+
});
|
|
399
|
+
inst._zod.onattach.push((inst) => {
|
|
400
|
+
const bag = inst._zod.bag;
|
|
401
|
+
bag.minimum = def.length;
|
|
402
|
+
bag.maximum = def.length;
|
|
403
|
+
bag.length = def.length;
|
|
404
|
+
});
|
|
405
|
+
inst._zod.check = (payload) => {
|
|
406
|
+
const input = payload.value;
|
|
407
|
+
const length = input.length;
|
|
408
|
+
if (length === def.length)
|
|
409
|
+
return;
|
|
410
|
+
const origin = util.getLengthableOrigin(input);
|
|
411
|
+
const tooBig = length > def.length;
|
|
412
|
+
payload.issues.push({
|
|
413
|
+
origin,
|
|
414
|
+
...(tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length }),
|
|
415
|
+
inclusive: true,
|
|
416
|
+
exact: true,
|
|
417
|
+
input: payload.value,
|
|
418
|
+
inst,
|
|
419
|
+
continue: !def.abort,
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
});
|
|
423
|
+
exports.$ZodCheckStringFormat = core.$constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
424
|
+
var _a, _b;
|
|
425
|
+
exports.$ZodCheck.init(inst, def);
|
|
426
|
+
inst._zod.onattach.push((inst) => {
|
|
427
|
+
const bag = inst._zod.bag;
|
|
428
|
+
bag.format = def.format;
|
|
429
|
+
if (def.pattern) {
|
|
430
|
+
bag.patterns ?? (bag.patterns = new Set());
|
|
431
|
+
bag.patterns.add(def.pattern);
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
if (def.pattern)
|
|
435
|
+
(_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
436
|
+
def.pattern.lastIndex = 0;
|
|
437
|
+
if (def.pattern.test(payload.value))
|
|
438
|
+
return;
|
|
439
|
+
payload.issues.push({
|
|
440
|
+
origin: "string",
|
|
441
|
+
code: "invalid_format",
|
|
442
|
+
format: def.format,
|
|
443
|
+
input: payload.value,
|
|
444
|
+
...(def.pattern ? { pattern: def.pattern.toString() } : {}),
|
|
445
|
+
inst,
|
|
446
|
+
continue: !def.abort,
|
|
447
|
+
});
|
|
448
|
+
});
|
|
449
|
+
else
|
|
450
|
+
(_b = inst._zod).check ?? (_b.check = () => { });
|
|
451
|
+
});
|
|
452
|
+
exports.$ZodCheckRegex = core.$constructor("$ZodCheckRegex", (inst, def) => {
|
|
453
|
+
exports.$ZodCheckStringFormat.init(inst, def);
|
|
454
|
+
inst._zod.check = (payload) => {
|
|
455
|
+
def.pattern.lastIndex = 0;
|
|
456
|
+
if (def.pattern.test(payload.value))
|
|
457
|
+
return;
|
|
458
|
+
payload.issues.push({
|
|
459
|
+
origin: "string",
|
|
460
|
+
code: "invalid_format",
|
|
461
|
+
format: "regex",
|
|
462
|
+
input: payload.value,
|
|
463
|
+
pattern: def.pattern.toString(),
|
|
464
|
+
inst,
|
|
465
|
+
continue: !def.abort,
|
|
466
|
+
});
|
|
467
|
+
};
|
|
468
|
+
});
|
|
469
|
+
exports.$ZodCheckLowerCase = core.$constructor("$ZodCheckLowerCase", (inst, def) => {
|
|
470
|
+
def.pattern ?? (def.pattern = regexes.lowercase);
|
|
471
|
+
exports.$ZodCheckStringFormat.init(inst, def);
|
|
472
|
+
});
|
|
473
|
+
exports.$ZodCheckUpperCase = core.$constructor("$ZodCheckUpperCase", (inst, def) => {
|
|
474
|
+
def.pattern ?? (def.pattern = regexes.uppercase);
|
|
475
|
+
exports.$ZodCheckStringFormat.init(inst, def);
|
|
476
|
+
});
|
|
477
|
+
exports.$ZodCheckIncludes = core.$constructor("$ZodCheckIncludes", (inst, def) => {
|
|
478
|
+
exports.$ZodCheck.init(inst, def);
|
|
479
|
+
const escapedRegex = util.escapeRegex(def.includes);
|
|
480
|
+
const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
|
|
481
|
+
def.pattern = pattern;
|
|
482
|
+
inst._zod.onattach.push((inst) => {
|
|
483
|
+
const bag = inst._zod.bag;
|
|
484
|
+
bag.patterns ?? (bag.patterns = new Set());
|
|
485
|
+
bag.patterns.add(pattern);
|
|
486
|
+
});
|
|
487
|
+
inst._zod.check = (payload) => {
|
|
488
|
+
if (payload.value.includes(def.includes, def.position))
|
|
489
|
+
return;
|
|
490
|
+
payload.issues.push({
|
|
491
|
+
origin: "string",
|
|
492
|
+
code: "invalid_format",
|
|
493
|
+
format: "includes",
|
|
494
|
+
includes: def.includes,
|
|
495
|
+
input: payload.value,
|
|
496
|
+
inst,
|
|
497
|
+
continue: !def.abort,
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
});
|
|
501
|
+
exports.$ZodCheckStartsWith = core.$constructor("$ZodCheckStartsWith", (inst, def) => {
|
|
502
|
+
exports.$ZodCheck.init(inst, def);
|
|
503
|
+
const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);
|
|
504
|
+
def.pattern ?? (def.pattern = pattern);
|
|
505
|
+
inst._zod.onattach.push((inst) => {
|
|
506
|
+
const bag = inst._zod.bag;
|
|
507
|
+
bag.patterns ?? (bag.patterns = new Set());
|
|
508
|
+
bag.patterns.add(pattern);
|
|
509
|
+
});
|
|
510
|
+
inst._zod.check = (payload) => {
|
|
511
|
+
if (payload.value.startsWith(def.prefix))
|
|
512
|
+
return;
|
|
513
|
+
payload.issues.push({
|
|
514
|
+
origin: "string",
|
|
515
|
+
code: "invalid_format",
|
|
516
|
+
format: "starts_with",
|
|
517
|
+
prefix: def.prefix,
|
|
518
|
+
input: payload.value,
|
|
519
|
+
inst,
|
|
520
|
+
continue: !def.abort,
|
|
521
|
+
});
|
|
522
|
+
};
|
|
523
|
+
});
|
|
524
|
+
exports.$ZodCheckEndsWith = core.$constructor("$ZodCheckEndsWith", (inst, def) => {
|
|
525
|
+
exports.$ZodCheck.init(inst, def);
|
|
526
|
+
const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);
|
|
527
|
+
def.pattern ?? (def.pattern = pattern);
|
|
528
|
+
inst._zod.onattach.push((inst) => {
|
|
529
|
+
const bag = inst._zod.bag;
|
|
530
|
+
bag.patterns ?? (bag.patterns = new Set());
|
|
531
|
+
bag.patterns.add(pattern);
|
|
532
|
+
});
|
|
533
|
+
inst._zod.check = (payload) => {
|
|
534
|
+
if (payload.value.endsWith(def.suffix))
|
|
535
|
+
return;
|
|
536
|
+
payload.issues.push({
|
|
537
|
+
origin: "string",
|
|
538
|
+
code: "invalid_format",
|
|
539
|
+
format: "ends_with",
|
|
540
|
+
suffix: def.suffix,
|
|
541
|
+
input: payload.value,
|
|
542
|
+
inst,
|
|
543
|
+
continue: !def.abort,
|
|
544
|
+
});
|
|
545
|
+
};
|
|
546
|
+
});
|
|
547
|
+
///////////////////////////////////
|
|
548
|
+
///// $ZodCheckProperty /////
|
|
549
|
+
///////////////////////////////////
|
|
550
|
+
function handleCheckPropertyResult(result, payload, property) {
|
|
551
|
+
if (result.issues.length) {
|
|
552
|
+
payload.issues.push(...util.prefixIssues(property, result.issues));
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
exports.$ZodCheckProperty = core.$constructor("$ZodCheckProperty", (inst, def) => {
|
|
556
|
+
exports.$ZodCheck.init(inst, def);
|
|
557
|
+
inst._zod.check = (payload) => {
|
|
558
|
+
const result = def.schema._zod.run({
|
|
559
|
+
value: payload.value[def.property],
|
|
560
|
+
issues: [],
|
|
561
|
+
}, {});
|
|
562
|
+
if (result instanceof Promise) {
|
|
563
|
+
return result.then((result) => handleCheckPropertyResult(result, payload, def.property));
|
|
564
|
+
}
|
|
565
|
+
handleCheckPropertyResult(result, payload, def.property);
|
|
566
|
+
return;
|
|
567
|
+
};
|
|
568
|
+
});
|
|
569
|
+
exports.$ZodCheckMimeType = core.$constructor("$ZodCheckMimeType", (inst, def) => {
|
|
570
|
+
exports.$ZodCheck.init(inst, def);
|
|
571
|
+
const mimeSet = new Set(def.mime);
|
|
572
|
+
inst._zod.onattach.push((inst) => {
|
|
573
|
+
inst._zod.bag.mime = def.mime;
|
|
574
|
+
});
|
|
575
|
+
inst._zod.check = (payload) => {
|
|
576
|
+
if (mimeSet.has(payload.value.type))
|
|
577
|
+
return;
|
|
578
|
+
payload.issues.push({
|
|
579
|
+
code: "invalid_value",
|
|
580
|
+
values: def.mime,
|
|
581
|
+
input: payload.value.type,
|
|
582
|
+
inst,
|
|
583
|
+
});
|
|
584
|
+
};
|
|
585
|
+
});
|
|
586
|
+
exports.$ZodCheckOverwrite = core.$constructor("$ZodCheckOverwrite", (inst, def) => {
|
|
587
|
+
exports.$ZodCheck.init(inst, def);
|
|
588
|
+
inst._zod.check = (payload) => {
|
|
589
|
+
payload.value = def.tx(payload.value);
|
|
590
|
+
};
|
|
591
|
+
});
|