@openclaw/firecrawl-plugin 2026.9.4 → 2026.9.6
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/assets/activity.svg +31 -0
- package/assets/icon.png +0 -0
- package/dist/{firecrawl-client-BPFpIblh.js → .setup/firecrawl-client-hBjAoE8s.mjs} +25 -26
- package/dist/{firecrawl-fetch-provider-CIpxLKLq.js → .setup/firecrawl-fetch-provider-DH8FdBjV.mjs} +1 -1
- package/dist/{firecrawl-search-provider-80szkO8A.js → .setup/firecrawl-search-provider-8H0Cu9l0.mjs} +1 -1
- package/dist/api.js +1 -1
- package/dist/index.js +3 -3
- package/dist/web-fetch-contract-api.js +1 -1
- package/dist/web-fetch-provider.js +1 -1
- package/dist/web-search-contract-api.js +1 -1
- package/dist/web-search-provider.js +1 -1
- package/node_modules/typebox/build/compile/validator.d.mts +1 -1
- package/node_modules/typebox/build/compile/validator.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
- package/node_modules/typebox/build/format/iri.mjs +5 -1
- package/node_modules/typebox/build/guard/emit.mjs +2 -4
- package/node_modules/typebox/build/guard/guard.mjs +6 -18
- package/node_modules/typebox/build/guard/string.mjs +16 -24
- package/node_modules/typebox/build/schema/build.mjs +2 -2
- package/node_modules/typebox/build/schema/check.mjs +1 -1
- package/node_modules/typebox/build/schema/compile.d.mts +3 -2
- package/node_modules/typebox/build/schema/compile.mjs +8 -8
- package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +23 -15
- package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/_refine.mjs +4 -7
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +34 -16
- package/node_modules/typebox/build/schema/engine/_stack.mjs +148 -104
- package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -8
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +26 -18
- package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/allOf.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/boolean.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/const.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/contains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +3 -6
- package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +11 -7
- package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/enum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/format.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/if.mjs +7 -15
- package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/items.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxItems.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxLength.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxProperties.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maximum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minContains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/minItems.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minLength.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minProperties.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minimum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/multipleOf.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -8
- package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +6 -11
- package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -7
- package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/properties.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +4 -10
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +11 -7
- package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/ref.mjs +19 -15
- package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/required.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +137 -133
- package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +5 -9
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +5 -9
- package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +2 -6
- package/node_modules/typebox/build/schema/errors.d.mts +2 -2
- package/node_modules/typebox/build/schema/errors.mjs +8 -14
- package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
- package/node_modules/typebox/build/schema/intern/intern.d.mts +11 -0
- package/node_modules/typebox/build/schema/intern/intern.mjs +293 -0
- package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +288 -0
- package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +300 -0
- package/node_modules/typebox/build/schema/meta/draft_3.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_3.mjs +143 -0
- package/node_modules/typebox/build/schema/meta/draft_4.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_4.mjs +149 -0
- package/node_modules/typebox/build/schema/meta/draft_6.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_6.mjs +155 -0
- package/node_modules/typebox/build/schema/meta/draft_7.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_7.mjs +172 -0
- package/node_modules/typebox/build/schema/meta/index.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/index.mjs +2 -0
- package/node_modules/typebox/build/schema/meta/meta.d.mts +9 -0
- package/node_modules/typebox/build/schema/meta/meta.mjs +15 -0
- package/node_modules/typebox/build/schema/meta/schema.d.mts +6 -0
- package/node_modules/typebox/build/schema/meta/schema.mjs +1 -0
- package/node_modules/typebox/build/schema/parse.d.mts +1 -0
- package/node_modules/typebox/build/schema/parse.mjs +10 -5
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +8 -3
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +268 -139
- package/node_modules/typebox/build/schema/schema.d.mts +2 -0
- package/node_modules/typebox/build/schema/schema.mjs +2 -0
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
- package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +59 -89
- package/node_modules/zod/README.md +29 -2
- package/node_modules/zod/compile.cjs +96 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +21 -2
- package/node_modules/zod/index.d.cts +1 -2
- package/node_modules/zod/index.d.ts +1 -2
- package/node_modules/zod/index.js +5 -2
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +20 -8
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +5 -2
- package/node_modules/zod/src/v3/ZodError.ts +22 -12
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
- package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
- package/node_modules/zod/src/v3/types.ts +5 -5
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/compat.ts +26 -18
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +59 -44
- package/node_modules/zod/src/v4/classic/external.ts +14 -9
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +363 -78
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +2 -2
- package/node_modules/zod/src/v4/classic/iso.ts +2 -72
- package/node_modules/zod/src/v4/classic/parse.ts +10 -4
- package/node_modules/zod/src/v4/classic/schemas.ts +640 -375
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +186 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +3 -3
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +261 -13
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +582 -10
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +67 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +85 -9
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +301 -12
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +79 -3
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +222 -6
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +44 -3
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1812 -204
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
- package/node_modules/zod/src/v4/core/api.ts +87 -35
- package/node_modules/zod/src/v4/core/checks.ts +119 -146
- package/node_modules/zod/src/v4/core/compile.ts +2313 -0
- package/node_modules/zod/src/v4/core/core.ts +99 -22
- package/node_modules/zod/src/v4/core/doc.ts +17 -9
- package/node_modules/zod/src/v4/core/errors.ts +113 -25
- package/node_modules/zod/src/v4/core/index.ts +3 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +8 -3
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +424 -156
- package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +164 -50
- package/node_modules/zod/src/v4/core/regexes.ts +42 -15
- package/node_modules/zod/src/v4/core/registries.ts +2 -2
- package/node_modules/zod/src/v4/core/schemas.ts +1000 -538
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +283 -48
- package/node_modules/zod/src/v4/core/util.ts +454 -157
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/index.ts +3 -3
- package/node_modules/zod/src/v4/locales/ar.ts +5 -0
- package/node_modules/zod/src/v4/locales/az.ts +5 -0
- package/node_modules/zod/src/v4/locales/be.ts +12 -0
- package/node_modules/zod/src/v4/locales/bg.ts +5 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +5 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +5 -0
- package/node_modules/zod/src/v4/locales/da.ts +7 -2
- package/node_modules/zod/src/v4/locales/de.ts +5 -0
- package/node_modules/zod/src/v4/locales/el.ts +3 -0
- package/node_modules/zod/src/v4/locales/en.ts +17 -4
- package/node_modules/zod/src/v4/locales/eo.ts +5 -0
- package/node_modules/zod/src/v4/locales/es.ts +4 -0
- package/node_modules/zod/src/v4/locales/fa.ts +5 -0
- package/node_modules/zod/src/v4/locales/fi.ts +5 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +5 -0
- package/node_modules/zod/src/v4/locales/fr.ts +21 -14
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +8 -1
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +4 -0
- package/node_modules/zod/src/v4/locales/hu.ts +5 -0
- package/node_modules/zod/src/v4/locales/hy.ts +11 -0
- package/node_modules/zod/src/v4/locales/id.ts +5 -0
- package/node_modules/zod/src/v4/locales/index.ts +11 -0
- package/node_modules/zod/src/v4/locales/is.ts +5 -0
- package/node_modules/zod/src/v4/locales/it.ts +5 -0
- package/node_modules/zod/src/v4/locales/ja.ts +5 -0
- package/node_modules/zod/src/v4/locales/ka.ts +5 -0
- package/node_modules/zod/src/v4/locales/km.ts +5 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +5 -0
- package/node_modules/zod/src/v4/locales/lt.ts +4 -0
- package/node_modules/zod/src/v4/locales/mk.ts +5 -0
- package/node_modules/zod/src/v4/locales/ms.ts +5 -0
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +5 -0
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +7 -2
- package/node_modules/zod/src/v4/locales/ota.ts +5 -0
- package/node_modules/zod/src/v4/locales/pl.ts +5 -0
- package/node_modules/zod/src/v4/locales/ps.ts +5 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +101 -58
- package/node_modules/zod/src/v4/locales/ro.ts +3 -0
- package/node_modules/zod/src/v4/locales/ru.ts +12 -0
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +5 -0
- package/node_modules/zod/src/v4/locales/sv.ts +7 -2
- package/node_modules/zod/src/v4/locales/ta.ts +5 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +5 -0
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +5 -0
- package/node_modules/zod/src/v4/locales/uk.ts +5 -0
- package/node_modules/zod/src/v4/locales/ur.ts +5 -0
- package/node_modules/zod/src/v4/locales/uz.ts +3 -0
- package/node_modules/zod/src/v4/locales/vi.ts +5 -0
- package/node_modules/zod/src/v4/locales/yo.ts +5 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +5 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +5 -0
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +12 -1
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/parse.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +167 -63
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +158 -5
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +44 -0
- package/node_modules/zod/v3/ZodError.cjs +41 -12
- package/node_modules/zod/v3/ZodError.d.cts +1 -1
- package/node_modules/zod/v3/ZodError.d.ts +1 -1
- package/node_modules/zod/v3/ZodError.js +22 -12
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +26 -5
- package/node_modules/zod/v3/types.js +7 -5
- package/node_modules/zod/v4/classic/checks.cjs +21 -1
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.d.cts +9 -11
- package/node_modules/zod/v4/classic/compat.d.ts +9 -11
- package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +62 -34
- package/node_modules/zod/v4/classic/errors.d.cts +3 -4
- package/node_modules/zod/v4/classic/errors.d.ts +3 -4
- package/node_modules/zod/v4/classic/errors.js +43 -34
- package/node_modules/zod/v4/classic/external.cjs +51 -27
- package/node_modules/zod/v4/classic/external.d.cts +5 -2
- package/node_modules/zod/v4/classic/external.d.ts +5 -2
- package/node_modules/zod/v4/classic/external.js +5 -8
- package/node_modules/zod/v4/classic/from-json-schema.cjs +376 -75
- package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
- package/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +21 -2
- package/node_modules/zod/v4/classic/index.d.cts +1 -2
- package/node_modules/zod/v4/classic/index.d.ts +1 -2
- package/node_modules/zod/v4/classic/index.js +2 -2
- package/node_modules/zod/v4/classic/iso.cjs +30 -22
- package/node_modules/zod/v4/classic/iso.d.cts +2 -17
- package/node_modules/zod/v4/classic/iso.d.ts +2 -17
- package/node_modules/zod/v4/classic/iso.js +2 -17
- package/node_modules/zod/v4/classic/parse.cjs +23 -1
- package/node_modules/zod/v4/classic/parse.d.cts +17 -4
- package/node_modules/zod/v4/classic/parse.d.ts +17 -4
- package/node_modules/zod/v4/classic/parse.js +1 -0
- package/node_modules/zod/v4/classic/schemas.cjs +591 -426
- package/node_modules/zod/v4/classic/schemas.d.cts +68 -19
- package/node_modules/zod/v4/classic/schemas.d.ts +68 -19
- package/node_modules/zod/v4/classic/schemas.js +564 -424
- package/node_modules/zod/v4/core/api.cjs +66 -24
- package/node_modules/zod/v4/core/api.d.cts +22 -12
- package/node_modules/zod/v4/core/api.d.ts +22 -12
- package/node_modules/zod/v4/core/api.js +44 -24
- package/node_modules/zod/v4/core/checks.cjs +88 -128
- package/node_modules/zod/v4/core/checks.d.cts +29 -13
- package/node_modules/zod/v4/core/checks.d.ts +29 -13
- package/node_modules/zod/v4/core/checks.js +68 -127
- package/node_modules/zod/v4/core/compile.cjs +1908 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/zod/v4/core/compile.js +1858 -0
- package/node_modules/zod/v4/core/core.cjs +101 -19
- package/node_modules/zod/v4/core/core.d.cts +16 -4
- package/node_modules/zod/v4/core/core.d.ts +16 -4
- package/node_modules/zod/v4/core/core.js +83 -20
- package/node_modules/zod/v4/core/doc.cjs +31 -9
- package/node_modules/zod/v4/core/doc.d.cts +3 -1
- package/node_modules/zod/v4/core/doc.d.ts +3 -1
- package/node_modules/zod/v4/core/doc.js +12 -9
- package/node_modules/zod/v4/core/errors.cjs +126 -25
- package/node_modules/zod/v4/core/errors.d.cts +4 -0
- package/node_modules/zod/v4/core/errors.d.ts +4 -0
- package/node_modules/zod/v4/core/errors.js +107 -25
- package/node_modules/zod/v4/core/index.cjs +24 -1
- package/node_modules/zod/v4/core/index.d.cts +3 -0
- package/node_modules/zod/v4/core/index.d.ts +3 -0
- package/node_modules/zod/v4/core/index.js +3 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +24 -1
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.js +6 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +441 -156
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +400 -158
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
- package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
- package/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +311 -0
- package/node_modules/zod/v4/core/parse.cjs +148 -46
- package/node_modules/zod/v4/core/parse.d.cts +14 -11
- package/node_modules/zod/v4/core/parse.d.ts +14 -11
- package/node_modules/zod/v4/core/parse.js +127 -45
- package/node_modules/zod/v4/core/regexes.cjs +54 -17
- package/node_modules/zod/v4/core/regexes.d.cts +5 -0
- package/node_modules/zod/v4/core/regexes.d.ts +5 -0
- package/node_modules/zod/v4/core/regexes.js +32 -15
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/registries.js +2 -2
- package/node_modules/zod/v4/core/schemas.cjs +785 -386
- package/node_modules/zod/v4/core/schemas.d.cts +123 -34
- package/node_modules/zod/v4/core/schemas.d.ts +123 -34
- package/node_modules/zod/v4/core/schemas.js +753 -386
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +269 -45
- package/node_modules/zod/v4/core/to-json-schema.d.cts +45 -5
- package/node_modules/zod/v4/core/to-json-schema.d.ts +45 -5
- package/node_modules/zod/v4/core/to-json-schema.js +247 -44
- package/node_modules/zod/v4/core/util.cjs +372 -157
- package/node_modules/zod/v4/core/util.d.cts +79 -1
- package/node_modules/zod/v4/core/util.d.ts +79 -1
- package/node_modules/zod/v4/core/util.js +341 -156
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +214 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +34 -5
- package/node_modules/zod/v4/index.d.cts +2 -2
- package/node_modules/zod/v4/index.d.ts +2 -2
- package/node_modules/zod/v4/index.js +3 -2
- package/node_modules/zod/v4/locales/ar.cjs +5 -0
- package/node_modules/zod/v4/locales/ar.js +5 -0
- package/node_modules/zod/v4/locales/az.cjs +5 -0
- package/node_modules/zod/v4/locales/az.js +5 -0
- package/node_modules/zod/v4/locales/be.cjs +12 -0
- package/node_modules/zod/v4/locales/be.js +12 -0
- package/node_modules/zod/v4/locales/bg.cjs +5 -0
- package/node_modules/zod/v4/locales/bg.js +5 -0
- package/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +113 -0
- package/node_modules/zod/v4/locales/ca.cjs +5 -0
- package/node_modules/zod/v4/locales/ca.js +5 -0
- package/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +133 -0
- package/node_modules/zod/v4/locales/cs.cjs +5 -0
- package/node_modules/zod/v4/locales/cs.js +5 -0
- package/node_modules/zod/v4/locales/da.cjs +7 -2
- package/node_modules/zod/v4/locales/da.js +7 -2
- package/node_modules/zod/v4/locales/de.cjs +5 -0
- package/node_modules/zod/v4/locales/de.js +5 -0
- package/node_modules/zod/v4/locales/el.cjs +3 -0
- package/node_modules/zod/v4/locales/el.js +3 -0
- package/node_modules/zod/v4/locales/en.cjs +16 -4
- package/node_modules/zod/v4/locales/en.js +16 -4
- package/node_modules/zod/v4/locales/eo.cjs +5 -0
- package/node_modules/zod/v4/locales/eo.js +5 -0
- package/node_modules/zod/v4/locales/es.cjs +4 -0
- package/node_modules/zod/v4/locales/es.js +4 -0
- package/node_modules/zod/v4/locales/fa.cjs +5 -0
- package/node_modules/zod/v4/locales/fa.js +5 -0
- package/node_modules/zod/v4/locales/fi.cjs +5 -0
- package/node_modules/zod/v4/locales/fi.js +5 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +5 -0
- package/node_modules/zod/v4/locales/fr-CA.js +5 -0
- package/node_modules/zod/v4/locales/fr.cjs +18 -14
- package/node_modules/zod/v4/locales/fr.js +18 -14
- package/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +113 -0
- package/node_modules/zod/v4/locales/he.cjs +7 -0
- package/node_modules/zod/v4/locales/he.js +7 -0
- package/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +111 -0
- package/node_modules/zod/v4/locales/hr.cjs +4 -0
- package/node_modules/zod/v4/locales/hr.js +4 -0
- package/node_modules/zod/v4/locales/hu.cjs +5 -0
- package/node_modules/zod/v4/locales/hu.js +5 -0
- package/node_modules/zod/v4/locales/hy.cjs +11 -0
- package/node_modules/zod/v4/locales/hy.js +11 -0
- package/node_modules/zod/v4/locales/id.cjs +5 -0
- package/node_modules/zod/v4/locales/id.js +5 -0
- package/node_modules/zod/v4/locales/index.cjs +43 -2
- package/node_modules/zod/v4/locales/index.d.cts +11 -0
- package/node_modules/zod/v4/locales/index.d.ts +11 -0
- package/node_modules/zod/v4/locales/index.js +11 -0
- package/node_modules/zod/v4/locales/is.cjs +5 -0
- package/node_modules/zod/v4/locales/is.js +5 -0
- package/node_modules/zod/v4/locales/it.cjs +5 -0
- package/node_modules/zod/v4/locales/it.js +5 -0
- package/node_modules/zod/v4/locales/ja.cjs +5 -0
- package/node_modules/zod/v4/locales/ja.js +5 -0
- package/node_modules/zod/v4/locales/ka.cjs +5 -0
- package/node_modules/zod/v4/locales/ka.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +5 -0
- package/node_modules/zod/v4/locales/km.js +5 -0
- package/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +116 -0
- package/node_modules/zod/v4/locales/ko.cjs +5 -0
- package/node_modules/zod/v4/locales/ko.js +5 -0
- package/node_modules/zod/v4/locales/lt.cjs +4 -0
- package/node_modules/zod/v4/locales/lt.js +4 -0
- package/node_modules/zod/v4/locales/mk.cjs +5 -0
- package/node_modules/zod/v4/locales/mk.js +5 -0
- package/node_modules/zod/v4/locales/ms.cjs +5 -0
- package/node_modules/zod/v4/locales/ms.js +5 -0
- package/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +111 -0
- package/node_modules/zod/v4/locales/nl.cjs +5 -0
- package/node_modules/zod/v4/locales/nl.js +5 -0
- package/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +113 -0
- package/node_modules/zod/v4/locales/no.cjs +7 -2
- package/node_modules/zod/v4/locales/no.js +7 -2
- package/node_modules/zod/v4/locales/ota.cjs +5 -0
- package/node_modules/zod/v4/locales/ota.js +5 -0
- package/node_modules/zod/v4/locales/pl.cjs +5 -0
- package/node_modules/zod/v4/locales/pl.js +5 -0
- package/node_modules/zod/v4/locales/ps.cjs +5 -0
- package/node_modules/zod/v4/locales/ps.js +5 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/node_modules/zod/v4/locales/pt.cjs +89 -55
- package/node_modules/zod/v4/locales/pt.js +89 -55
- package/node_modules/zod/v4/locales/ro.cjs +3 -0
- package/node_modules/zod/v4/locales/ro.js +3 -0
- package/node_modules/zod/v4/locales/ru.cjs +12 -0
- package/node_modules/zod/v4/locales/ru.js +12 -0
- package/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +116 -0
- package/node_modules/zod/v4/locales/sl.cjs +5 -0
- package/node_modules/zod/v4/locales/sl.js +5 -0
- package/node_modules/zod/v4/locales/sv.cjs +7 -2
- package/node_modules/zod/v4/locales/sv.js +7 -2
- package/node_modules/zod/v4/locales/ta.cjs +5 -0
- package/node_modules/zod/v4/locales/ta.js +5 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +5 -0
- package/node_modules/zod/v4/locales/th.js +5 -0
- package/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +107 -0
- package/node_modules/zod/v4/locales/tr.cjs +5 -0
- package/node_modules/zod/v4/locales/tr.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +5 -0
- package/node_modules/zod/v4/locales/uk.js +5 -0
- package/node_modules/zod/v4/locales/ur.cjs +5 -0
- package/node_modules/zod/v4/locales/ur.js +5 -0
- package/node_modules/zod/v4/locales/uz.cjs +3 -0
- package/node_modules/zod/v4/locales/uz.js +3 -0
- package/node_modules/zod/v4/locales/vi.cjs +5 -0
- package/node_modules/zod/v4/locales/vi.js +5 -0
- package/node_modules/zod/v4/locales/yo.cjs +5 -0
- package/node_modules/zod/v4/locales/yo.js +5 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +5 -0
- package/node_modules/zod/v4/locales/zh-CN.js +5 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +5 -0
- package/node_modules/zod/v4/locales/zh-TW.js +5 -0
- package/node_modules/zod/v4/mini/checks.cjs +21 -1
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +33 -1
- package/node_modules/zod/v4/mini/external.d.cts +5 -2
- package/node_modules/zod/v4/mini/external.d.ts +5 -2
- package/node_modules/zod/v4/mini/external.js +3 -1
- package/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +22 -1
- package/node_modules/zod/v4/mini/parse.d.cts +1 -1
- package/node_modules/zod/v4/mini/parse.d.ts +1 -1
- package/node_modules/zod/v4/mini/parse.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +117 -53
- package/node_modules/zod/v4/mini/schemas.d.cts +49 -14
- package/node_modules/zod/v4/mini/schemas.d.ts +49 -14
- package/node_modules/zod/v4/mini/schemas.js +92 -51
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/openclaw.plugin.json +15 -1
- package/package.json +9 -7
- package/node_modules/zod/src/v4/core/config.ts +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { test } from "vitest";
|
|
1
|
+
import { expectTypeOf, test } from "vitest";
|
|
2
2
|
|
|
3
3
|
import * as z from "zod/mini";
|
|
4
4
|
|
|
@@ -116,6 +116,67 @@ test("assignability", () => {
|
|
|
116
116
|
z.file() satisfies z.core.$ZodFile;
|
|
117
117
|
});
|
|
118
118
|
|
|
119
|
+
test("toZod", () => {
|
|
120
|
+
type Company = {
|
|
121
|
+
id: string;
|
|
122
|
+
name: string;
|
|
123
|
+
webAddress: string | null;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const CompanySchema = z.object({
|
|
127
|
+
id: z.string(),
|
|
128
|
+
name: z.string(),
|
|
129
|
+
webAddress: z.nullable(z.string()),
|
|
130
|
+
});
|
|
131
|
+
const Company = z.toZod<Company>()(CompanySchema);
|
|
132
|
+
|
|
133
|
+
expectTypeOf<z.output<typeof Company>>().toEqualTypeOf<Company>();
|
|
134
|
+
|
|
135
|
+
const CoreCompany = z.core.toZod<Company>()(CompanySchema);
|
|
136
|
+
expectTypeOf<z.output<typeof CoreCompany>>().toEqualTypeOf<Company>();
|
|
137
|
+
|
|
138
|
+
const UtilCompany = z.core.util.toZod<Company>()(CompanySchema);
|
|
139
|
+
expectTypeOf<z.output<typeof UtilCompany>>().toEqualTypeOf<Company>();
|
|
140
|
+
|
|
141
|
+
const Transformed = z.toZod<{ count: number }>()(
|
|
142
|
+
z.object({
|
|
143
|
+
count: z.pipe(
|
|
144
|
+
z.string(),
|
|
145
|
+
z.transform((value) => value.length)
|
|
146
|
+
),
|
|
147
|
+
})
|
|
148
|
+
);
|
|
149
|
+
expectTypeOf<z.input<typeof Transformed>>().toEqualTypeOf<{ count: string }>();
|
|
150
|
+
expectTypeOf<z.output<typeof Transformed>>().toEqualTypeOf<{ count: number }>();
|
|
151
|
+
|
|
152
|
+
z.toZod<Company>()(
|
|
153
|
+
// @ts-expect-error missing optional keys still fail exact output matching
|
|
154
|
+
z.object({
|
|
155
|
+
id: z.string(),
|
|
156
|
+
name: z.string(),
|
|
157
|
+
})
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
z.toZod<Company>()(
|
|
161
|
+
// @ts-expect-error extra keys fail exact output matching
|
|
162
|
+
z.object({
|
|
163
|
+
id: z.string(),
|
|
164
|
+
name: z.string(),
|
|
165
|
+
webAddress: z.nullable(z.string()),
|
|
166
|
+
extra: z.string(),
|
|
167
|
+
})
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
z.toZod<Company>()(
|
|
171
|
+
// @ts-expect-error wrong property output fails matching
|
|
172
|
+
z.object({
|
|
173
|
+
id: z.number(),
|
|
174
|
+
name: z.string(),
|
|
175
|
+
webAddress: z.nullable(z.string()),
|
|
176
|
+
})
|
|
177
|
+
);
|
|
178
|
+
});
|
|
179
|
+
|
|
119
180
|
test("assignability with type narrowing", () => {
|
|
120
181
|
type _RefinedSchema<T extends z.ZodMiniType<object> | z.ZodMiniUnion> = T extends z.ZodMiniUnion
|
|
121
182
|
? RefinedUnionSchema<T> // <-- Type instantiation is excessively deep and possibly infinite.
|
|
@@ -41,6 +41,14 @@ test("z.gte", () => {
|
|
|
41
41
|
expect(z.safeParse(a, 9).success).toEqual(false);
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
+
test("z.gte/z.lte origin on a date schema with a numeric bound", () => {
|
|
45
|
+
const bound = new Date(Date.UTC(2022, 10, 5)).getTime();
|
|
46
|
+
const tooSmall = z.safeParse(z.date().check(z.gte(bound)), new Date(Date.UTC(2022, 10, 4)));
|
|
47
|
+
const tooBig = z.safeParse(z.date().check(z.lte(bound)), new Date(Date.UTC(2022, 10, 6)));
|
|
48
|
+
expect(tooSmall.error!.issues[0]).toMatchObject({ code: "too_small", origin: "date" });
|
|
49
|
+
expect(tooBig.error!.issues[0]).toMatchObject({ code: "too_big", origin: "date" });
|
|
50
|
+
});
|
|
51
|
+
|
|
44
52
|
// min;
|
|
45
53
|
test("z.min", () => {
|
|
46
54
|
const a = z.number().check(z.minimum(10));
|
|
@@ -132,6 +140,12 @@ test("z.overwrite", () => {
|
|
|
132
140
|
// toUpperCase;
|
|
133
141
|
// property
|
|
134
142
|
|
|
143
|
+
test("z.properties", () => {
|
|
144
|
+
const a = z.instanceof(URL).check(...z.properties({ protocol: z.literal("https:"), hostname: z.string() }));
|
|
145
|
+
expect(z.safeParse(a, new URL("https://example.com")).success).toEqual(true);
|
|
146
|
+
expect(z.safeParse(a, new URL("http://example.com")).error!.issues.map((i) => i.path)).toEqual([["protocol"]]);
|
|
147
|
+
});
|
|
148
|
+
|
|
135
149
|
test("abort early", () => {
|
|
136
150
|
const schema = z.string().check(
|
|
137
151
|
z.refine((val) => val.length > 1),
|
|
@@ -103,7 +103,7 @@ test("safe codec operations", () => {
|
|
|
103
103
|
"message": "Invalid ISO datetime",
|
|
104
104
|
"origin": "string",
|
|
105
105
|
"path": [],
|
|
106
|
-
"pattern": "/^(?:(?:\\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
|
|
106
|
+
"pattern": "/^(?:(?:\\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))$/",
|
|
107
107
|
},
|
|
108
108
|
]
|
|
109
109
|
`);
|
|
@@ -246,6 +246,7 @@ test("nested codec with object containing codec property", () => {
|
|
|
246
246
|
`);
|
|
247
247
|
|
|
248
248
|
// Test refinements at all levels
|
|
249
|
+
|
|
249
250
|
// String validation (empty waypoint name)
|
|
250
251
|
const emptyNameResult = z.safeDecode(waypointSchema, {
|
|
251
252
|
name: "",
|
|
@@ -546,3 +547,36 @@ test("invertCodec", () => {
|
|
|
546
547
|
const doubleInverted = z.invertCodec(z.invertCodec(isoDateCodec));
|
|
547
548
|
expect(z.decode(doubleInverted, "2024-01-15T10:30:00.000Z")).toBeInstanceOf(Date);
|
|
548
549
|
});
|
|
550
|
+
|
|
551
|
+
test("z.output carries checks attached to a pipe", () => {
|
|
552
|
+
const c = z
|
|
553
|
+
.codec(z.string(), z.number(), { decode: Number, encode: String })
|
|
554
|
+
.check(z.refine((n) => n > 10, { error: "gt10" }));
|
|
555
|
+
|
|
556
|
+
expect(z.output(c).parse(50)).toBe(50);
|
|
557
|
+
expect(() => z.output(c).parse(5)).toThrow("gt10");
|
|
558
|
+
// The input side drops it: the check constrains a value that side never produces.
|
|
559
|
+
expect(z.input(c).parse("5")).toBe("5");
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
test("z.input resolves past a transform piped into a schema", () => {
|
|
563
|
+
const p = z.pipe(
|
|
564
|
+
z.transform((v: unknown) => String(v)),
|
|
565
|
+
z.string().check(z.minLength(5))
|
|
566
|
+
);
|
|
567
|
+
|
|
568
|
+
expect(z.input(p).parse("abcde")).toBe("abcde");
|
|
569
|
+
expect(() => z.input(p).parse(1)).toThrow();
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
test("a wrapper's stored value survives only on the side it belongs to", () => {
|
|
573
|
+
const c = z.codec(z.string(), z.number(), { decode: Number, encode: String });
|
|
574
|
+
|
|
575
|
+
expect(z.input(z._default(c, 7)).parse(undefined)).toBe(undefined);
|
|
576
|
+
expect(z.output(z._default(c, 7)).parse(undefined)).toBe(7);
|
|
577
|
+
|
|
578
|
+
// A wrapper over a pipe-free schema keeps both its value and its identity.
|
|
579
|
+
const plain = z._default(z.string(), "x");
|
|
580
|
+
expect(z.input(plain)).toBe(plain);
|
|
581
|
+
expect(z.input(plain).parse(undefined)).toBe("x");
|
|
582
|
+
});
|
|
@@ -2,35 +2,29 @@ import { expect, test } from "vitest";
|
|
|
2
2
|
import * as z from "zod/mini";
|
|
3
3
|
import { util as zc } from "zod/v4/core";
|
|
4
4
|
|
|
5
|
+
// checks no longer write metadata into the bag at attach time; the converter folds the checks itself, so the derived values are asserted through it
|
|
6
|
+
|
|
5
7
|
test("min/max", () => {
|
|
6
8
|
const a = z.number().check(z.minimum(5), z.minimum(6), z.minimum(7), z.maximum(10), z.maximum(11), z.maximum(12));
|
|
7
|
-
|
|
8
|
-
expect(a._zod.bag
|
|
9
|
-
expect(a._zod.bag.maximum).toEqual(10);
|
|
9
|
+
expect(z.toJSONSchema(a)).toMatchObject({ minimum: 7, maximum: 10 });
|
|
10
|
+
expect(a._zod.bag).toEqual({});
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
test("multipleOf", () => {
|
|
13
14
|
const b = z.number().check(z.multipleOf(5));
|
|
14
|
-
expect(b
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
test("int64 format", () => {
|
|
18
|
-
const c = z.int64();
|
|
19
|
-
expect(c._zod.bag.format).toEqual("int64");
|
|
20
|
-
expect(c._zod.bag.minimum).toEqual(zc.BIGINT_FORMAT_RANGES.int64[0]);
|
|
21
|
-
expect(c._zod.bag.maximum).toEqual(zc.BIGINT_FORMAT_RANGES.int64[1]);
|
|
15
|
+
expect(z.toJSONSchema(b)).toMatchObject({ multipleOf: 5 });
|
|
22
16
|
});
|
|
23
17
|
|
|
24
18
|
test("int32 format", () => {
|
|
25
19
|
const d = z.int32();
|
|
26
|
-
expect(d
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
expect(z.toJSONSchema(d)).toMatchObject({
|
|
21
|
+
type: "integer",
|
|
22
|
+
minimum: zc.NUMBER_FORMAT_RANGES.int32[0],
|
|
23
|
+
maximum: zc.NUMBER_FORMAT_RANGES.int32[1],
|
|
24
|
+
});
|
|
29
25
|
});
|
|
30
26
|
|
|
31
27
|
test("array size", () => {
|
|
32
28
|
const e = z.array(z.string()).check(z.length(5));
|
|
33
|
-
expect(e
|
|
34
|
-
expect(e._zod.bag.minimum).toEqual(5);
|
|
35
|
-
expect(e._zod.bag.maximum).toEqual(5);
|
|
29
|
+
expect(z.toJSONSchema(e)).toMatchObject({ minItems: 5, maxItems: 5 });
|
|
36
30
|
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { beforeEach, expect, test } from "vitest";
|
|
2
|
+
import * as z from "zod/mini";
|
|
3
|
+
|
|
4
|
+
// the config object lives on globalThis, so only file isolation protects it; pin the unset precondition explicitly
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
delete z.config().memoizer;
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const cyclic = (): any => {
|
|
10
|
+
const input: any = { id: 1 };
|
|
11
|
+
input.self = input;
|
|
12
|
+
return input;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
test("cyclic input needs the memoizer opt-in", () => {
|
|
16
|
+
const Before: any = z.object({
|
|
17
|
+
id: z.number(),
|
|
18
|
+
get self() {
|
|
19
|
+
return Before;
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
expect(() => Before.parse(cyclic())).toThrow(RangeError);
|
|
23
|
+
|
|
24
|
+
z.config({ memoizer: z.memoizer() });
|
|
25
|
+
const After: any = z.object({
|
|
26
|
+
id: z.number(),
|
|
27
|
+
get self() {
|
|
28
|
+
return After;
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const out = After.parse(cyclic());
|
|
32
|
+
expect(out.self).toBe(out);
|
|
33
|
+
expect(out).not.toBe(cyclic());
|
|
34
|
+
// read at construction, so a schema built before the opt-in keeps none
|
|
35
|
+
expect(() => Before.parse(cyclic())).toThrow(RangeError);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test("the opt-in reaches every core container", () => {
|
|
39
|
+
z.config({ memoizer: z.memoizer() });
|
|
40
|
+
const Arr: any = z.array(z.lazy(() => Arr));
|
|
41
|
+
const input: any = [];
|
|
42
|
+
input.push(input);
|
|
43
|
+
const out = Arr.parse(input);
|
|
44
|
+
expect(out[0]).toBe(out);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("rejects a cycle that closes through a transform", () => {
|
|
48
|
+
z.config({ memoizer: z.memoizer() });
|
|
49
|
+
const Inner: any = z.object({
|
|
50
|
+
name: z.string(),
|
|
51
|
+
get self() {
|
|
52
|
+
return Wrapped;
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
const Wrapped: any = z.pipe(
|
|
56
|
+
Inner,
|
|
57
|
+
z.transform((value: any) => ({ wrapped: value }))
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const input: any = { name: "x" };
|
|
61
|
+
input.self = input;
|
|
62
|
+
|
|
63
|
+
expect(() => Wrapped.parse(input)).toThrow(/reference cycle/);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test("leaves a transform that is not on the cycle alone", () => {
|
|
67
|
+
z.config({ memoizer: z.memoizer() });
|
|
68
|
+
const Node: any = z.object({
|
|
69
|
+
n: z.pipe(
|
|
70
|
+
z.number(),
|
|
71
|
+
z.transform((value: number) => value * 2)
|
|
72
|
+
),
|
|
73
|
+
get self() {
|
|
74
|
+
return Node;
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const input: any = { n: 21 };
|
|
79
|
+
input.self = input;
|
|
80
|
+
|
|
81
|
+
const result = Node.parse(input);
|
|
82
|
+
expect(result.n).toBe(42);
|
|
83
|
+
expect(result.self).toBe(result);
|
|
84
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { describe, expect, expectTypeOf, test } from "vitest";
|
|
2
|
+
import * as z from "zod/mini";
|
|
3
|
+
|
|
4
|
+
describe("mini deepPartial", () => {
|
|
5
|
+
test("makes a ZodMiniObject's fields optional recursively", () => {
|
|
6
|
+
const schema = z.object({
|
|
7
|
+
name: z.string(),
|
|
8
|
+
profile: z.object({ bio: z.string(), age: z.number() }),
|
|
9
|
+
});
|
|
10
|
+
const partial = z.deepPartial(schema);
|
|
11
|
+
expectTypeOf(partial).toExtend<z.ZodMiniObject>();
|
|
12
|
+
expect(partial.parse({})).toEqual({});
|
|
13
|
+
expect(partial.parse({ profile: {} })).toEqual({ profile: {} });
|
|
14
|
+
expect(partial.parse({ name: "x", profile: { bio: "b" } })).toEqual({
|
|
15
|
+
name: "x",
|
|
16
|
+
profile: { bio: "b" },
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test("preserves ZodMiniObject structural type (shape accessible)", () => {
|
|
21
|
+
const schema = z.object({ a: z.string(), nested: z.object({ b: z.number() }) });
|
|
22
|
+
const partial = z.deepPartial(schema);
|
|
23
|
+
expectTypeOf(partial.shape.a).toExtend<z.ZodMiniOptional<z.ZodMiniString>>();
|
|
24
|
+
expectTypeOf(partial.shape.nested).toExtend<z.ZodMiniOptional<z.ZodMiniObject>>();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test("tuple elements stay required", () => {
|
|
28
|
+
const schema = z.tuple([z.object({ a: z.string() }), z.string()]);
|
|
29
|
+
const partial = z.deepPartial(schema);
|
|
30
|
+
expect(() => partial.parse([{}])).toThrow();
|
|
31
|
+
expect(partial.parse([{}, "x"])).toEqual([{}, "x"]);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test("ZodMiniCodec preserved through deepPartial", () => {
|
|
35
|
+
const schema = z.codec(z.object({ a: z.string() }), z.object({ a: z.string() }), {
|
|
36
|
+
decode: (v) => v,
|
|
37
|
+
encode: (v) => v,
|
|
38
|
+
});
|
|
39
|
+
const partial = z.deepPartial(schema);
|
|
40
|
+
expectTypeOf(partial).toExtend<z.ZodMiniCodec>();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("recursive getter-based object is typeable", () => {
|
|
44
|
+
const Category = z.object({
|
|
45
|
+
name: z.string(),
|
|
46
|
+
get subcategories() {
|
|
47
|
+
return z.optional(z.array(Category));
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const partial = z.deepPartial(Category);
|
|
51
|
+
expectTypeOf(partial).toExtend<z.ZodMiniObject>();
|
|
52
|
+
expect(partial.parse({ subcategories: [{}] })).toEqual({ subcategories: [{}] });
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -11,12 +11,31 @@ test("no locale by default", () => {
|
|
|
11
11
|
test("error inheritance", () => {
|
|
12
12
|
const e1 = z.string().safeParse(123).error!;
|
|
13
13
|
expect(e1).toBeInstanceOf(z.core.$ZodError);
|
|
14
|
-
|
|
14
|
+
expect(e1).toBeInstanceOf(Error);
|
|
15
15
|
|
|
16
|
+
let e2: unknown;
|
|
16
17
|
try {
|
|
17
18
|
z.string().parse(123);
|
|
18
|
-
} catch (
|
|
19
|
-
|
|
20
|
-
expect(e2).toBeInstanceOf(Error);
|
|
19
|
+
} catch (err) {
|
|
20
|
+
e2 = err;
|
|
21
21
|
}
|
|
22
|
+
expect(e2).toBeInstanceOf(z.core.$ZodRealError);
|
|
23
|
+
expect(e2).toBeInstanceOf(Error);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("a thrown error carries a stack rooted at the parse call site", () => {
|
|
27
|
+
function callSite() {
|
|
28
|
+
z.parse(z.string(), 123);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let thrown: unknown;
|
|
32
|
+
try {
|
|
33
|
+
callSite();
|
|
34
|
+
} catch (err) {
|
|
35
|
+
thrown = err;
|
|
36
|
+
}
|
|
37
|
+
expect(thrown).toBeInstanceOf(Error);
|
|
38
|
+
const stack = (thrown as Error).stack!;
|
|
39
|
+
expect(stack.startsWith("$ZodError: [")).toBe(true);
|
|
40
|
+
expect(stack).toContain("callSite");
|
|
22
41
|
});
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { expect, test } from "vitest";
|
|
2
|
+
import * as z from "zod/mini";
|
|
2
3
|
|
|
3
4
|
test("z.function", () => {
|
|
4
5
|
expect(true).toEqual(true);
|
|
5
6
|
});
|
|
7
|
+
|
|
8
|
+
test("implement exposes the function schema at runtime", () => {
|
|
9
|
+
const schema = z.function({ input: [z.string()], output: z.number() });
|
|
10
|
+
const fn = schema.implement((s) => s.length);
|
|
11
|
+
|
|
12
|
+
expect((fn as any)._zod).toBe(schema._zod);
|
|
13
|
+
expect(fn("asdf")).toBe(4);
|
|
14
|
+
});
|
|
@@ -2,6 +2,62 @@ import { expect, expectTypeOf, test } from "vitest";
|
|
|
2
2
|
import * as z from "zod/mini";
|
|
3
3
|
import type { util } from "zod/v4/core";
|
|
4
4
|
|
|
5
|
+
test("factory checks", () => {
|
|
6
|
+
const string = z.string({ checks: [z.minLength(1), z.maxLength(3)] as const });
|
|
7
|
+
const number = z.number({ checks: [z.minimum(1), z.maximum(3)] as const });
|
|
8
|
+
expectTypeOf<z.output<typeof string>>().toEqualTypeOf<string>();
|
|
9
|
+
expectTypeOf<z.output<typeof number>>().toEqualTypeOf<number>();
|
|
10
|
+
for (const [schema, valid, invalid] of [
|
|
11
|
+
[string, "ab", ""],
|
|
12
|
+
[number, 2, 4],
|
|
13
|
+
] as const) {
|
|
14
|
+
expect(z.validate(schema, valid)).toBe(true);
|
|
15
|
+
expect(z.validate(schema, invalid)).toBe(false);
|
|
16
|
+
expect(schema._zod.parent).toBeUndefined();
|
|
17
|
+
expect(z.validate(z.compile(schema), valid)).toBe(true);
|
|
18
|
+
expect(z.validate(z.compile(schema), invalid)).toBe(false);
|
|
19
|
+
}
|
|
20
|
+
// @ts-expect-error numeric checks cannot validate strings
|
|
21
|
+
z.string({ checks: [z.minimum(1)] });
|
|
22
|
+
// @ts-expect-error length checks cannot validate numbers
|
|
23
|
+
z.number({ checks: [z.minLength(1)] });
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("factory checks snapshot caller arrays", () => {
|
|
27
|
+
for (const factory of [z.string, z.coerce.string]) {
|
|
28
|
+
const checks = [z.minLength(1)];
|
|
29
|
+
const schema = factory({ checks });
|
|
30
|
+
let reads = 0;
|
|
31
|
+
factory({
|
|
32
|
+
get checks() {
|
|
33
|
+
if (++reads > 1) throw new Error("checks read twice");
|
|
34
|
+
return checks;
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
expect(reads).toBe(1);
|
|
38
|
+
checks.push(z.minLength(10));
|
|
39
|
+
expect(z.validate(schema, "long")).toBe(true);
|
|
40
|
+
expect(z.validate(z.compile(schema), "long")).toBe(true);
|
|
41
|
+
expect(z.toJSONSchema(schema).minLength).toBe(1);
|
|
42
|
+
}
|
|
43
|
+
for (const factory of [z.number, z.coerce.number]) {
|
|
44
|
+
const checks = [z.minimum(1)];
|
|
45
|
+
const schema = factory({ checks });
|
|
46
|
+
let reads = 0;
|
|
47
|
+
factory({
|
|
48
|
+
get checks() {
|
|
49
|
+
if (++reads > 1) throw new Error("checks read twice");
|
|
50
|
+
return checks;
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
expect(reads).toBe(1);
|
|
54
|
+
checks.push(z.minimum(10));
|
|
55
|
+
expect(z.validate(schema, 3)).toBe(true);
|
|
56
|
+
expect(z.validate(z.compile(schema), 3)).toBe(true);
|
|
57
|
+
expect(z.toJSONSchema(schema).minimum).toBe(1);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
5
61
|
test("z.boolean", () => {
|
|
6
62
|
const a = z.boolean();
|
|
7
63
|
expect(z.parse(a, true)).toEqual(true);
|
|
@@ -165,6 +221,28 @@ test("z.iso.duration", () => {
|
|
|
165
221
|
expect(z.safeParse(b, d2).success).toEqual(false);
|
|
166
222
|
});
|
|
167
223
|
|
|
224
|
+
test("z.prefault preserves undefined output", async () => {
|
|
225
|
+
const field = z.prefault(z.union([z.string(), z.undefined()]), () => undefined);
|
|
226
|
+
const schema = z.object({ a: field });
|
|
227
|
+
expectTypeOf<z.output<typeof field>>().toEqualTypeOf<string | undefined>();
|
|
228
|
+
expectTypeOf<z.output<typeof schema>>().toEqualTypeOf<{ a: string | undefined }>();
|
|
229
|
+
expect(z.parse(schema, {})).toStrictEqual({ a: undefined });
|
|
230
|
+
expect(z.parse(schema, { a: undefined })).toStrictEqual({ a: undefined });
|
|
231
|
+
expect(z.parse(schema, { a: "value" })).toStrictEqual({ a: "value" });
|
|
232
|
+
expect(z.safeParse(schema, { a: 123 }).success).toBe(false);
|
|
233
|
+
expect(await z.parseAsync(schema, {})).toStrictEqual({ a: undefined });
|
|
234
|
+
expect(z.parse(z.object({ a: z.prefault(z.optional(z.string()), undefined) }), {})).toStrictEqual({ a: undefined });
|
|
235
|
+
const transformed = z.prefault(
|
|
236
|
+
z.pipe(
|
|
237
|
+
z.string(),
|
|
238
|
+
z.transform(() => undefined)
|
|
239
|
+
),
|
|
240
|
+
"fallback"
|
|
241
|
+
);
|
|
242
|
+
expectTypeOf<z.output<typeof transformed>>().toEqualTypeOf<undefined>();
|
|
243
|
+
expect(z.parse(z.object({ a: transformed }), {})).toStrictEqual({ a: undefined });
|
|
244
|
+
});
|
|
245
|
+
|
|
168
246
|
test("z.undefined", () => {
|
|
169
247
|
const a = z.undefined();
|
|
170
248
|
expect(z.parse(a, undefined)).toEqual(undefined);
|
|
@@ -247,9 +325,42 @@ test("z.union([]) / z.xor([]) / z.discriminatedUnion(_, []) construct and reject
|
|
|
247
325
|
}
|
|
248
326
|
});
|
|
249
327
|
|
|
250
|
-
test("z.discriminatedUnion rejects object options missing the discriminator
|
|
251
|
-
|
|
252
|
-
|
|
328
|
+
test("z.discriminatedUnion rejects object options missing the discriminator", () => {
|
|
329
|
+
expect(() => z.discriminatedUnion("type", [z.object({ value: z.string() })])).toThrow(
|
|
330
|
+
/Invalid discriminated union option at index "0"/
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
// An option whose shape cannot be listed without resolving it is left to the lookup map, on the first object parsed.
|
|
334
|
+
const viaPipe = z.discriminatedUnion("type", [
|
|
335
|
+
z.pipe(z.object({ value: z.literal("x") }), z.object({ value: z.literal("x") })),
|
|
336
|
+
]);
|
|
337
|
+
expect(() => z.safeParse(viaPipe, { value: "x" })).toThrow(/Invalid discriminated union option at index "0"/);
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
test("z.discriminatedUnion infers mutually-recursive getter options", () => {
|
|
341
|
+
const variantA = z.object({
|
|
342
|
+
kind: z.literal("a"),
|
|
343
|
+
get child() {
|
|
344
|
+
return z.optional(tree);
|
|
345
|
+
},
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
const variantB = z.object({
|
|
349
|
+
kind: z.literal("b"),
|
|
350
|
+
get sibling() {
|
|
351
|
+
return z.optional(tree);
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
const tree = z.discriminatedUnion("kind", [variantA, variantB]);
|
|
356
|
+
|
|
357
|
+
type _Tree = { kind: "a"; child?: _Tree | undefined } | { kind: "b"; sibling?: _Tree | undefined };
|
|
358
|
+
|
|
359
|
+
expectTypeOf<z.input<typeof tree>>().toEqualTypeOf<_Tree>();
|
|
360
|
+
expectTypeOf<z.input<typeof tree>>().not.toBeAny();
|
|
361
|
+
|
|
362
|
+
expect(z.parse(tree, { kind: "a", child: { kind: "b" } })).toEqual({ kind: "a", child: { kind: "b" } });
|
|
363
|
+
expect(() => z.parse(tree, { kind: "c" })).toThrow();
|
|
253
364
|
});
|
|
254
365
|
|
|
255
366
|
test("z.intersection", () => {
|
|
@@ -344,6 +455,15 @@ test("z.record", () => {
|
|
|
344
455
|
[Enum.B]: "world",
|
|
345
456
|
});
|
|
346
457
|
|
|
458
|
+
const partial = z.partialRecord(z.enum(["__proto__", "b"]), z.string());
|
|
459
|
+
type partial = z.output<typeof partial>;
|
|
460
|
+
expectTypeOf<partial>().toEqualTypeOf<Partial<Record<"__proto__" | "b", string>>>();
|
|
461
|
+
const parsed: any = z.parse(partial, Object.fromEntries([["__proto__", "declared"]]));
|
|
462
|
+
expect(Object.getPrototypeOf(parsed)).toBe(Object.prototype);
|
|
463
|
+
expect(Object.prototype.hasOwnProperty.call(parsed, "__proto__")).toBe(false);
|
|
464
|
+
expect(parsed).toEqual({});
|
|
465
|
+
expect(z.parse(partial, {})).toEqual({});
|
|
466
|
+
|
|
347
467
|
// v3-compat single-arg form: z.record(valueType) defaults keyType to z.string()
|
|
348
468
|
const f = (z.record as any)(z.number());
|
|
349
469
|
expect(f._zod.def.keyType._zod.def.type).toEqual("string");
|
|
@@ -449,6 +569,14 @@ test("z.enum - native", () => {
|
|
|
449
569
|
// expect(a.enum.A).toEqual(NativeEnum.A);
|
|
450
570
|
// expect(a.enum.B).toEqual(NativeEnum.B);
|
|
451
571
|
// expect(a.enum.C).toEqual(NativeEnum.C);
|
|
572
|
+
|
|
573
|
+
enum NumericEnum {
|
|
574
|
+
A = 0,
|
|
575
|
+
B = 1,
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// numeric enums carry reverse-mapping keys; options lists only what parse accepts
|
|
579
|
+
expect(z.enum(NumericEnum).options).toEqual([NumericEnum.A, NumericEnum.B]);
|
|
452
580
|
});
|
|
453
581
|
|
|
454
582
|
test("z.nativeEnum", () => {
|
|
@@ -679,8 +807,7 @@ test("z.custom", () => {
|
|
|
679
807
|
});
|
|
680
808
|
|
|
681
809
|
test("z.check", () => {
|
|
682
|
-
// this is a more flexible version of z.custom that accepts an arbitrary _parse logic
|
|
683
|
-
// the function should return core.$ZodResult
|
|
810
|
+
// this is a more flexible version of z.custom that accepts an arbitrary _parse logic the function should return core.$ZodResult
|
|
684
811
|
const a = z.any().check(
|
|
685
812
|
z.check<string>((ctx) => {
|
|
686
813
|
if (typeof ctx.value === "string") return;
|
|
@@ -871,12 +998,15 @@ test("z.stringbool", () => {
|
|
|
871
998
|
expect(z.parse(b, "n")).toEqual(false);
|
|
872
999
|
expect(z.safeParse(b, "true")).toMatchObject({ success: false });
|
|
873
1000
|
expect(z.safeParse(b, "false")).toMatchObject({ success: false });
|
|
1001
|
+
expect(b._zod.bag.truthy).toEqual(["y"]);
|
|
1002
|
+
expect(b._zod.bag.falsy).toEqual(["n"]);
|
|
874
1003
|
|
|
875
1004
|
const c = z.stringbool({
|
|
876
1005
|
case: "sensitive",
|
|
877
1006
|
});
|
|
878
1007
|
expect(z.parse(c, "true")).toEqual(true);
|
|
879
1008
|
expect(z.safeParse(c, "TRUE")).toMatchObject({ success: false });
|
|
1009
|
+
expect(c._zod.bag.case).toEqual("sensitive");
|
|
880
1010
|
});
|
|
881
1011
|
|
|
882
1012
|
// promise
|
|
@@ -991,3 +1121,26 @@ test("type narrowing works with type property", () => {
|
|
|
991
1121
|
expect(arraySchema.def.element).toBeDefined();
|
|
992
1122
|
}
|
|
993
1123
|
});
|
|
1124
|
+
|
|
1125
|
+
test("getDiscriminatedOption", () => {
|
|
1126
|
+
const a = z.object({ type: z.literal("a"), x: z.string() });
|
|
1127
|
+
const b = z.object({ type: z.literal("b"), y: z.number() });
|
|
1128
|
+
const schema = z.discriminatedUnion("type", [a, b]);
|
|
1129
|
+
|
|
1130
|
+
expect(z.getDiscriminatedOption(schema, "a")).toBe(a);
|
|
1131
|
+
expect(z.getDiscriminatedOption(schema, "b")).toBe(b);
|
|
1132
|
+
expectTypeOf(z.getDiscriminatedOption(schema, "a")).toEqualTypeOf<typeof a>();
|
|
1133
|
+
});
|
|
1134
|
+
|
|
1135
|
+
test("z.partial on a tuple", () => {
|
|
1136
|
+
const schema = z.partial(z.tuple([z.string(), z.number()]));
|
|
1137
|
+
expectTypeOf<z.infer<typeof schema>>().toEqualTypeOf<[(string | undefined)?, (number | undefined)?]>();
|
|
1138
|
+
|
|
1139
|
+
expect(z.safeParse(schema, []).success).toEqual(true);
|
|
1140
|
+
expect(z.safeParse(schema, ["a"]).success).toEqual(true);
|
|
1141
|
+
expect(z.safeParse(schema, ["a", 1]).success).toEqual(true);
|
|
1142
|
+
expect(z.safeParse(schema, ["a", "b"]).success).toEqual(false);
|
|
1143
|
+
|
|
1144
|
+
const refined = z.tuple([z.string(), z.number()]).check(z.refine(([a]) => a.length > 0));
|
|
1145
|
+
expect(() => z.partial(refined)).toThrow("cannot be used on tuple schemas containing refinements");
|
|
1146
|
+
});
|
|
@@ -93,3 +93,17 @@ test("z.uint64", () => {
|
|
|
93
93
|
// expect(() => z.parse(a, BigInt("18446744073709551616"))).toThrow(); // Exceeds max
|
|
94
94
|
// expect(() => z.parse(a, BigInt("-1"))).toThrow(); // Below min
|
|
95
95
|
});
|
|
96
|
+
|
|
97
|
+
test("number and bigint formats are distinct at the type level", () => {
|
|
98
|
+
expectTypeOf(z.int()._zod.def.format).toEqualTypeOf<"safeint">();
|
|
99
|
+
expectTypeOf(z.uint32()._zod.def.format).toEqualTypeOf<"uint32">();
|
|
100
|
+
expectTypeOf(z.int64()._zod.def.format).toEqualTypeOf<"int64">();
|
|
101
|
+
|
|
102
|
+
z.int32() satisfies z.ZodMiniInt32;
|
|
103
|
+
z.uint64() satisfies z.ZodMiniUInt64;
|
|
104
|
+
|
|
105
|
+
// @ts-expect-error a float64 schema is not a ZodMiniFloat32
|
|
106
|
+
z.float64() satisfies z.ZodMiniFloat32;
|
|
107
|
+
// @ts-expect-error a uint64 schema is not a ZodMiniInt64
|
|
108
|
+
z.uint64() satisfies z.ZodMiniInt64;
|
|
109
|
+
});
|