@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
|
@@ -338,6 +338,66 @@ describe("superRefine functionality", () => {
|
|
|
338
338
|
}
|
|
339
339
|
});
|
|
340
340
|
|
|
341
|
+
test("should preserve explicit nullish issue input", () => {
|
|
342
|
+
const schema = z.string().superRefine((_, ctx) => {
|
|
343
|
+
ctx.addIssue({ code: "custom", message: "default" });
|
|
344
|
+
ctx.addIssue({ code: "custom", message: "null", input: null });
|
|
345
|
+
ctx.addIssue({ code: "custom", message: "undefined", input: undefined });
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
const result = schema.safeParse("sensitive", { reportInput: true });
|
|
349
|
+
expect(result.success).toEqual(false);
|
|
350
|
+
if (!result.success) {
|
|
351
|
+
expect(result.error.issues).toHaveLength(3);
|
|
352
|
+
expect(result.error.issues[0].input).toEqual("sensitive");
|
|
353
|
+
expect(result.error.issues[1].input).toEqual(null);
|
|
354
|
+
expect(result.error.issues[2]).toHaveProperty("input");
|
|
355
|
+
expect(result.error.issues[2].input).toEqual(undefined);
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
test("should keep issue input aligned with the issue path", () => {
|
|
360
|
+
const nested = z.object({ a: z.string().nullable() }).superRefine((val, ctx) => {
|
|
361
|
+
if (val.a === null) ctx.addIssue({ code: "custom", path: ["a"], input: val.a, message: "no null" });
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
const direct = nested.safeParse({ a: null }, { reportInput: true });
|
|
365
|
+
expect(direct.success).toEqual(false);
|
|
366
|
+
if (!direct.success) {
|
|
367
|
+
expect(direct.error.issues[0].path).toEqual(["a"]);
|
|
368
|
+
expect(direct.error.issues[0].input).toEqual(null);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// Forwarding a nested parse's issues must not overwrite their input with the outer payload.
|
|
372
|
+
const inner = z.object({ x: z.string() });
|
|
373
|
+
const forwarding = z.unknown().superRefine((val, ctx) => {
|
|
374
|
+
const result = inner.safeParse(val, { reportInput: true });
|
|
375
|
+
if (!result.success) {
|
|
376
|
+
for (const iss of result.error.issues) {
|
|
377
|
+
ctx.addIssue({ code: "custom", path: iss.path, input: iss.input, message: iss.message });
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
const forwarded = forwarding.safeParse({}, { reportInput: true });
|
|
383
|
+
expect(forwarded.success).toEqual(false);
|
|
384
|
+
if (!forwarded.success) {
|
|
385
|
+
expect(forwarded.error.issues[0].path).toEqual(["x"]);
|
|
386
|
+
expect(forwarded.error.issues[0]).toHaveProperty("input");
|
|
387
|
+
expect(forwarded.error.issues[0].input).toEqual(undefined);
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
test("should surface an explicit undefined input to the error map", () => {
|
|
392
|
+
const schema = z.object({ a: z.string().optional() }).superRefine((val, ctx) => {
|
|
393
|
+
if (!val.a) ctx.addIssue({ code: "custom", path: ["a"], input: val.a });
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
const result = schema.safeParse({}, { error: (iss) => (iss.input === undefined ? "Required" : "Invalid") });
|
|
397
|
+
expect(result.success).toEqual(false);
|
|
398
|
+
if (!result.success) expect(result.error.issues[0].message).toEqual("Required");
|
|
399
|
+
});
|
|
400
|
+
|
|
341
401
|
test("should respect fatal flag in superRefine", () => {
|
|
342
402
|
const schema = z
|
|
343
403
|
.string()
|
|
@@ -85,6 +85,15 @@ test("failing when set is bigger than max() ", () => {
|
|
|
85
85
|
expect(result.error!.issues[0].code).toEqual("too_big");
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
+
test("failing when set does not match size() ", () => {
|
|
89
|
+
expect(justTwo.safeParse(new Set(["one"])).error!.issues[0].message).toEqual(
|
|
90
|
+
"Too small: expected set to have exactly 2 items"
|
|
91
|
+
);
|
|
92
|
+
expect(justTwo.safeParse(new Set(["one", "two", "three"])).error!.issues[0].message).toEqual(
|
|
93
|
+
"Too big: expected set to have exactly 2 items"
|
|
94
|
+
);
|
|
95
|
+
});
|
|
96
|
+
|
|
88
97
|
test("doesn’t throw when an empty set is given", () => {
|
|
89
98
|
const result = stringSet.safeParse(new Set([]));
|
|
90
99
|
expect(result.success).toEqual(true);
|
|
@@ -132,3 +132,22 @@ test("z.toJSONSchema() returns StandardJSONSchemaV1", async () => {
|
|
|
132
132
|
}
|
|
133
133
|
`);
|
|
134
134
|
});
|
|
135
|
+
|
|
136
|
+
test("a failing validate reports the same issues as safeParse, without a ZodError", async () => {
|
|
137
|
+
const schema = z.object({ name: z.string().min(3), age: z.number().refine(async (n) => n > 0) });
|
|
138
|
+
const input = { name: "ab", age: -1 };
|
|
139
|
+
const result = (await schema["~standard"].validate(input)) as { issues: unknown[] };
|
|
140
|
+
expect(result.issues).toEqual((await schema.safeParseAsync(input)).error!.issues);
|
|
141
|
+
expect(result).not.toHaveProperty("error");
|
|
142
|
+
const sync = z.string().min(3)["~standard"].validate("ab") as { issues: unknown[] };
|
|
143
|
+
expect(sync.issues).toEqual(z.string().min(3).safeParse("ab").error!.issues);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
test("a synchronously throwing check rejects through ~standard instead of throwing", async () => {
|
|
147
|
+
const schema = z.string().refine(() => {
|
|
148
|
+
throw new Error("boom");
|
|
149
|
+
});
|
|
150
|
+
const result = schema["~standard"].validate("abc");
|
|
151
|
+
expect(result).toBeInstanceOf(Promise);
|
|
152
|
+
await expect(result as Promise<unknown>).rejects.toThrow("boom");
|
|
153
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomBytes } from "node:crypto";
|
|
2
|
-
import { expect, test } from "vitest";
|
|
2
|
+
import { expect, expectTypeOf, test } from "vitest";
|
|
3
3
|
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
5
|
|
|
@@ -12,6 +12,63 @@ const includesFromIndex2 = z.string().includes("includes", { position: 2 });
|
|
|
12
12
|
const startsWith = z.string().startsWith("startsWith");
|
|
13
13
|
const endsWith = z.string().endsWith("endsWith");
|
|
14
14
|
|
|
15
|
+
test("string factory checks", async () => {
|
|
16
|
+
const schema = z.string({ checks: [z.minLength(1), z.maxLength(3)] as const });
|
|
17
|
+
const chained = z.string().min(1).max(3);
|
|
18
|
+
expectTypeOf<z.output<typeof schema>>().toEqualTypeOf<string>();
|
|
19
|
+
for (const value of ["", "ab", "abcd", 1, undefined]) {
|
|
20
|
+
expect(z.validate(schema, value)).toBe(z.validate(chained, value));
|
|
21
|
+
expect(schema.safeParse(value)).toEqual(chained.safeParse(value));
|
|
22
|
+
}
|
|
23
|
+
expect(z.toJSONSchema(schema)).toEqual(z.toJSONSchema(chained));
|
|
24
|
+
expect(schema.minLength).toBe(1);
|
|
25
|
+
expect(schema.maxLength).toBe(3);
|
|
26
|
+
expect(schema._zod.parent).toBeUndefined();
|
|
27
|
+
expect([...schema._zod.traits]).toEqual([...chained._zod.traits]);
|
|
28
|
+
const extended = schema.max(2);
|
|
29
|
+
expect(extended._zod.parent).toBe(schema);
|
|
30
|
+
expect(z.validate(schema, "abc")).toBe(true);
|
|
31
|
+
expect(z.validate(extended, "abc")).toBe(false);
|
|
32
|
+
const coerce = z.coerce.string({ checks: [z.minLength(2)] });
|
|
33
|
+
expect(coerce.parse(12)).toBe("12");
|
|
34
|
+
expect(z.validate(coerce, 1)).toBe(false);
|
|
35
|
+
const asyncSchema = z.string({
|
|
36
|
+
checks: [
|
|
37
|
+
z.check<string>(async (ctx) => {
|
|
38
|
+
if (ctx.value !== "ok") ctx.issues.push({ code: "custom", input: ctx.value });
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
expect(await asyncSchema.safeParseAsync("ok")).toEqual({ success: true, data: "ok" });
|
|
43
|
+
expect((await asyncSchema.safeParseAsync("bad")).success).toBe(false);
|
|
44
|
+
// @ts-expect-error numeric checks cannot validate strings
|
|
45
|
+
z.string({ checks: [z.gte(1)] });
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test("factory checks snapshot caller arrays", () => {
|
|
49
|
+
for (const factory of [z.string, z.coerce.string]) {
|
|
50
|
+
for (const initial of [[], [z.minLength(1)]]) {
|
|
51
|
+
const schema = factory({ checks: initial });
|
|
52
|
+
let reads = 0;
|
|
53
|
+
const getterSchema = factory({
|
|
54
|
+
get checks() {
|
|
55
|
+
if (++reads > 1) throw new Error("checks read twice");
|
|
56
|
+
return initial;
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
expect(reads).toBe(1);
|
|
60
|
+
expect(z.validate(getterSchema, "long")).toBe(true);
|
|
61
|
+
const before = z.toJSONSchema(schema);
|
|
62
|
+
initial.push(z.minLength(10));
|
|
63
|
+
expect(schema._zod.def.checks).not.toBe(initial);
|
|
64
|
+
expect(z.validate(schema, "long")).toBe(true);
|
|
65
|
+
expect(z.validate(z.compile(schema), "long")).toBe(true);
|
|
66
|
+
expect(z.toJSONSchema(schema)).toEqual(before);
|
|
67
|
+
expect(z.validate(schema.check(z.minLength(2)), "long")).toBe(true);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
15
72
|
test("length checks", () => {
|
|
16
73
|
minFive.parse("12345");
|
|
17
74
|
minFive.parse("123456");
|
|
@@ -217,9 +274,7 @@ test("base64 validations", () => {
|
|
|
217
274
|
"?QmFzZTY0IGVuY29kaW5nIGlzIGZ1bg==", // Invalid character '?'
|
|
218
275
|
".MTIzND2Nzg5MC4=", // Invalid character '.'
|
|
219
276
|
"QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVo", // Missing padding
|
|
220
|
-
// Whitespace is not part of canonical base64 (RFC 4648 §3.3) — atob() strips
|
|
221
|
-
// whitespace internally before validating, so the length check alone would
|
|
222
|
-
// accept "123 " etc.
|
|
277
|
+
// Whitespace is not part of canonical base64 (RFC 4648 §3.3) — atob() strips whitespace internally before validating, so the length check alone would accept "123 " etc.
|
|
223
278
|
"123 ", // bypasses length-mod-4 via trailing whitespace
|
|
224
279
|
"SGVsbG8gV29ybGQ= ", // trailing space
|
|
225
280
|
" SGVsbG8gV29ybGQ=", // leading space
|
|
@@ -266,6 +321,7 @@ test("base64url validations", () => {
|
|
|
266
321
|
|
|
267
322
|
const invalidBase64URLStrings = [
|
|
268
323
|
"w7/Dv8O+w74K", // Has + and / characters (is base64)
|
|
324
|
+
"A", // Invalid length (1 mod 4 carries no whole byte)
|
|
269
325
|
"12345", // Invalid length (not a multiple of 4 characters when adding allowed number of padding characters)
|
|
270
326
|
"12345===", // Not padded correctly
|
|
271
327
|
"!UGF0aWVuY2UgaXMgdGhlIGtleSB0byBzdWNjZXNz", // Invalid character '!'
|
|
@@ -293,6 +349,18 @@ test("big base64 and base64url", () => {
|
|
|
293
349
|
z.base64().parse(bigbase64);
|
|
294
350
|
const bigbase64url = randomBytes(1024 * 1024 * 10).toString("base64url");
|
|
295
351
|
z.base64url().parse(bigbase64url);
|
|
352
|
+
|
|
353
|
+
// template literals compose def.pattern and test it on every parse; the quantified block forms overflowed the regex stack here
|
|
354
|
+
expect(z.templateLiteral(["id-", z.base64()]).safeParse(`id-${bigbase64}`).success).toBe(true);
|
|
355
|
+
expect(z.templateLiteral(["id-", z.base64url()]).safeParse(`id-${bigbase64url}`).success).toBe(true);
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
test("template literal composes base64 without alternation leaks", () => {
|
|
359
|
+
// the ^$| alternation in regexes.base64 used to leak: "AAAA" matched with the prefix dropped and "id-AAAA" was rejected
|
|
360
|
+
const tl = z.templateLiteral(["id-", z.base64()]);
|
|
361
|
+
expect(tl.safeParse("id-AAAA").success).toBe(true);
|
|
362
|
+
expect(tl.safeParse("id-").success).toBe(true);
|
|
363
|
+
expect(tl.safeParse("AAAA").success).toBe(false);
|
|
296
364
|
});
|
|
297
365
|
|
|
298
366
|
function makeJwt(header: object, payload: object) {
|
|
@@ -386,6 +454,44 @@ test("url trims whitespace", () => {
|
|
|
386
454
|
expect(url.parse("https://example.com/path")).toBe("https://example.com/path");
|
|
387
455
|
});
|
|
388
456
|
|
|
457
|
+
test("url returns the string the parser validated", () => {
|
|
458
|
+
// The URL parser deletes ASCII tab, LF and CR instead of failing, so `new URL()` reports on a string that is not the one it was given. The host is the consequential case: this validated example.com and used to hand back a URL naming a different host.
|
|
459
|
+
expect(z.url().parse("https://exa\nmple.com")).toBe("https://example.com");
|
|
460
|
+
expect(z.url().parse("https://exa\tmple.com")).toBe("https://example.com");
|
|
461
|
+
expect(z.url().parse("https://exa\rmple.com")).toBe("https://example.com");
|
|
462
|
+
expect(z.httpUrl().parse("https://exa\nmple.com")).toBe("https://example.com");
|
|
463
|
+
expect(z.url({ hostname: /^a\.com$/ }).parse("https://a\n.com")).toBe("https://a.com");
|
|
464
|
+
expect(z.url().parse("https://example.com/a\nb?c=\td#e")).toBe("https://example.com/ab?c=d#e");
|
|
465
|
+
|
|
466
|
+
// Nothing that parsed before stops parsing, and normalize still wins where it applies.
|
|
467
|
+
expect(z.url().parse("https://example.com/path")).toBe("https://example.com/path");
|
|
468
|
+
expect(z.url({ normalize: true }).parse("https://exa\nmple.com")).toBe("https://example.com/");
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
test("ipv6 and cidrv6 reject anything outside the address alphabet", () => {
|
|
472
|
+
// `new URL("http://[...]")` parses an authority rather than an address, so a delimiter re-splits it and the parser validates something else entirely.
|
|
473
|
+
expect(z.ipv6().safeParse("::@1\\").success).toBe(false); // used to validate against the host 0.0.0.1
|
|
474
|
+
expect(z.ipv6().safeParse("::]/1").success).toBe(false);
|
|
475
|
+
expect(z.ipv6().safeParse("@[::1").success).toBe(false);
|
|
476
|
+
expect(z.cidrv6().safeParse("::@1\\/64").success).toBe(false);
|
|
477
|
+
|
|
478
|
+
for (const c of ["\t", "\n", "\r"]) {
|
|
479
|
+
expect(z.ipv6().safeParse(`2001:db8::${c}1`).success).toBe(false);
|
|
480
|
+
expect(z.ipv6().safeParse(`::1${c}`).success).toBe(false);
|
|
481
|
+
expect(z.cidrv6().safeParse(`::1${c}/64`).success).toBe(false);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// A rejection has to surface as an issue, not just success: false.
|
|
485
|
+
const result = z.ipv6().safeParse("::1\n");
|
|
486
|
+
expect(result.success).toBe(false);
|
|
487
|
+
expect(result.error!.issues[0]).toMatchObject({ code: "invalid_format", format: "ipv6" });
|
|
488
|
+
|
|
489
|
+
expect(z.ipv6().parse("2001:db8::1")).toBe("2001:db8::1");
|
|
490
|
+
expect(z.ipv6().parse("::ffff:192.0.2.1")).toBe("::ffff:192.0.2.1");
|
|
491
|
+
expect(z.ipv6().parse("2001:DB8::1")).toBe("2001:DB8::1");
|
|
492
|
+
expect(z.cidrv6().parse("::ffff:192.0.2.1/96")).toBe("::ffff:192.0.2.1/96");
|
|
493
|
+
});
|
|
494
|
+
|
|
389
495
|
test("url normalize flag", () => {
|
|
390
496
|
const normalizeUrl = z.url({ normalize: true });
|
|
391
497
|
const preserveUrl = z.url(); // normalize: false/undefined by default
|
|
@@ -430,7 +536,7 @@ test("httpurl", () => {
|
|
|
430
536
|
const httpUrl = z.url({
|
|
431
537
|
protocol: /^https?$/,
|
|
432
538
|
hostname: z.regexes.domain,
|
|
433
|
-
// /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/
|
|
539
|
+
// /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/
|
|
434
540
|
});
|
|
435
541
|
|
|
436
542
|
httpUrl.parse("https://example.com");
|
|
@@ -464,6 +570,16 @@ test("httpurl", () => {
|
|
|
464
570
|
).toThrow();
|
|
465
571
|
expect(() => httpUrl.parse("http://asdf.c")).toThrow();
|
|
466
572
|
expect(() => httpUrl.parse("mailto:asdf@lckj.com")).toThrow();
|
|
573
|
+
// total host length over the RFC 1035 limit of 253 chars (built from valid-length labels)
|
|
574
|
+
const longHost = `${`${"a".repeat(50)}.`.repeat(5)}com`; // 5 * 51 + 3 = 258 chars
|
|
575
|
+
expect(longHost.length).toBeGreaterThan(253);
|
|
576
|
+
expect(() => httpUrl.parse(`http://${longHost}`)).toThrow();
|
|
577
|
+
// TLD over the 63-char label limit
|
|
578
|
+
expect(() => httpUrl.parse(`http://example.${"a".repeat(64)}`)).toThrow();
|
|
579
|
+
// a host at exactly the 253-char limit is still accepted, one char more is not
|
|
580
|
+
const maxHost = `${`${"a".repeat(61)}.`.repeat(4)}aaaaa`; // 4 * 62 + 5 = 253 chars
|
|
581
|
+
httpUrl.parse(`http://${maxHost}`);
|
|
582
|
+
expect(() => httpUrl.parse(`http://${maxHost}a`)).toThrow();
|
|
467
583
|
// missing // after protocol
|
|
468
584
|
expect(() => httpUrl.parse("http:example.com")).toThrow();
|
|
469
585
|
expect(() => httpUrl.parse("https:example.com")).toThrow();
|
|
@@ -493,6 +609,7 @@ test("url error overrides", () => {
|
|
|
493
609
|
test("emoji validations", () => {
|
|
494
610
|
const emoji = z.string().emoji();
|
|
495
611
|
|
|
612
|
+
emoji.parse("🦰🦱🦲🦳"); // both Extended_Pictographic and Emoji_Component
|
|
496
613
|
emoji.parse("👋👋👋👋");
|
|
497
614
|
emoji.parse("🍺👩🚀🫡");
|
|
498
615
|
emoji.parse("💚💙💜💛❤️");
|
|
@@ -505,6 +622,18 @@ test("emoji validations", () => {
|
|
|
505
622
|
expect(() => emoji.parse("😀 is an emoji")).toThrow();
|
|
506
623
|
expect(() => emoji.parse("😀stuff")).toThrow();
|
|
507
624
|
expect(() => emoji.parse("stuff😀")).toThrow();
|
|
625
|
+
|
|
626
|
+
emoji.parse("1\u{FE0F}\u{20E3}"); // keycap sequences stay valid
|
|
627
|
+
emoji.parse("#\u{FE0F}\u{20E3}");
|
|
628
|
+
|
|
629
|
+
// `\p{Emoji_Component}` alone covers ASCII digits, "#", "*", ZWJ, variation selectors and skin tone modifiers; none is an emoji without a base, so a component-only string is not one either
|
|
630
|
+
expect(() => emoji.parse("123")).toThrow();
|
|
631
|
+
expect(() => emoji.parse("#")).toThrow();
|
|
632
|
+
expect(() => emoji.parse("*")).toThrow();
|
|
633
|
+
expect(() => emoji.parse("\u{200D}")).toThrow();
|
|
634
|
+
expect(() => emoji.parse("\u{FE0F}")).toThrow();
|
|
635
|
+
expect(() => emoji.parse("\u{1F3FD}")).toThrow();
|
|
636
|
+
expect(() => emoji.parse("1\u{FE0F}")).toThrow();
|
|
508
637
|
});
|
|
509
638
|
|
|
510
639
|
test("nanoid", () => {
|
|
@@ -614,6 +743,26 @@ test("bad guid", () => {
|
|
|
614
743
|
}
|
|
615
744
|
});
|
|
616
745
|
|
|
746
|
+
test("nanoid custom length", () => {
|
|
747
|
+
const nanoid64 = z.nanoid({ length: 64 });
|
|
748
|
+
nanoid64.parse("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_");
|
|
749
|
+
expect(nanoid64.safeParse("lfNZluvAxMkf7Q8C5H-QS")).toMatchObject({ success: false });
|
|
750
|
+
|
|
751
|
+
// the deprecated method and the default length both still work
|
|
752
|
+
expect(z.string().nanoid({ length: 10 }).safeParse("IRFa-VaY2b")).toMatchObject({ success: true });
|
|
753
|
+
expect(z.nanoid().safeParse("lfNZluvAxMkf7Q8C5H-QS")).toMatchObject({ success: true });
|
|
754
|
+
|
|
755
|
+
expect(z.nanoid({ length: 64, error: "custom error" }).safeParse("abc").error!.issues[0].message).toEqual(
|
|
756
|
+
"custom error"
|
|
757
|
+
);
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
test("nanoid rejects a length that is not a positive integer", () => {
|
|
761
|
+
expect(() => z.nanoid({ length: 0 })).toThrow("Invalid nanoid length: 0");
|
|
762
|
+
expect(() => z.nanoid({ length: -1 })).toThrow("Invalid nanoid length: -1");
|
|
763
|
+
expect(() => z.nanoid({ length: 1.5 })).toThrow("Invalid nanoid length: 1.5");
|
|
764
|
+
});
|
|
765
|
+
|
|
617
766
|
test("cuid", () => {
|
|
618
767
|
const cuid = z.string().cuid();
|
|
619
768
|
cuid.parse("ckopqwooh000001la8mbi2im9");
|
|
@@ -683,6 +832,12 @@ test("ulid", () => {
|
|
|
683
832
|
const caseInsensitive = ulid.safeParse("01arZ3nDeKTsV4RRffQ69G5FAV");
|
|
684
833
|
expect(caseInsensitive.success).toEqual(true);
|
|
685
834
|
|
|
835
|
+
// first char is capped at 7: the spec's largest ULID is 7ZZZZZZZZZZZZZZZZZZZZZZZZZ, so 8-9 and every letter overflow 2^48-1
|
|
836
|
+
expect(ulid.safeParse("7ZZZZZZZZZZZZZZZZZZZZZZZZZ").success).toEqual(true);
|
|
837
|
+
for (const first of ["8", "9", "A", "Z", "z"]) {
|
|
838
|
+
expect(ulid.safeParse(`${first}AAAAAAAAAAAAAAAAAAAAAAAAA`).success).toEqual(false);
|
|
839
|
+
}
|
|
840
|
+
|
|
686
841
|
expect(result.error!.issues[0].message).toEqual("Invalid ULID");
|
|
687
842
|
expect(result.error).toMatchInlineSnapshot(`
|
|
688
843
|
[ZodError: [
|
|
@@ -690,7 +845,7 @@ test("ulid", () => {
|
|
|
690
845
|
"origin": "string",
|
|
691
846
|
"code": "invalid_format",
|
|
692
847
|
"format": "ulid",
|
|
693
|
-
"pattern": "/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{
|
|
848
|
+
"pattern": "/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/",
|
|
694
849
|
"path": [],
|
|
695
850
|
"message": "Invalid ULID"
|
|
696
851
|
}
|
|
@@ -860,6 +1015,47 @@ test("boundary cases with zero length", () => {
|
|
|
860
1015
|
expect(() => maxZero.parse("hello")).toThrow();
|
|
861
1016
|
});
|
|
862
1017
|
|
|
1018
|
+
test("length checks count Unicode code points, not UTF-16 code units", () => {
|
|
1019
|
+
// "\u{1F600}" is one code point but two UTF-16 code units
|
|
1020
|
+
const five = "\u{1F600}\u{1F600}\u{1F600}\u{1F600}\u{1F600}";
|
|
1021
|
+
expect(z.string().max(5).safeParse(five).success).toBe(true);
|
|
1022
|
+
expect(
|
|
1023
|
+
z
|
|
1024
|
+
.string()
|
|
1025
|
+
.max(5)
|
|
1026
|
+
.safeParse(five + "\u{1F600}").success
|
|
1027
|
+
).toBe(false);
|
|
1028
|
+
expect(z.string().min(5).safeParse(five).success).toBe(true);
|
|
1029
|
+
expect(z.string().min(5).safeParse("\u{1F600}\u{1F600}\u{1F600}\u{1F600}").success).toBe(false);
|
|
1030
|
+
expect(z.string().length(5).safeParse(five).success).toBe(true);
|
|
1031
|
+
expect(z.string().length(1).safeParse("\u{1F600}").success).toBe(true);
|
|
1032
|
+
expect(z.string().nonempty().safeParse("\u{1F600}").success).toBe(true);
|
|
1033
|
+
|
|
1034
|
+
// code points, not graphemes: a combining mark and a ZWJ sequence each stay several
|
|
1035
|
+
expect(z.string().length(2).safeParse("e\u0301").success).toBe(true);
|
|
1036
|
+
expect(z.string().length(3).safeParse("\u{1F9D1}\u200D\u{1F37C}").success).toBe(true);
|
|
1037
|
+
|
|
1038
|
+
// an unpaired surrogate is its own code point
|
|
1039
|
+
expect(z.string().length(1).safeParse("\uD83D").success).toBe(true);
|
|
1040
|
+
expect(z.string().length(2).safeParse("\uDE00\uD83D").success).toBe(true);
|
|
1041
|
+
|
|
1042
|
+
// the reported bound is still the declared one
|
|
1043
|
+
expect(
|
|
1044
|
+
z
|
|
1045
|
+
.string()
|
|
1046
|
+
.max(5)
|
|
1047
|
+
.safeParse(five + "\u{1F600}").error!.issues[0]
|
|
1048
|
+
).toMatchObject({
|
|
1049
|
+
code: "too_big",
|
|
1050
|
+
maximum: 5,
|
|
1051
|
+
origin: "string",
|
|
1052
|
+
});
|
|
1053
|
+
|
|
1054
|
+
// other lengthables keep counting elements
|
|
1055
|
+
expect(z.array(z.string()).max(2).safeParse(["a", "b", "c"]).success).toBe(false);
|
|
1056
|
+
expect(z.array(z.string()).length(2).safeParse(["\u{1F600}", "\u{1F600}"]).success).toBe(true);
|
|
1057
|
+
});
|
|
1058
|
+
|
|
863
1059
|
test("trim", () => {
|
|
864
1060
|
expect(z.string().trim().min(2).parse(" 12 ")).toEqual("12");
|
|
865
1061
|
|
|
@@ -1054,6 +1250,14 @@ test("CIDR v6 validation", () => {
|
|
|
1054
1250
|
expect(cidrV6.safeParse("fe80::/10").success).toBe(true);
|
|
1055
1251
|
expect(cidrV6.safeParse("::1/128").success).toBe(true);
|
|
1056
1252
|
expect(cidrV6.safeParse("2001:0db8:85a3::/64").success).toBe(true);
|
|
1253
|
+
expect(cidrV6.safeParse("2001:db8:1::/48").success).toBe(true);
|
|
1254
|
+
expect(cidrV6.safeParse("2001:db8:85a3::8a2e:370:7334/64").success).toBe(true);
|
|
1255
|
+
expect(cidrV6.safeParse("2001:db8:85a3:0:0:8a2e:370:7334/64").success).toBe(true);
|
|
1256
|
+
|
|
1257
|
+
const pattern = new RegExp(z.toJSONSchema(cidrV6).pattern as string);
|
|
1258
|
+
for (const input of ["2001:db8::/32", "2001:db8:1::/48", "2001:0db8:85a3::/64", "fe80::/10", "::/0"]) {
|
|
1259
|
+
expect(pattern.test(input)).toBe(true);
|
|
1260
|
+
}
|
|
1057
1261
|
|
|
1058
1262
|
// Invalid CIDR v6 addresses
|
|
1059
1263
|
expect(cidrV6.safeParse("2001:db8::").success).toBe(false); // Missing prefix
|
|
@@ -1142,6 +1346,18 @@ test("hostname", () => {
|
|
|
1142
1346
|
expect(() => hostname.parse("example..com")).toThrow();
|
|
1143
1347
|
});
|
|
1144
1348
|
|
|
1349
|
+
test("currency code", () => {
|
|
1350
|
+
const currency = z.currencyCode();
|
|
1351
|
+
for (const code of ["USD", "EUR", "XXX", "XCG", "XAD"]) expect(currency.parse(code)).toBe(code);
|
|
1352
|
+
for (const input of ["", "usd", "US", "USDX", " USD", "ANG", "BGN"])
|
|
1353
|
+
expect(currency.safeParse(input).success).toBe(false);
|
|
1354
|
+
expect(currency.safeParse("usd").error!.issues[0]).toMatchObject({
|
|
1355
|
+
code: "invalid_format",
|
|
1356
|
+
format: "currency_code",
|
|
1357
|
+
message: "Invalid currency code",
|
|
1358
|
+
});
|
|
1359
|
+
});
|
|
1360
|
+
|
|
1145
1361
|
test("hash validation", () => {
|
|
1146
1362
|
// MD5 tests
|
|
1147
1363
|
const md5hex = z.hash("md5");
|
|
@@ -104,3 +104,21 @@ test("z.stringbool codec round trip", () => {
|
|
|
104
104
|
const encodedFalse = z.encode(schema, decodedFalse);
|
|
105
105
|
expect(encodedFalse).toEqual("disabled"); // First element of falsy array
|
|
106
106
|
});
|
|
107
|
+
|
|
108
|
+
test("z.stringbool exposes truthy/falsy/case via _zod.bag", () => {
|
|
109
|
+
const a = z.stringbool();
|
|
110
|
+
expect(a._zod.bag.truthy).toEqual(["true", "1", "yes", "on", "y", "enabled"]);
|
|
111
|
+
expect(a._zod.bag.falsy).toEqual(["false", "0", "no", "off", "n", "disabled"]);
|
|
112
|
+
expect(a._zod.bag.case).toEqual("insensitive");
|
|
113
|
+
|
|
114
|
+
// values are normalized when case-insensitive
|
|
115
|
+
const b = z.stringbool({ truthy: ["Y", "yes"], falsy: ["N"] });
|
|
116
|
+
expect(b._zod.bag.truthy).toEqual(["y", "yes"]);
|
|
117
|
+
expect(b._zod.bag.falsy).toEqual(["n"]);
|
|
118
|
+
expect(b._zod.bag.case).toEqual("insensitive");
|
|
119
|
+
|
|
120
|
+
const c = z.stringbool({ truthy: ["Y"], falsy: ["N"], case: "sensitive" });
|
|
121
|
+
expect(c._zod.bag.truthy).toEqual(["Y"]);
|
|
122
|
+
expect(c._zod.bag.falsy).toEqual(["N"]);
|
|
123
|
+
expect(c._zod.bag.case).toEqual("sensitive");
|
|
124
|
+
});
|
|
@@ -64,6 +64,9 @@ const measurement = z.templateLiteral([
|
|
|
64
64
|
z.number().finite(),
|
|
65
65
|
z.enum(["px", "em", "rem", "vh", "vw", "vmin", "vmax"]).optional(),
|
|
66
66
|
]);
|
|
67
|
+
const decimalEnum = z.templateLiteral(["", z.enum({ A: 1.2 })]);
|
|
68
|
+
// String(1e21) is "1e+21" — the `+` needs escaping too, or the pattern rejects its own enum value
|
|
69
|
+
const exponentEnum = z.templateLiteral(["", z.enum({ A: 1e21 })]);
|
|
67
70
|
|
|
68
71
|
const connectionString = z.templateLiteral([
|
|
69
72
|
"mongodb://",
|
|
@@ -559,10 +562,10 @@ test("regexes", () => {
|
|
|
559
562
|
expect(cuidZZZ._zod.pattern.source).toMatchInlineSnapshot(`"^[cC][0-9a-z]{6,}ZZZ$"`);
|
|
560
563
|
expect(cuid2._zod.pattern.source).toMatchInlineSnapshot(`"^[0-9a-z]+$"`);
|
|
561
564
|
expect(datetime._zod.pattern.source).toMatchInlineSnapshot(
|
|
562
|
-
`"^(?:(?:\\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
|
|
565
|
+
`"^(?:(?:\\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))$"`
|
|
563
566
|
);
|
|
564
567
|
expect(email._zod.pattern.source).toMatchInlineSnapshot(
|
|
565
|
-
`"^(
|
|
568
|
+
`"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"`
|
|
566
569
|
);
|
|
567
570
|
// expect(ip._zod.pattern.source).toMatchInlineSnapshot(
|
|
568
571
|
// `"^(^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$)|(^(([a-fA-F0-9]{1,4}:){7}|::([a-fA-F0-9]{1,4}:){0,6}|([a-fA-F0-9]{1,4}:){1}:([a-fA-F0-9]{1,4}:){0,5}|([a-fA-F0-9]{1,4}:){2}:([a-fA-F0-9]{1,4}:){0,4}|([a-fA-F0-9]{1,4}:){3}:([a-fA-F0-9]{1,4}:){0,3}|([a-fA-F0-9]{1,4}:){4}:([a-fA-F0-9]{1,4}:){0,2}|([a-fA-F0-9]{1,4}:){5}:([a-fA-F0-9]{1,4}:){0,1})([a-fA-F0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$)$"`
|
|
@@ -576,7 +579,7 @@ test("regexes", () => {
|
|
|
576
579
|
expect(mac._zod.pattern.source).toMatchInlineSnapshot(
|
|
577
580
|
`"^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}:){5}[0-9a-f]{2}$"`
|
|
578
581
|
);
|
|
579
|
-
expect(ulid._zod.pattern.source).toMatchInlineSnapshot(`"^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{
|
|
582
|
+
expect(ulid._zod.pattern.source).toMatchInlineSnapshot(`"^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$"`);
|
|
580
583
|
expect(uuid._zod.pattern.source).toMatchInlineSnapshot(
|
|
581
584
|
`"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"`
|
|
582
585
|
);
|
|
@@ -590,6 +593,8 @@ test("regexes", () => {
|
|
|
590
593
|
expect(brandedString._zod.pattern.source).toMatchInlineSnapshot(`"^[\\s\\S]{1,}$"`);
|
|
591
594
|
expect(url._zod.pattern.source).toMatchInlineSnapshot(`"^https:\\/\\/\\w+\\.(com|net)$"`);
|
|
592
595
|
expect(measurement._zod.pattern.source).toMatchInlineSnapshot(`"^-?\\d+(?:\\.\\d+)?((px|em|rem|vh|vw|vmin|vmax))?$"`);
|
|
596
|
+
expect(decimalEnum._zod.pattern.source).toMatchInlineSnapshot(`"^(1\\.2)$"`);
|
|
597
|
+
expect(exponentEnum._zod.pattern.source).toMatchInlineSnapshot(`"^(1e\\+21)$"`);
|
|
593
598
|
expect(connectionString._zod.pattern.source).toMatchInlineSnapshot(
|
|
594
599
|
`"^mongodb:\\/\\/(\\w+:\\w+@)?\\w+:-?\\d+(\\/(\\w+)?(\\?(\\w+=\\w+(&\\w+=\\w+)*)?)?)?$"`
|
|
595
600
|
);
|
|
@@ -599,6 +604,8 @@ test("template literal parsing - success - complex cases", () => {
|
|
|
599
604
|
url.parse("https://example.com");
|
|
600
605
|
url.parse("https://speedtest.net");
|
|
601
606
|
|
|
607
|
+
exponentEnum.parse("1e+21");
|
|
608
|
+
|
|
602
609
|
// measurement.parse(1);
|
|
603
610
|
// measurement.parse(1.1);
|
|
604
611
|
// measurement.parse(0);
|
|
@@ -675,6 +682,8 @@ test("template literal parsing - failure - complex cases", () => {
|
|
|
675
682
|
expect(() => measurement.parse("-Infinity")).toThrow();
|
|
676
683
|
expect(() => measurement.parse("NaN")).toThrow();
|
|
677
684
|
expect(() => measurement.parse("1%")).toThrow();
|
|
685
|
+
expect(() => decimalEnum.parse("1x2")).toThrow();
|
|
686
|
+
expect(() => exponentEnum.parse("1e21")).toThrow();
|
|
678
687
|
|
|
679
688
|
expect(() => connectionString.parse("mongod://host:1234")).toThrow();
|
|
680
689
|
expect(() => connectionString.parse("mongodb://:1234")).toThrow();
|
|
@@ -769,3 +778,35 @@ test("template literal parsing - failure - issue format", () => {
|
|
|
769
778
|
}
|
|
770
779
|
`);
|
|
771
780
|
});
|
|
781
|
+
|
|
782
|
+
test("part patterns fold checks through wrappers and unions", () => {
|
|
783
|
+
// a constrained string keeps its bounds under a wrapper and inside a union
|
|
784
|
+
const wrapped = z.templateLiteral(["a-", z.string().min(2).max(3).optional()]);
|
|
785
|
+
expect(wrapped.safeParse("a-").success).toBe(true);
|
|
786
|
+
expect(wrapped.safeParse("a-xy").success).toBe(true);
|
|
787
|
+
expect(wrapped.safeParse("a-x").success).toBe(false);
|
|
788
|
+
expect(wrapped.safeParse("a-wxyz").success).toBe(false);
|
|
789
|
+
|
|
790
|
+
const union = z.templateLiteral(["", z.union([z.string().regex(/^[a-c]+$/), z.number().int()])]);
|
|
791
|
+
expect(union.safeParse("abc").success).toBe(true);
|
|
792
|
+
expect(union.safeParse("12").success).toBe(true);
|
|
793
|
+
expect(union.safeParse("xyz").success).toBe(false);
|
|
794
|
+
expect(union.safeParse("1.5").success).toBe(false);
|
|
795
|
+
|
|
796
|
+
// an empty length range matches nothing rather than building an invalid quantifier
|
|
797
|
+
const empty = z.templateLiteral(["", z.string().min(8).length(5)]);
|
|
798
|
+
expect(empty.safeParse("abcde").success).toBe(false);
|
|
799
|
+
|
|
800
|
+
// lazy resolves its inner schema on the internals, not the def
|
|
801
|
+
const lazy = z.templateLiteral(["", z.lazy(() => z.string().min(2)).optional()]);
|
|
802
|
+
expect(lazy.safeParse("x").success).toBe(false);
|
|
803
|
+
expect(lazy.safeParse("xy").success).toBe(true);
|
|
804
|
+
});
|
|
805
|
+
|
|
806
|
+
test("an embedded email does not constrain the other parts", () => {
|
|
807
|
+
const schema = z.templateLiteral([z.email(), "|", z.string()]);
|
|
808
|
+
expect(schema.safeParse("a@b.cc|a..b").success).toBe(true);
|
|
809
|
+
expect(schema.safeParse("a@b.cc|xy").success).toBe(true);
|
|
810
|
+
expect(schema.safeParse("a..b@b.cc|xy").success).toBe(false);
|
|
811
|
+
expect(schema.safeParse(".a@b.cc|xy").success).toBe(false);
|
|
812
|
+
});
|