@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,7 +1,44 @@
|
|
|
1
|
-
import { inspect } from "node:util";
|
|
2
|
-
import
|
|
1
|
+
import { inspect, types } from "node:util";
|
|
2
|
+
import v8 from "node:v8";
|
|
3
|
+
import vm from "node:vm";
|
|
4
|
+
import { afterEach, describe, expect, test, vi } from "vitest";
|
|
3
5
|
import * as z from "zod/v4";
|
|
4
6
|
|
|
7
|
+
// Several tests install a global error map. Resetting on the last line of each leaks it into every later test in the file whenever an assertion above that line fails, which turns one real failure into a cascade.
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
z.config({ customError: undefined });
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
function getThrownError(fn: () => unknown): unknown {
|
|
13
|
+
try {
|
|
14
|
+
fn();
|
|
15
|
+
} catch (error) {
|
|
16
|
+
return error;
|
|
17
|
+
}
|
|
18
|
+
throw new Error("Expected function to throw");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function getRejectedError(fn: () => Promise<unknown>): Promise<unknown> {
|
|
22
|
+
try {
|
|
23
|
+
await fn();
|
|
24
|
+
} catch (error) {
|
|
25
|
+
return error;
|
|
26
|
+
}
|
|
27
|
+
throw new Error("Expected function to reject");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function expectFirstStackFrameAtCallsite(error: unknown): void {
|
|
31
|
+
expect(error).toBeInstanceOf(Error);
|
|
32
|
+
const stack = (error as Error).stack;
|
|
33
|
+
expect(stack).toEqual(expect.any(String));
|
|
34
|
+
|
|
35
|
+
const firstFrame = stack!.split("\n").find((line) => line.trim().startsWith("at "));
|
|
36
|
+
expect(firstFrame).toBeDefined();
|
|
37
|
+
expect(firstFrame).toContain("error.test.ts");
|
|
38
|
+
expect(firstFrame).not.toContain("core/parse.ts");
|
|
39
|
+
expect(firstFrame).not.toContain("classic/schemas.ts");
|
|
40
|
+
}
|
|
41
|
+
|
|
5
42
|
test("error creation", () => {
|
|
6
43
|
const err1 = new z.ZodError([]);
|
|
7
44
|
|
|
@@ -523,7 +560,7 @@ test("z.config customError ", () => {
|
|
|
523
560
|
// support overrideErrorMap
|
|
524
561
|
|
|
525
562
|
z.config({ customError: () => ({ message: "override" }) });
|
|
526
|
-
const result =
|
|
563
|
+
const result = z.string().min(10).safeParse("tooshort");
|
|
527
564
|
expect(result.success).toBe(false);
|
|
528
565
|
expect(result.error).toMatchInlineSnapshot(`
|
|
529
566
|
[ZodError: [
|
|
@@ -538,7 +575,40 @@ test("z.config customError ", () => {
|
|
|
538
575
|
]]
|
|
539
576
|
`);
|
|
540
577
|
expect(result.error!.issues[0].message).toEqual("override");
|
|
541
|
-
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
test("bound error map covers issues raised by its own checks", () => {
|
|
581
|
+
const result = stringWithCustomError.min(10).safeParse("tooshort");
|
|
582
|
+
expect(result.success).toBe(false);
|
|
583
|
+
expect(result.error!.issues[0].message).toEqual("bound");
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
test("a check's own error map beats the schema's", () => {
|
|
587
|
+
const result = stringWithCustomError.min(10, { error: () => "check" }).safeParse("tooshort");
|
|
588
|
+
expect(result.success).toBe(false);
|
|
589
|
+
expect(result.error!.issues[0].message).toEqual("check");
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
test("the schema's error map beats contextual and global for a check issue", () => {
|
|
593
|
+
z.config({ customError: () => "global" });
|
|
594
|
+
const result = stringWithCustomError.min(10).safeParse("tooshort", { error: () => "contextual" });
|
|
595
|
+
expect(result.success).toBe(false);
|
|
596
|
+
expect(result.error!.issues[0].message).toEqual("bound");
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
test("a schema map returning undefined defers to the next rung, and runs once", () => {
|
|
600
|
+
let calls = 0;
|
|
601
|
+
const deferring = z.string({
|
|
602
|
+
error: () => {
|
|
603
|
+
calls++;
|
|
604
|
+
return undefined;
|
|
605
|
+
},
|
|
606
|
+
});
|
|
607
|
+
z.config({ customError: () => "global" });
|
|
608
|
+
const result = deferring.min(10).safeParse("tooshort");
|
|
609
|
+
expect(result.success).toBe(false);
|
|
610
|
+
expect(result.error!.issues[0].message).toEqual("global");
|
|
611
|
+
expect(calls).toEqual(1);
|
|
542
612
|
});
|
|
543
613
|
|
|
544
614
|
// test("invalid and required", () => {
|
|
@@ -671,7 +741,7 @@ test("error inheritance", () => {
|
|
|
671
741
|
expect(e1).toBeInstanceOf(z.core.$ZodError);
|
|
672
742
|
expect(e1).toBeInstanceOf(z.ZodError);
|
|
673
743
|
expect(e1).toBeInstanceOf(z.ZodRealError);
|
|
674
|
-
|
|
744
|
+
expect(e1).toBeInstanceOf(Error);
|
|
675
745
|
|
|
676
746
|
try {
|
|
677
747
|
z.string().parse(123);
|
|
@@ -679,10 +749,63 @@ test("error inheritance", () => {
|
|
|
679
749
|
expect(e1).toBeInstanceOf(z.core.$ZodError);
|
|
680
750
|
expect(e2).toBeInstanceOf(z.ZodError);
|
|
681
751
|
expect(e2).toBeInstanceOf(z.ZodRealError);
|
|
682
|
-
|
|
752
|
+
expect(e2).toBeInstanceOf(Error);
|
|
683
753
|
}
|
|
684
754
|
});
|
|
685
755
|
|
|
756
|
+
test("parse errors capture the caller stack frame", async () => {
|
|
757
|
+
const schema = z.string();
|
|
758
|
+
const parse = schema.parse;
|
|
759
|
+
const parseAsync = schema.parseAsync;
|
|
760
|
+
|
|
761
|
+
expectFirstStackFrameAtCallsite(getThrownError(() => schema.parse(123)));
|
|
762
|
+
expectFirstStackFrameAtCallsite(getThrownError(() => parse(123)));
|
|
763
|
+
expectFirstStackFrameAtCallsite(getThrownError(() => z.parse(schema, 123)));
|
|
764
|
+
|
|
765
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => schema.parseAsync(123)));
|
|
766
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => parseAsync(123)));
|
|
767
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => z.parseAsync(schema, 123)));
|
|
768
|
+
});
|
|
769
|
+
|
|
770
|
+
test("codec errors capture the caller stack frame", async () => {
|
|
771
|
+
const schema = z.string();
|
|
772
|
+
const encode = schema.encode;
|
|
773
|
+
const decode = schema.decode;
|
|
774
|
+
const encodeAsync = schema.encodeAsync;
|
|
775
|
+
const decodeAsync = schema.decodeAsync;
|
|
776
|
+
|
|
777
|
+
expectFirstStackFrameAtCallsite(getThrownError(() => schema.encode(123 as any)));
|
|
778
|
+
expectFirstStackFrameAtCallsite(getThrownError(() => encode(123 as any)));
|
|
779
|
+
expectFirstStackFrameAtCallsite(getThrownError(() => z.encode(schema, 123 as any)));
|
|
780
|
+
|
|
781
|
+
expectFirstStackFrameAtCallsite(getThrownError(() => schema.decode(123 as any)));
|
|
782
|
+
expectFirstStackFrameAtCallsite(getThrownError(() => decode(123 as any)));
|
|
783
|
+
expectFirstStackFrameAtCallsite(getThrownError(() => z.decode(schema, 123 as any)));
|
|
784
|
+
|
|
785
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => schema.encodeAsync(123 as any)));
|
|
786
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => encodeAsync(123 as any)));
|
|
787
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => z.encodeAsync(schema, 123 as any)));
|
|
788
|
+
|
|
789
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => schema.decodeAsync(123 as any)));
|
|
790
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => decodeAsync(123 as any)));
|
|
791
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => z.decodeAsync(schema, 123 as any)));
|
|
792
|
+
});
|
|
793
|
+
|
|
794
|
+
test("async errors that fail after suspending capture the caller stack frame", async () => {
|
|
795
|
+
// `Error.captureStackTrace` is skip-until-seen: when it cannot find its callee it discards every frame, not just the ones above. An async wrapper that returns its inner promise without awaiting has already left the async chain by the time the rejection is built, so its callee is unfindable and the stack comes back empty. Only a schema that actually suspends reaches that path — the sync cases above run straight through to their first await and pass either way.
|
|
796
|
+
const refined = z.string().refine(async () => false, "nope");
|
|
797
|
+
const codec = z.codec(z.string(), z.number(), {
|
|
798
|
+
decode: async (value) => value as never,
|
|
799
|
+
encode: async (value) => value as never,
|
|
800
|
+
});
|
|
801
|
+
|
|
802
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => refined.parseAsync("x")));
|
|
803
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => codec.decodeAsync("x")));
|
|
804
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => z.decodeAsync(codec, "x")));
|
|
805
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => codec.encodeAsync(5)));
|
|
806
|
+
expectFirstStackFrameAtCallsite(await getRejectedError(() => z.encodeAsync(codec, 5)));
|
|
807
|
+
});
|
|
808
|
+
|
|
686
809
|
test("error serialization", () => {
|
|
687
810
|
try {
|
|
688
811
|
z.string().parse(123);
|
|
@@ -709,3 +832,277 @@ test("error serialization", () => {
|
|
|
709
832
|
`);
|
|
710
833
|
}
|
|
711
834
|
});
|
|
835
|
+
|
|
836
|
+
test("message is lazy but stays own and enumerable", () => {
|
|
837
|
+
const err = z.object({ a: z.string() }).safeParse({ a: 1 }).error!;
|
|
838
|
+
|
|
839
|
+
expect(Object.keys(err)).toEqual(["name", "message"]);
|
|
840
|
+
expect(Object.keys({ ...err })).toEqual(["name", "message"]);
|
|
841
|
+
expect(JSON.parse(JSON.stringify(err)).message).toEqual(err.message);
|
|
842
|
+
expect(Object.getOwnPropertyDescriptor(err, "message")!.enumerable).toBe(true);
|
|
843
|
+
expect(Object.getOwnPropertyDescriptor(err, "issues")!.enumerable).toBe(false);
|
|
844
|
+
|
|
845
|
+
// computed once, then stable against later mutation of `.issues`
|
|
846
|
+
const computed = err.message;
|
|
847
|
+
err.issues.push({ code: "custom", message: "later", path: [], input: undefined });
|
|
848
|
+
expect(err.message).toEqual(computed);
|
|
849
|
+
|
|
850
|
+
// assignment wins over the computed value, and `toString` follows it
|
|
851
|
+
err.message = "overwritten";
|
|
852
|
+
expect(err.message).toEqual("overwritten");
|
|
853
|
+
expect(err.toString()).toEqual("overwritten");
|
|
854
|
+
|
|
855
|
+
// a second error computes its own message
|
|
856
|
+
expect(z.string().safeParse(1).error!.message).not.toEqual(computed);
|
|
857
|
+
});
|
|
858
|
+
|
|
859
|
+
test("error helpers survive detaching", () => {
|
|
860
|
+
const err = z.object({ a: z.string() }).safeParse({ a: 1 }).error!;
|
|
861
|
+
const { format, flatten } = err;
|
|
862
|
+
const stringify = err.toString;
|
|
863
|
+
|
|
864
|
+
expect(format().a?._errors).toEqual(["Invalid input: expected string, received number"]);
|
|
865
|
+
expect(flatten().fieldErrors.a).toEqual(["Invalid input: expected string, received number"]);
|
|
866
|
+
expect(stringify()).toEqual(err.message);
|
|
867
|
+
expect(err.isEmpty).toBe(false);
|
|
868
|
+
expect(new z.ZodError([]).isEmpty).toBe(true);
|
|
869
|
+
|
|
870
|
+
// addIssue refreshes a message that was already materialized
|
|
871
|
+
const empty = new z.ZodError([]);
|
|
872
|
+
expect(empty.message).toEqual("[]");
|
|
873
|
+
empty.addIssue({ code: "custom", message: "added", path: [], input: undefined });
|
|
874
|
+
expect(empty.message).toContain("added");
|
|
875
|
+
});
|
|
876
|
+
|
|
877
|
+
test("an error is a real Error, minus the captured frames", () => {
|
|
878
|
+
const err = z.string().safeParse(123).error!;
|
|
879
|
+
|
|
880
|
+
// suppressing the capture, not skipping the constructor, keeps every brand check working
|
|
881
|
+
expect(err).toBeInstanceOf(Error);
|
|
882
|
+
expect(types.isNativeError(err)).toBe(true);
|
|
883
|
+
expect(Object.prototype.toString.call(err)).toBe("[object Error]");
|
|
884
|
+
expect(structuredClone(err)).toBeInstanceOf(Error);
|
|
885
|
+
|
|
886
|
+
// only a returned error loses its frames; the throwing paths restore them
|
|
887
|
+
expect(err.stack!.startsWith("ZodError: [")).toBe(true);
|
|
888
|
+
expect(err.stack!).toContain("invalid_type");
|
|
889
|
+
expect(err.stack!.split("\n").some((line) => line.trim().startsWith("at "))).toBe(false);
|
|
890
|
+
|
|
891
|
+
// the borrowed global is given back unchanged, including a caller's own value
|
|
892
|
+
const ambient = Error.stackTraceLimit;
|
|
893
|
+
z.string().safeParse(123);
|
|
894
|
+
expect(Error.stackTraceLimit).toBe(ambient);
|
|
895
|
+
Error.stackTraceLimit = ambient + 3;
|
|
896
|
+
try {
|
|
897
|
+
z.string().safeParse(123);
|
|
898
|
+
expect(Error.stackTraceLimit).toBe(ambient + 3);
|
|
899
|
+
} finally {
|
|
900
|
+
Error.stackTraceLimit = ambient;
|
|
901
|
+
}
|
|
902
|
+
});
|
|
903
|
+
|
|
904
|
+
test("an engine without captureStackTrace keeps the frames on a thrown error", async () => {
|
|
905
|
+
// suppressing the capture is only safe where `parse()` can put the frames back; Safari 11.1 through 17.1 has `stackTraceLimit` but not `captureStackTrace`, and suppressing there would strip the throw's stack
|
|
906
|
+
const desc = Object.getOwnPropertyDescriptor(Error, "captureStackTrace")!;
|
|
907
|
+
vi.resetModules();
|
|
908
|
+
delete (Error as { captureStackTrace?: unknown }).captureStackTrace;
|
|
909
|
+
|
|
910
|
+
let thrown: unknown;
|
|
911
|
+
try {
|
|
912
|
+
const fresh = await import("zod/v4");
|
|
913
|
+
function callSite() {
|
|
914
|
+
fresh.string().parse(1);
|
|
915
|
+
}
|
|
916
|
+
try {
|
|
917
|
+
callSite();
|
|
918
|
+
} catch (err) {
|
|
919
|
+
thrown = err;
|
|
920
|
+
}
|
|
921
|
+
} finally {
|
|
922
|
+
Object.defineProperty(Error, "captureStackTrace", desc);
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
expect(thrown).toBeInstanceOf(Error);
|
|
926
|
+
expect((thrown as Error).stack).toContain("callSite");
|
|
927
|
+
});
|
|
928
|
+
|
|
929
|
+
test("a realm that hardens Error after import degrades instead of throwing", async () => {
|
|
930
|
+
// lockdown() runs after zod's module graph evaluates, so the latch fires in a throwaway instance rather than the one this file uses
|
|
931
|
+
vi.resetModules();
|
|
932
|
+
const fresh = await import("zod/v4");
|
|
933
|
+
const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit")!;
|
|
934
|
+
Object.defineProperty(Error, "stackTraceLimit", { value: 10, writable: false, configurable: true });
|
|
935
|
+
|
|
936
|
+
try {
|
|
937
|
+
for (const err of [fresh.string().safeParse(1).error!, fresh.string().safeParse(2).error!]) {
|
|
938
|
+
expect(err).toBeInstanceOf(Error);
|
|
939
|
+
expect(err.issues).toHaveLength(1);
|
|
940
|
+
}
|
|
941
|
+
expect(Error.stackTraceLimit).toBe(10);
|
|
942
|
+
} finally {
|
|
943
|
+
Object.defineProperty(Error, "stackTraceLimit", desc);
|
|
944
|
+
}
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
test("an engine with no stackTraceLimit is never written to", () => {
|
|
948
|
+
// off v8 the property is absent and SES deletes it before hardening; an accessor makes the write observable where a data property would not
|
|
949
|
+
const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit")!;
|
|
950
|
+
let writes = 0;
|
|
951
|
+
Object.defineProperty(Error, "stackTraceLimit", {
|
|
952
|
+
get: () => undefined,
|
|
953
|
+
set: () => {
|
|
954
|
+
writes++;
|
|
955
|
+
},
|
|
956
|
+
configurable: true,
|
|
957
|
+
});
|
|
958
|
+
|
|
959
|
+
try {
|
|
960
|
+
const err = z.string().safeParse(123).error!;
|
|
961
|
+
expect(err).toBeInstanceOf(z.ZodError);
|
|
962
|
+
expect(types.isNativeError(err)).toBe(true);
|
|
963
|
+
expect(err.issues).toHaveLength(1);
|
|
964
|
+
expect(writes).toBe(0);
|
|
965
|
+
} finally {
|
|
966
|
+
Object.defineProperty(Error, "stackTraceLimit", desc);
|
|
967
|
+
}
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
test("error initializer never installs onto an intrinsic prototype", () => {
|
|
971
|
+
// `init` accepts any object; a foreign one must not leak accessors onto the prototype it happens to inherit from.
|
|
972
|
+
z.core.$ZodError.init({} as any, []);
|
|
973
|
+
z.ZodError.init({} as any, []);
|
|
974
|
+
z.core.$ZodError.init(new Error() as any, []);
|
|
975
|
+
|
|
976
|
+
expect(Object.getOwnPropertyDescriptor(Object.prototype, "toString")!.get).toBeUndefined();
|
|
977
|
+
expect(Object.getOwnPropertyDescriptor(Error.prototype, "toString")!.get).toBeUndefined();
|
|
978
|
+
expect(Object.getOwnPropertyNames(Object.prototype)).not.toContain("format");
|
|
979
|
+
expect({}.toString()).toEqual("[object Object]");
|
|
980
|
+
expect(String(new Error("boom"))).toEqual("Error: boom");
|
|
981
|
+
});
|
|
982
|
+
|
|
983
|
+
describe("safeParse builds the error on first read", () => {
|
|
984
|
+
class CountingError {
|
|
985
|
+
static constructed = 0;
|
|
986
|
+
constructor(public issues: unknown[]) {
|
|
987
|
+
CountingError.constructed++;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
test("constructs once, on read", () => {
|
|
992
|
+
CountingError.constructed = 0;
|
|
993
|
+
const result = z.core._safeParse(CountingError as any)(z.string(), 1) as any;
|
|
994
|
+
expect(result.success).toBe(false);
|
|
995
|
+
expect(CountingError.constructed).toBe(0);
|
|
996
|
+
const err = result.error;
|
|
997
|
+
expect(CountingError.constructed).toBe(1);
|
|
998
|
+
expect(result.error).toBe(err);
|
|
999
|
+
expect(CountingError.constructed).toBe(1);
|
|
1000
|
+
expect(err.issues[0].code).toBe("invalid_type");
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
test("async variant", async () => {
|
|
1004
|
+
CountingError.constructed = 0;
|
|
1005
|
+
const result = (await z.core._safeParseAsync(CountingError as any)(z.string(), 1)) as any;
|
|
1006
|
+
expect(CountingError.constructed).toBe(0);
|
|
1007
|
+
expect(result.error).toBeInstanceOf(CountingError);
|
|
1008
|
+
expect(CountingError.constructed).toBe(1);
|
|
1009
|
+
});
|
|
1010
|
+
|
|
1011
|
+
test("result stays plain data", () => {
|
|
1012
|
+
const result = z.string().safeParse(1);
|
|
1013
|
+
expect(Object.keys(result)).toEqual(["success", "error"]);
|
|
1014
|
+
expect(result).toEqual({ success: false, error: expect.any(z.ZodError) });
|
|
1015
|
+
expect(structuredClone(result).error).toBeInstanceOf(Error);
|
|
1016
|
+
const replaced = new z.ZodError([]);
|
|
1017
|
+
(result as any).error = replaced;
|
|
1018
|
+
expect(result.error).toBe(replaced);
|
|
1019
|
+
});
|
|
1020
|
+
|
|
1021
|
+
test("reading the error releases the parsed input", async () => {
|
|
1022
|
+
// es2020 is the target, and its lib predates WeakRef
|
|
1023
|
+
type Weak<T extends object> = { deref(): T | undefined };
|
|
1024
|
+
const { WeakRef: Weak } = globalThis as unknown as { WeakRef: new <T extends object>(target: T) => Weak<T> };
|
|
1025
|
+
// vitest carries no --expose-gc, so reach the collector the way node's own tests do
|
|
1026
|
+
v8.setFlagsFromString("--expose-gc");
|
|
1027
|
+
const gc = vm.runInNewContext("gc") as () => void;
|
|
1028
|
+
|
|
1029
|
+
const schema = z.string();
|
|
1030
|
+
const refs: Weak<object>[] = [];
|
|
1031
|
+
const results: unknown[] = [];
|
|
1032
|
+
for (let i = 0; i < 50; i++) {
|
|
1033
|
+
const input = { i, blob: new Array(500).fill(i) };
|
|
1034
|
+
refs.push(new Weak(input));
|
|
1035
|
+
const result = schema.safeParse(input);
|
|
1036
|
+
// half read the error, half replace it without ever reading; both have to release
|
|
1037
|
+
if (i % 2) void result.error;
|
|
1038
|
+
else (result as { error: z.core.$ZodError }).error = new z.ZodError([]);
|
|
1039
|
+
results.push(result);
|
|
1040
|
+
}
|
|
1041
|
+
// the collector decides when it runs, so give it several passes; a retained input never clears no matter how many it gets
|
|
1042
|
+
const live = () => refs.filter((ref) => ref.deref() !== undefined).length;
|
|
1043
|
+
for (let attempt = 0; attempt < 10 && live() > 1; attempt++) {
|
|
1044
|
+
// the loop's last input stays on the stack until a macrotask boundary
|
|
1045
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1046
|
+
gc();
|
|
1047
|
+
}
|
|
1048
|
+
expect(live()).toBeLessThanOrEqual(1);
|
|
1049
|
+
expect(results).toHaveLength(50);
|
|
1050
|
+
});
|
|
1051
|
+
|
|
1052
|
+
test("no reader frames leak into the error, however late it is read", async () => {
|
|
1053
|
+
const result = z.string().safeParse(12) as { error: z.core.$ZodError };
|
|
1054
|
+
|
|
1055
|
+
// the constructor runs at THIS read: a macrotask later and twenty frames deeper than the parse
|
|
1056
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
1057
|
+
const readDeep = <T>(n: number, make: () => T): T => (n ? readDeep(n - 1, make) : make());
|
|
1058
|
+
const error = readDeep(20, () => result.error) as unknown as Error;
|
|
1059
|
+
|
|
1060
|
+
// control: a plain Error at that same depth does carry the frames, so the assertions below discriminate rather than pass vacuously
|
|
1061
|
+
const control = readDeep(20, () => new Error("control"));
|
|
1062
|
+
expect(control.stack!.split("\n").some((line) => line.trim().startsWith("at "))).toBe(true);
|
|
1063
|
+
expect(control.stack!).toContain("readDeep");
|
|
1064
|
+
|
|
1065
|
+
expect(error.stack!.startsWith("ZodError: [")).toBe(true);
|
|
1066
|
+
expect(error.stack!.split("\n").some((line) => line.trim().startsWith("at "))).toBe(false);
|
|
1067
|
+
expect(error.stack!).not.toContain("readDeep");
|
|
1068
|
+
});
|
|
1069
|
+
|
|
1070
|
+
test("a lazy build gives back the caller's stackTraceLimit, not the parse-time one", () => {
|
|
1071
|
+
const result = z.string().safeParse(12) as { error: z.core.$ZodError };
|
|
1072
|
+
const ambient = Error.stackTraceLimit;
|
|
1073
|
+
// changed between the parse and the read, so restoring a value captured at parse time would clobber it
|
|
1074
|
+
Error.stackTraceLimit = ambient + 7;
|
|
1075
|
+
try {
|
|
1076
|
+
void result.error;
|
|
1077
|
+
expect(Error.stackTraceLimit).toBe(ambient + 7);
|
|
1078
|
+
} finally {
|
|
1079
|
+
Error.stackTraceLimit = ambient;
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
});
|
|
1083
|
+
|
|
1084
|
+
test("a finalized issue copies the raw issue's own keys only", () => {
|
|
1085
|
+
const proto = { inherited: true };
|
|
1086
|
+
const schema = z.string().check((ctx) => {
|
|
1087
|
+
const raw = Object.create(proto);
|
|
1088
|
+
Object.assign(raw, { code: "custom", message: "own", input: ctx.value, extra: 1 });
|
|
1089
|
+
ctx.issues.push(raw);
|
|
1090
|
+
});
|
|
1091
|
+
const issue = schema.safeParse("x").error!.issues[0];
|
|
1092
|
+
expect(issue).toStrictEqual({ code: "custom", message: "own", path: [], extra: 1 });
|
|
1093
|
+
expect("inherited" in issue).toBe(false);
|
|
1094
|
+
// own symbol-keyed fields are not copied either; nothing in zod produces one and the walk stays a string-key walk
|
|
1095
|
+
const sym = Symbol("meta");
|
|
1096
|
+
const symbolic = z.string().check((ctx) => {
|
|
1097
|
+
ctx.issues.push({ code: "custom", message: "sym", input: ctx.value, [sym]: 1 } as never);
|
|
1098
|
+
});
|
|
1099
|
+
expect(Object.getOwnPropertySymbols(symbolic.safeParse("x").error!.issues[0])).toEqual([]);
|
|
1100
|
+
// an own __proto__ key, as JSON.parse produces, neither swaps the prototype nor survives
|
|
1101
|
+
const parsed = z.string().check((ctx) => {
|
|
1102
|
+
ctx.issues.push(JSON.parse('{"code":"custom","message":"json","__proto__":{"polluted":true}}'));
|
|
1103
|
+
});
|
|
1104
|
+
const fromJson = parsed.safeParse("x").error!.issues[0];
|
|
1105
|
+
expect(Object.getPrototypeOf(fromJson)).toBe(Object.prototype);
|
|
1106
|
+
expect(Object.prototype.hasOwnProperty.call(fromJson, "__proto__")).toBe(false);
|
|
1107
|
+
expect("polluted" in fromJson).toBe(false);
|
|
1108
|
+
});
|