@wopee-io/wopee.wdio 6.0.0 → 6.0.1
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/build/domain/model/config.interface.d.ts +15 -60
- package/build/domain/model/config.interface.d.ts.map +1 -1
- package/build/domain/service/wopeeService.d.ts.map +1 -1
- package/build/domain/service/wopeeService.js +2 -0
- package/build/domain/service/wopeeService.js.map +1 -1
- package/build/utils/versionMetadata.js +2 -2
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationScenarioPayload.interface.d.ts +1 -7
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationStepPayload.interface.d.ts +1 -23
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/createIntegrationSuitePayload.interface.d.ts +1 -5
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationScenario.interface.d.ts +1 -7
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationStep.interface.d.ts +3 -11
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationStep.interface.js +1 -1
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/integrationSuite.interface.d.ts +1 -7
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/visualAssert.interface.d.ts +3 -11
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/visualAssert.interface.js +1 -1
- package/node_modules/@autonomous-testing/sdk/build/core/domain/entities/visualAssertPayload.interface.d.ts +1 -9
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/adapter.d.ts +9 -2
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/adapter.js +30 -3
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/axios-config.d.ts +15 -1
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/axios-config.js +17 -1
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/deadline.d.ts +36 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/deadline.js +63 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/errors.js +10 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/factories.js +1 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/index.d.ts +2 -2
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/interface.d.ts +41 -224
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/interface.js +16 -8
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/retry.d.ts +52 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloAdapter/retry.js +122 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloAdapterService/apolloAdapterService.js +3 -7
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloAdapterService/apolloService.interface.d.ts +2 -2
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerOptions.interface.d.ts +5 -10
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerOptions.interface.js +2 -1
- package/node_modules/@autonomous-testing/sdk/build/shared/metadata/versionMetadata.js +2 -2
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/zodHelper.d.ts +10 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/zodHelper.js +8 -0
- package/node_modules/@autonomous-testing/sdk/package.json +2 -2
- package/node_modules/follow-redirects/README.md +27 -1
- package/node_modules/follow-redirects/index.js +11 -6
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/zod/README.md +34 -24
- 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 +22 -3
- package/node_modules/zod/index.d.cts +3 -4
- package/node_modules/zod/index.d.ts +3 -4
- package/node_modules/zod/index.js +7 -4
- package/node_modules/zod/locales/index.cjs +36 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +51 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +44 -15
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +7 -4
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +23 -13
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +3 -3
- package/node_modules/zod/src/v3/tests/complex.test.ts +17 -3
- package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +7 -3
- 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/nan.test.ts +5 -2
- package/node_modules/zod/src/v3/tests/object.test.ts +10 -13
- package/node_modules/zod/src/v3/tests/partials.test.ts +3 -3
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/string.test.ts +8 -2
- package/node_modules/zod/src/v3/types.ts +8 -6
- package/node_modules/zod/src/v4/classic/checks.ts +3 -0
- package/node_modules/zod/src/v4/classic/compat.ts +30 -18
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +61 -39
- package/node_modules/zod/src/v4/classic/external.ts +18 -11
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
- 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 +57 -2
- package/node_modules/zod/src/v4/classic/schemas.ts +1258 -375
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +35 -8
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +192 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +43 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +357 -5
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +27 -5
- 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 +67 -6
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +37 -17
- 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 +142 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +333 -10
- 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 +394 -4
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +9 -4
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +4 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +160 -37
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
- 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 +134 -5
- 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 +93 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +168 -5
- 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 +39 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +4 -3
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +37 -1
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +153 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +15 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +161 -7
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +457 -14
- 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 +255 -12
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +350 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +89 -5
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +25 -5
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +107 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +74 -21
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +1 -1
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +1 -69
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +553 -10
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +352 -1
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +229 -68
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +40 -1
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +20 -3
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +16 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +568 -9
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +58 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +70 -16
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3409 -990
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +128 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +353 -5
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +219 -3
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- 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 +442 -161
- package/node_modules/zod/src/v4/core/checks.ts +134 -151
- package/node_modules/zod/src/v4/core/compile.ts +2322 -0
- package/node_modules/zod/src/v4/core/core.ts +146 -50
- package/node_modules/zod/src/v4/core/doc.ts +18 -10
- package/node_modules/zod/src/v4/core/errors.ts +221 -102
- package/node_modules/zod/src/v4/core/index.ts +5 -1
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +9 -4
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +252 -37
- package/node_modules/zod/src/v4/core/regexes.ts +112 -30
- package/node_modules/zod/src/v4/core/registries.ts +19 -10
- package/node_modules/zod/src/v4/core/schemas.ts +1972 -588
- package/node_modules/zod/src/v4/core/standard-schema.ts +114 -19
- 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/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +1 -1
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- 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/locales/tr.test.ts +2 -2
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -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 +706 -826
- package/node_modules/zod/src/v4/core/util.ts +675 -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 +22 -27
- package/node_modules/zod/src/v4/locales/az.ts +22 -27
- package/node_modules/zod/src/v4/locales/be.ts +31 -27
- package/node_modules/zod/src/v4/locales/bg.ts +133 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +22 -28
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +26 -45
- package/node_modules/zod/src/v4/locales/da.ts +128 -0
- package/node_modules/zod/src/v4/locales/de.ts +24 -27
- package/node_modules/zod/src/v4/locales/el.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +38 -29
- package/node_modules/zod/src/v4/locales/eo.ts +25 -27
- package/node_modules/zod/src/v4/locales/es.ts +53 -33
- package/node_modules/zod/src/v4/locales/fa.ts +24 -27
- package/node_modules/zod/src/v4/locales/fi.ts +22 -27
- package/node_modules/zod/src/v4/locales/fr-CA.ts +22 -27
- package/node_modules/zod/src/v4/locales/fr.ts +58 -43
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +208 -80
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +135 -0
- package/node_modules/zod/src/v4/locales/hu.ts +24 -28
- package/node_modules/zod/src/v4/locales/hy.ts +175 -0
- package/node_modules/zod/src/v4/locales/id.ts +22 -27
- package/node_modules/zod/src/v4/locales/index.ts +24 -0
- package/node_modules/zod/src/v4/locales/is.ts +124 -0
- package/node_modules/zod/src/v4/locales/it.ts +24 -28
- package/node_modules/zod/src/v4/locales/ja.ts +24 -27
- package/node_modules/zod/src/v4/locales/ka.ts +128 -0
- package/node_modules/zod/src/v4/locales/kh.ts +3 -122
- package/node_modules/zod/src/v4/locales/km.ts +124 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +22 -27
- package/node_modules/zod/src/v4/locales/lt.ts +243 -0
- package/node_modules/zod/src/v4/locales/mk.ts +24 -28
- package/node_modules/zod/src/v4/locales/ms.ts +23 -27
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +37 -37
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +26 -29
- package/node_modules/zod/src/v4/locales/ota.ts +25 -28
- package/node_modules/zod/src/v4/locales/pl.ts +24 -27
- package/node_modules/zod/src/v4/locales/ps.ts +24 -26
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +107 -71
- package/node_modules/zod/src/v4/locales/ro.ts +132 -0
- package/node_modules/zod/src/v4/locales/ru.ts +31 -27
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +24 -27
- package/node_modules/zod/src/v4/locales/sv.ts +26 -29
- package/node_modules/zod/src/v4/locales/ta.ts +25 -27
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +25 -27
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +22 -27
- package/node_modules/zod/src/v4/locales/ua.ts +3 -122
- package/node_modules/zod/src/v4/locales/uk.ts +122 -0
- package/node_modules/zod/src/v4/locales/ur.ts +25 -27
- package/node_modules/zod/src/v4/locales/uz.ts +120 -0
- package/node_modules/zod/src/v4/locales/vi.ts +24 -27
- package/node_modules/zod/src/v4/locales/yo.ts +129 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +25 -27
- package/node_modules/zod/src/v4/locales/zh-TW.ts +22 -27
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +5 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +15 -3
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/iso.ts +8 -4
- package/node_modules/zod/src/v4/mini/parse.ts +16 -1
- package/node_modules/zod/src/v4/mini/schemas.ts +586 -114
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +63 -2
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +12 -18
- 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 +24 -5
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +7 -36
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +281 -6
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +15 -1
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +116 -9
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +68 -2
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +98 -1
- package/node_modules/zod/src/v4-mini/index.ts +3 -1
- package/node_modules/zod/v3/ZodError.cjs +42 -13
- package/node_modules/zod/v3/ZodError.d.cts +6 -6
- package/node_modules/zod/v3/ZodError.d.ts +6 -6
- package/node_modules/zod/v3/ZodError.js +23 -13
- 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/locales/en.cjs +1 -0
- package/node_modules/zod/v3/locales/en.d.cts +1 -1
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +28 -5
- package/node_modules/zod/v3/types.d.cts +4 -1
- package/node_modules/zod/v3/types.d.ts +4 -1
- package/node_modules/zod/v3/types.js +9 -5
- package/node_modules/zod/v4/classic/checks.cjs +22 -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 +24 -1
- package/node_modules/zod/v4/classic/compat.d.cts +13 -11
- package/node_modules/zod/v4/classic/compat.d.ts +13 -11
- package/node_modules/zod/v4/classic/compat.js +4 -0
- 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 +63 -28
- 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 +45 -29
- package/node_modules/zod/v4/classic/external.cjs +55 -28
- package/node_modules/zod/v4/classic/external.d.cts +8 -2
- package/node_modules/zod/v4/classic/external.d.ts +8 -2
- package/node_modules/zod/v4/classic/external.js +7 -8
- package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
- 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/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +32 -1
- package/node_modules/zod/v4/classic/parse.d.cts +21 -0
- package/node_modules/zod/v4/classic/parse.d.ts +21 -0
- package/node_modules/zod/v4/classic/parse.js +10 -0
- package/node_modules/zod/v4/classic/schemas.cjs +805 -238
- package/node_modules/zod/v4/classic/schemas.d.cts +241 -55
- package/node_modules/zod/v4/classic/schemas.d.ts +241 -55
- package/node_modules/zod/v4/classic/schemas.js +766 -237
- package/node_modules/zod/v4/core/api.cjs +284 -54
- package/node_modules/zod/v4/core/api.d.cts +133 -82
- package/node_modules/zod/v4/core/api.d.ts +133 -82
- package/node_modules/zod/v4/core/api.js +255 -54
- package/node_modules/zod/v4/core/checks.cjs +100 -130
- package/node_modules/zod/v4/core/checks.d.cts +32 -16
- package/node_modules/zod/v4/core/checks.d.ts +32 -16
- package/node_modules/zod/v4/core/checks.js +80 -129
- package/node_modules/zod/v4/core/compile.cjs +1916 -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 +1866 -0
- package/node_modules/zod/v4/core/core.cjs +120 -20
- package/node_modules/zod/v4/core/core.d.cts +40 -7
- package/node_modules/zod/v4/core/core.d.ts +40 -7
- package/node_modules/zod/v4/core/core.js +101 -21
- package/node_modules/zod/v4/core/doc.cjs +31 -9
- package/node_modules/zod/v4/core/doc.d.cts +4 -2
- package/node_modules/zod/v4/core/doc.d.ts +4 -2
- package/node_modules/zod/v4/core/doc.js +12 -9
- package/node_modules/zod/v4/core/errors.cjs +151 -60
- package/node_modules/zod/v4/core/errors.d.cts +41 -24
- package/node_modules/zod/v4/core/errors.d.ts +41 -24
- package/node_modules/zod/v4/core/errors.js +132 -60
- package/node_modules/zod/v4/core/index.cjs +28 -2
- package/node_modules/zod/v4/core/index.d.cts +5 -1
- package/node_modules/zod/v4/core/index.d.ts +5 -1
- package/node_modules/zod/v4/core/index.js +5 -1
- package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +6 -4
- package/node_modules/zod/v4/core/json-schema.d.ts +6 -4
- 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/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +183 -37
- package/node_modules/zod/v4/core/parse.d.cts +34 -7
- package/node_modules/zod/v4/core/parse.d.ts +34 -7
- package/node_modules/zod/v4/core/parse.js +154 -36
- package/node_modules/zod/v4/core/regexes.cjs +137 -31
- package/node_modules/zod/v4/core/regexes.d.cts +30 -2
- package/node_modules/zod/v4/core/regexes.d.ts +30 -2
- package/node_modules/zod/v4/core/regexes.js +90 -29
- package/node_modules/zod/v4/core/registries.cjs +26 -7
- package/node_modules/zod/v4/core/registries.d.cts +2 -2
- package/node_modules/zod/v4/core/registries.d.ts +2 -2
- package/node_modules/zod/v4/core/registries.js +9 -9
- package/node_modules/zod/v4/core/schemas.cjs +1373 -422
- package/node_modules/zod/v4/core/schemas.d.cts +276 -42
- package/node_modules/zod/v4/core/schemas.d.ts +276 -42
- package/node_modules/zod/v4/core/schemas.js +1341 -422
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +90 -19
- package/node_modules/zod/v4/core/standard-schema.d.ts +90 -19
- package/node_modules/zod/v4/core/to-json-schema.cjs +628 -801
- package/node_modules/zod/v4/core/to-json-schema.d.cts +103 -37
- package/node_modules/zod/v4/core/to-json-schema.d.ts +103 -37
- package/node_modules/zod/v4/core/to-json-schema.js +602 -800
- package/node_modules/zod/v4/core/util.cjs +580 -155
- package/node_modules/zod/v4/core/util.d.cts +98 -1
- package/node_modules/zod/v4/core/util.d.ts +98 -1
- package/node_modules/zod/v4/core/util.js +536 -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 +20 -24
- package/node_modules/zod/v4/locales/ar.d.cts +2 -1
- package/node_modules/zod/v4/locales/ar.js +19 -24
- package/node_modules/zod/v4/locales/az.cjs +20 -24
- package/node_modules/zod/v4/locales/az.d.cts +2 -1
- package/node_modules/zod/v4/locales/az.js +19 -24
- package/node_modules/zod/v4/locales/be.cjs +29 -24
- package/node_modules/zod/v4/locales/be.d.cts +2 -1
- package/node_modules/zod/v4/locales/be.js +28 -24
- package/node_modules/zod/v4/locales/bg.cjs +152 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +125 -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 +20 -25
- package/node_modules/zod/v4/locales/ca.d.cts +2 -1
- package/node_modules/zod/v4/locales/ca.js +19 -25
- 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 +24 -42
- package/node_modules/zod/v4/locales/cs.d.cts +2 -1
- package/node_modules/zod/v4/locales/cs.js +23 -42
- package/node_modules/zod/v4/locales/da.cjs +147 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +120 -0
- package/node_modules/zod/v4/locales/de.cjs +22 -24
- package/node_modules/zod/v4/locales/de.d.cts +2 -1
- package/node_modules/zod/v4/locales/de.js +21 -24
- package/node_modules/zod/v4/locales/el.cjs +139 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +112 -0
- package/node_modules/zod/v4/locales/en.cjs +35 -28
- package/node_modules/zod/v4/locales/en.d.cts +2 -2
- package/node_modules/zod/v4/locales/en.d.ts +0 -1
- package/node_modules/zod/v4/locales/en.js +34 -26
- package/node_modules/zod/v4/locales/eo.cjs +23 -26
- package/node_modules/zod/v4/locales/eo.d.cts +2 -2
- package/node_modules/zod/v4/locales/eo.d.ts +0 -1
- package/node_modules/zod/v4/locales/eo.js +22 -24
- package/node_modules/zod/v4/locales/es.cjs +51 -31
- package/node_modules/zod/v4/locales/es.d.cts +2 -1
- package/node_modules/zod/v4/locales/es.js +50 -31
- package/node_modules/zod/v4/locales/fa.cjs +22 -24
- package/node_modules/zod/v4/locales/fa.d.cts +2 -1
- package/node_modules/zod/v4/locales/fa.js +21 -24
- package/node_modules/zod/v4/locales/fi.cjs +20 -24
- package/node_modules/zod/v4/locales/fi.d.cts +2 -1
- package/node_modules/zod/v4/locales/fi.js +19 -24
- package/node_modules/zod/v4/locales/fr-CA.cjs +20 -24
- package/node_modules/zod/v4/locales/fr-CA.d.cts +2 -1
- package/node_modules/zod/v4/locales/fr-CA.js +19 -24
- package/node_modules/zod/v4/locales/fr.cjs +53 -39
- package/node_modules/zod/v4/locales/fr.d.cts +2 -1
- package/node_modules/zod/v4/locales/fr.js +52 -39
- 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 +183 -78
- package/node_modules/zod/v4/locales/he.d.cts +2 -1
- package/node_modules/zod/v4/locales/he.js +182 -78
- 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 +153 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +126 -0
- package/node_modules/zod/v4/locales/hu.cjs +22 -25
- package/node_modules/zod/v4/locales/hu.d.cts +2 -1
- package/node_modules/zod/v4/locales/hu.js +21 -25
- package/node_modules/zod/v4/locales/hy.cjs +185 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +158 -0
- package/node_modules/zod/v4/locales/id.cjs +20 -24
- package/node_modules/zod/v4/locales/id.d.cts +2 -1
- package/node_modules/zod/v4/locales/id.js +19 -24
- package/node_modules/zod/v4/locales/index.cjs +69 -1
- package/node_modules/zod/v4/locales/index.d.cts +24 -0
- package/node_modules/zod/v4/locales/index.d.ts +24 -0
- package/node_modules/zod/v4/locales/index.js +24 -0
- package/node_modules/zod/v4/locales/is.cjs +141 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +114 -0
- package/node_modules/zod/v4/locales/it.cjs +22 -25
- package/node_modules/zod/v4/locales/it.d.cts +2 -1
- package/node_modules/zod/v4/locales/it.js +21 -25
- package/node_modules/zod/v4/locales/ja.cjs +22 -24
- package/node_modules/zod/v4/locales/ja.d.cts +2 -1
- package/node_modules/zod/v4/locales/ja.js +21 -24
- package/node_modules/zod/v4/locales/ka.cjs +144 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +117 -0
- package/node_modules/zod/v4/locales/kh.cjs +6 -137
- package/node_modules/zod/v4/locales/kh.d.cts +2 -1
- package/node_modules/zod/v4/locales/kh.d.ts +1 -0
- package/node_modules/zod/v4/locales/kh.js +3 -115
- package/node_modules/zod/v4/locales/km.cjs +142 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +115 -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 +20 -24
- package/node_modules/zod/v4/locales/ko.d.cts +2 -1
- package/node_modules/zod/v4/locales/ko.js +19 -24
- package/node_modules/zod/v4/locales/lt.cjs +234 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +207 -0
- package/node_modules/zod/v4/locales/mk.cjs +22 -25
- package/node_modules/zod/v4/locales/mk.d.cts +2 -1
- package/node_modules/zod/v4/locales/mk.js +21 -25
- package/node_modules/zod/v4/locales/ms.cjs +21 -24
- package/node_modules/zod/v4/locales/ms.d.cts +2 -1
- package/node_modules/zod/v4/locales/ms.js +20 -24
- 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 +31 -32
- package/node_modules/zod/v4/locales/nl.d.cts +2 -1
- package/node_modules/zod/v4/locales/nl.js +30 -32
- 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 +24 -26
- package/node_modules/zod/v4/locales/no.d.cts +2 -1
- package/node_modules/zod/v4/locales/no.js +23 -26
- package/node_modules/zod/v4/locales/ota.cjs +23 -25
- package/node_modules/zod/v4/locales/ota.d.cts +2 -1
- package/node_modules/zod/v4/locales/ota.js +22 -25
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +22 -24
- package/node_modules/zod/v4/locales/pl.d.cts +2 -1
- package/node_modules/zod/v4/locales/pl.js +21 -24
- package/node_modules/zod/v4/locales/ps.cjs +22 -24
- package/node_modules/zod/v4/locales/ps.d.cts +2 -1
- package/node_modules/zod/v4/locales/ps.js +21 -24
- 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 +95 -68
- package/node_modules/zod/v4/locales/pt.d.cts +2 -1
- package/node_modules/zod/v4/locales/pt.js +94 -68
- package/node_modules/zod/v4/locales/ro.cjs +149 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +122 -0
- package/node_modules/zod/v4/locales/ru.cjs +29 -24
- package/node_modules/zod/v4/locales/ru.d.cts +2 -1
- package/node_modules/zod/v4/locales/ru.js +28 -24
- 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 +22 -24
- package/node_modules/zod/v4/locales/sl.d.cts +2 -1
- package/node_modules/zod/v4/locales/sl.js +21 -24
- package/node_modules/zod/v4/locales/sv.cjs +24 -26
- package/node_modules/zod/v4/locales/sv.d.cts +2 -1
- package/node_modules/zod/v4/locales/sv.js +23 -26
- package/node_modules/zod/v4/locales/ta.cjs +23 -24
- package/node_modules/zod/v4/locales/ta.d.cts +2 -1
- package/node_modules/zod/v4/locales/ta.js +22 -24
- 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 +23 -24
- package/node_modules/zod/v4/locales/th.d.cts +2 -1
- package/node_modules/zod/v4/locales/th.js +22 -24
- 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 +20 -26
- package/node_modules/zod/v4/locales/tr.d.cts +2 -2
- package/node_modules/zod/v4/locales/tr.d.ts +0 -1
- package/node_modules/zod/v4/locales/tr.js +19 -24
- package/node_modules/zod/v4/locales/ua.cjs +6 -137
- package/node_modules/zod/v4/locales/ua.d.cts +2 -1
- package/node_modules/zod/v4/locales/ua.d.ts +1 -0
- package/node_modules/zod/v4/locales/ua.js +3 -115
- package/node_modules/zod/v4/locales/uk.cjs +140 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +113 -0
- package/node_modules/zod/v4/locales/ur.cjs +23 -24
- package/node_modules/zod/v4/locales/ur.d.cts +2 -1
- package/node_modules/zod/v4/locales/ur.js +22 -24
- package/node_modules/zod/v4/locales/uz.cjs +140 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +113 -0
- package/node_modules/zod/v4/locales/vi.cjs +22 -24
- package/node_modules/zod/v4/locales/vi.d.cts +2 -1
- package/node_modules/zod/v4/locales/vi.js +21 -24
- package/node_modules/zod/v4/locales/yo.cjs +139 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +112 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +23 -24
- package/node_modules/zod/v4/locales/zh-CN.d.cts +2 -1
- package/node_modules/zod/v4/locales/zh-CN.js +22 -24
- package/node_modules/zod/v4/locales/zh-TW.cjs +20 -24
- package/node_modules/zod/v4/locales/zh-TW.d.cts +2 -1
- package/node_modules/zod/v4/locales/zh-TW.js +19 -24
- 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 +24 -0
- package/node_modules/zod/v4/mini/coerce.js +5 -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 +36 -3
- package/node_modules/zod/v4/mini/external.d.cts +7 -2
- package/node_modules/zod/v4/mini/external.d.ts +7 -2
- package/node_modules/zod/v4/mini/external.js +4 -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 +27 -4
- package/node_modules/zod/v4/mini/iso.js +8 -4
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +30 -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 +390 -82
- package/node_modules/zod/v4/mini/schemas.d.cts +156 -32
- package/node_modules/zod/v4/mini/schemas.d.ts +156 -32
- package/node_modules/zod/v4/mini/schemas.js +329 -59
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +35 -1
- package/node_modules/zod/v4-mini/index.d.cts +3 -1
- package/node_modules/zod/v4-mini/index.d.ts +3 -1
- package/node_modules/zod/v4-mini/index.js +3 -1
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/package.json +6 -3
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- package/node_modules/zod/src/v4/core/function.ts +0 -176
- package/node_modules/zod/v4/core/function.cjs +0 -102
- package/node_modules/zod/v4/core/function.d.cts +0 -52
- package/node_modules/zod/v4/core/function.d.ts +0 -52
- package/node_modules/zod/v4/core/function.js +0 -75
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as core from "../core/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { $ZodBigIntFormats } from "../core/index.js";
|
|
3
|
+
import * as regexes from "../core/regexes.js";
|
|
4
|
+
import * as util from "../core/util.js";
|
|
3
5
|
import * as parse from "./parse.js";
|
|
4
6
|
|
|
5
7
|
type SomeType = core.SomeType;
|
|
@@ -9,7 +11,9 @@ export interface ZodMiniType<
|
|
|
9
11
|
out Input = unknown,
|
|
10
12
|
out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>,
|
|
11
13
|
> extends core.$ZodType<Output, Input, Internals> {
|
|
14
|
+
type: Internals["def"]["type"];
|
|
12
15
|
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
|
|
16
|
+
with(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
|
|
13
17
|
clone(def?: Internals["def"], params?: { parent: boolean }): this;
|
|
14
18
|
register<R extends core.$ZodRegistry>(
|
|
15
19
|
registry: R,
|
|
@@ -19,9 +23,9 @@ export interface ZodMiniType<
|
|
|
19
23
|
: [core.$replace<R["_meta"], this>]
|
|
20
24
|
: ["Incompatible schema"]
|
|
21
25
|
): this;
|
|
22
|
-
brand<T extends PropertyKey = PropertyKey>(
|
|
26
|
+
brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(
|
|
23
27
|
value?: T
|
|
24
|
-
): PropertyKey extends T ? this : this
|
|
28
|
+
): PropertyKey extends T ? this : core.$ZodBranded<this, T, Dir>;
|
|
25
29
|
|
|
26
30
|
def: Internals["def"];
|
|
27
31
|
|
|
@@ -32,24 +36,45 @@ export interface ZodMiniType<
|
|
|
32
36
|
data: unknown,
|
|
33
37
|
params?: core.ParseContext<core.$ZodIssue>
|
|
34
38
|
): Promise<util.SafeParseResult<core.output<this>>>;
|
|
39
|
+
apply<T, TArgs extends unknown[] = []>(fn: (schema: this, ...args: TArgs) => T, ...args: TArgs): T;
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
interface _ZodMiniType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals>
|
|
38
43
|
extends ZodMiniType<any, any, Internals> {}
|
|
39
44
|
|
|
40
|
-
export const ZodMiniType: core.$constructor<ZodMiniType> = /*@__PURE__*/ core.$constructor(
|
|
45
|
+
export const ZodMiniType: core.$constructor<ZodMiniType> = /*@__PURE__*/ core.$constructor<ZodMiniType>(
|
|
41
46
|
"ZodMiniType",
|
|
42
47
|
(inst, def) => {
|
|
43
48
|
if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
|
|
44
49
|
|
|
45
50
|
core.$ZodType.init(inst, def);
|
|
51
|
+
|
|
46
52
|
inst.def = def;
|
|
47
|
-
inst.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return
|
|
53
|
+
inst.type = def.type;
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
// `with` is an alias for `check`: the same function object, not a wrapper.
|
|
57
|
+
get with(): ZodMiniType["check"] {
|
|
58
|
+
return this.check;
|
|
59
|
+
},
|
|
60
|
+
set with(value: ZodMiniType["check"]) {
|
|
61
|
+
util.own(this, "with", value);
|
|
62
|
+
},
|
|
63
|
+
parse(data, params) {
|
|
64
|
+
return parse.parse(this, data, params, { callee: this.parse });
|
|
65
|
+
},
|
|
66
|
+
parseAsync(data, params) {
|
|
67
|
+
return parse.parseAsync(this, data, params, { callee: this.parseAsync });
|
|
68
|
+
},
|
|
69
|
+
safeParse(data, params) {
|
|
70
|
+
return parse.safeParse(this, data, params);
|
|
71
|
+
},
|
|
72
|
+
safeParseAsync(data, params) {
|
|
73
|
+
return parse.safeParseAsync(this, data, params);
|
|
74
|
+
},
|
|
75
|
+
check(...checks) {
|
|
76
|
+
const def = this.def;
|
|
77
|
+
return this.clone(
|
|
53
78
|
{
|
|
54
79
|
...def,
|
|
55
80
|
checks: [
|
|
@@ -58,16 +83,23 @@ export const ZodMiniType: core.$constructor<ZodMiniType> = /*@__PURE__*/ core.$c
|
|
|
58
83
|
typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch
|
|
59
84
|
),
|
|
60
85
|
],
|
|
61
|
-
}
|
|
62
|
-
|
|
86
|
+
},
|
|
87
|
+
{ parent: true }
|
|
63
88
|
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
}
|
|
89
|
+
},
|
|
90
|
+
clone(_def, params) {
|
|
91
|
+
return core.clone(this, _def, params);
|
|
92
|
+
},
|
|
93
|
+
brand() {
|
|
94
|
+
return this as any;
|
|
95
|
+
},
|
|
96
|
+
register(reg: any, meta: any): any {
|
|
97
|
+
reg.add(this, meta);
|
|
98
|
+
return this;
|
|
99
|
+
},
|
|
100
|
+
apply(fn: any, ...args: any[]) {
|
|
101
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
102
|
+
},
|
|
71
103
|
}
|
|
72
104
|
);
|
|
73
105
|
|
|
@@ -89,6 +121,7 @@ export const ZodMiniString: core.$constructor<ZodMiniString> = /*@__PURE__*/ cor
|
|
|
89
121
|
}
|
|
90
122
|
);
|
|
91
123
|
|
|
124
|
+
// @__NO_SIDE_EFFECTS__
|
|
92
125
|
export function string(params?: string | core.$ZodStringParams): ZodMiniString<string> {
|
|
93
126
|
return core._string(ZodMiniString, params) as any;
|
|
94
127
|
}
|
|
@@ -117,6 +150,7 @@ export const ZodMiniEmail: core.$constructor<ZodMiniEmail> = /*@__PURE__*/ core.
|
|
|
117
150
|
}
|
|
118
151
|
);
|
|
119
152
|
|
|
153
|
+
// @__NO_SIDE_EFFECTS__
|
|
120
154
|
export function email(params?: string | core.$ZodEmailParams): ZodMiniEmail {
|
|
121
155
|
return core._email(ZodMiniEmail, params);
|
|
122
156
|
}
|
|
@@ -133,6 +167,7 @@ export const ZodMiniGUID: core.$constructor<ZodMiniGUID> = /*@__PURE__*/ core.$c
|
|
|
133
167
|
}
|
|
134
168
|
);
|
|
135
169
|
|
|
170
|
+
// @__NO_SIDE_EFFECTS__
|
|
136
171
|
export function guid(params?: string | core.$ZodGUIDParams): ZodMiniGUID {
|
|
137
172
|
return core._guid(ZodMiniGUID, params);
|
|
138
173
|
}
|
|
@@ -149,22 +184,26 @@ export const ZodMiniUUID: core.$constructor<ZodMiniUUID> = /*@__PURE__*/ core.$c
|
|
|
149
184
|
}
|
|
150
185
|
);
|
|
151
186
|
|
|
187
|
+
// @__NO_SIDE_EFFECTS__
|
|
152
188
|
export function uuid(params?: string | core.$ZodUUIDParams): ZodMiniUUID {
|
|
153
189
|
return core._uuid(ZodMiniUUID, params);
|
|
154
190
|
}
|
|
155
191
|
|
|
192
|
+
// @__NO_SIDE_EFFECTS__
|
|
156
193
|
export function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodMiniUUID {
|
|
157
194
|
return core._uuidv4(ZodMiniUUID, params);
|
|
158
195
|
}
|
|
159
196
|
|
|
160
197
|
// ZodMiniUUIDv6
|
|
161
198
|
|
|
199
|
+
// @__NO_SIDE_EFFECTS__
|
|
162
200
|
export function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodMiniUUID {
|
|
163
201
|
return core._uuidv6(ZodMiniUUID, params);
|
|
164
202
|
}
|
|
165
203
|
|
|
166
204
|
// ZodMiniUUIDv7
|
|
167
205
|
|
|
206
|
+
// @__NO_SIDE_EFFECTS__
|
|
168
207
|
export function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodMiniUUID {
|
|
169
208
|
return core._uuidv7(ZodMiniUUID, params);
|
|
170
209
|
}
|
|
@@ -178,10 +217,20 @@ export const ZodMiniURL: core.$constructor<ZodMiniURL> = /*@__PURE__*/ core.$con
|
|
|
178
217
|
ZodMiniStringFormat.init(inst, def);
|
|
179
218
|
});
|
|
180
219
|
|
|
220
|
+
// @__NO_SIDE_EFFECTS__
|
|
181
221
|
export function url(params?: string | core.$ZodURLParams): ZodMiniURL {
|
|
182
222
|
return core._url(ZodMiniURL, params);
|
|
183
223
|
}
|
|
184
224
|
|
|
225
|
+
// @__NO_SIDE_EFFECTS__
|
|
226
|
+
export function httpUrl(params?: string | Omit<core.$ZodURLParams, "protocol" | "hostname">): ZodMiniURL {
|
|
227
|
+
return core._url(ZodMiniURL, {
|
|
228
|
+
protocol: regexes.httpProtocol,
|
|
229
|
+
hostname: regexes.domain,
|
|
230
|
+
...util.normalizeParams(params),
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
|
|
185
234
|
// ZodMiniEmoji
|
|
186
235
|
export interface ZodMiniEmoji extends _ZodMiniString<core.$ZodEmojiInternals> {
|
|
187
236
|
// _zod: core.$ZodEmojiInternals;
|
|
@@ -194,6 +243,7 @@ export const ZodMiniEmoji: core.$constructor<ZodMiniEmoji> = /*@__PURE__*/ core.
|
|
|
194
243
|
}
|
|
195
244
|
);
|
|
196
245
|
|
|
246
|
+
// @__NO_SIDE_EFFECTS__
|
|
197
247
|
export function emoji(params?: string | core.$ZodEmojiParams): ZodMiniEmoji {
|
|
198
248
|
return core._emoji(ZodMiniEmoji, params);
|
|
199
249
|
}
|
|
@@ -210,14 +260,25 @@ export const ZodMiniNanoID: core.$constructor<ZodMiniNanoID> = /*@__PURE__*/ cor
|
|
|
210
260
|
}
|
|
211
261
|
);
|
|
212
262
|
|
|
263
|
+
// @__NO_SIDE_EFFECTS__
|
|
213
264
|
export function nanoid(params?: string | core.$ZodNanoIDParams): ZodMiniNanoID {
|
|
214
265
|
return core._nanoid(ZodMiniNanoID, params);
|
|
215
266
|
}
|
|
216
267
|
|
|
217
268
|
// ZodMiniCUID
|
|
269
|
+
/**
|
|
270
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
271
|
+
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
|
|
272
|
+
* See https://github.com/paralleldrive/cuid.
|
|
273
|
+
*/
|
|
218
274
|
export interface ZodMiniCUID extends _ZodMiniString<core.$ZodCUIDInternals> {
|
|
219
275
|
// _zod: core.$ZodCUIDInternals;
|
|
220
276
|
}
|
|
277
|
+
/**
|
|
278
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
279
|
+
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
|
|
280
|
+
* See https://github.com/paralleldrive/cuid.
|
|
281
|
+
*/
|
|
221
282
|
export const ZodMiniCUID: core.$constructor<ZodMiniCUID> = /*@__PURE__*/ core.$constructor(
|
|
222
283
|
"ZodMiniCUID",
|
|
223
284
|
(inst, def) => {
|
|
@@ -226,6 +287,14 @@ export const ZodMiniCUID: core.$constructor<ZodMiniCUID> = /*@__PURE__*/ core.$c
|
|
|
226
287
|
}
|
|
227
288
|
);
|
|
228
289
|
|
|
290
|
+
/**
|
|
291
|
+
* Validates a CUID v1 string.
|
|
292
|
+
*
|
|
293
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
294
|
+
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
|
|
295
|
+
* See https://github.com/paralleldrive/cuid.
|
|
296
|
+
*/
|
|
297
|
+
// @__NO_SIDE_EFFECTS__
|
|
229
298
|
export function cuid(params?: string | core.$ZodCUIDParams): ZodMiniCUID {
|
|
230
299
|
return core._cuid(ZodMiniCUID, params);
|
|
231
300
|
}
|
|
@@ -242,6 +311,7 @@ export const ZodMiniCUID2: core.$constructor<ZodMiniCUID2> = /*@__PURE__*/ core.
|
|
|
242
311
|
}
|
|
243
312
|
);
|
|
244
313
|
|
|
314
|
+
// @__NO_SIDE_EFFECTS__
|
|
245
315
|
export function cuid2(params?: string | core.$ZodCUID2Params): ZodMiniCUID2 {
|
|
246
316
|
return core._cuid2(ZodMiniCUID2, params);
|
|
247
317
|
}
|
|
@@ -258,6 +328,7 @@ export const ZodMiniULID: core.$constructor<ZodMiniULID> = /*@__PURE__*/ core.$c
|
|
|
258
328
|
}
|
|
259
329
|
);
|
|
260
330
|
|
|
331
|
+
// @__NO_SIDE_EFFECTS__
|
|
261
332
|
export function ulid(params?: string | core.$ZodULIDParams): ZodMiniULID {
|
|
262
333
|
return core._ulid(ZodMiniULID, params);
|
|
263
334
|
}
|
|
@@ -271,6 +342,7 @@ export const ZodMiniXID: core.$constructor<ZodMiniXID> = /*@__PURE__*/ core.$con
|
|
|
271
342
|
ZodMiniStringFormat.init(inst, def);
|
|
272
343
|
});
|
|
273
344
|
|
|
345
|
+
// @__NO_SIDE_EFFECTS__
|
|
274
346
|
export function xid(params?: string | core.$ZodXIDParams): ZodMiniXID {
|
|
275
347
|
return core._xid(ZodMiniXID, params);
|
|
276
348
|
}
|
|
@@ -287,6 +359,7 @@ export const ZodMiniKSUID: core.$constructor<ZodMiniKSUID> = /*@__PURE__*/ core.
|
|
|
287
359
|
}
|
|
288
360
|
);
|
|
289
361
|
|
|
362
|
+
// @__NO_SIDE_EFFECTS__
|
|
290
363
|
export function ksuid(params?: string | core.$ZodKSUIDParams): ZodMiniKSUID {
|
|
291
364
|
return core._ksuid(ZodMiniKSUID, params);
|
|
292
365
|
}
|
|
@@ -303,6 +376,7 @@ export const ZodMiniIPv4: core.$constructor<ZodMiniIPv4> = /*@__PURE__*/ core.$c
|
|
|
303
376
|
}
|
|
304
377
|
);
|
|
305
378
|
|
|
379
|
+
// @__NO_SIDE_EFFECTS__
|
|
306
380
|
export function ipv4(params?: string | core.$ZodIPv4Params): ZodMiniIPv4 {
|
|
307
381
|
return core._ipv4(ZodMiniIPv4, params);
|
|
308
382
|
}
|
|
@@ -319,6 +393,7 @@ export const ZodMiniIPv6: core.$constructor<ZodMiniIPv6> = /*@__PURE__*/ core.$c
|
|
|
319
393
|
}
|
|
320
394
|
);
|
|
321
395
|
|
|
396
|
+
// @__NO_SIDE_EFFECTS__
|
|
322
397
|
export function ipv6(params?: string | core.$ZodIPv6Params): ZodMiniIPv6 {
|
|
323
398
|
return core._ipv6(ZodMiniIPv6, params);
|
|
324
399
|
}
|
|
@@ -335,6 +410,7 @@ export const ZodMiniCIDRv4: core.$constructor<ZodMiniCIDRv4> = /*@__PURE__*/ cor
|
|
|
335
410
|
}
|
|
336
411
|
);
|
|
337
412
|
|
|
413
|
+
// @__NO_SIDE_EFFECTS__
|
|
338
414
|
export function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodMiniCIDRv4 {
|
|
339
415
|
return core._cidrv4(ZodMiniCIDRv4, params);
|
|
340
416
|
}
|
|
@@ -351,10 +427,25 @@ export const ZodMiniCIDRv6: core.$constructor<ZodMiniCIDRv6> = /*@__PURE__*/ cor
|
|
|
351
427
|
}
|
|
352
428
|
);
|
|
353
429
|
|
|
430
|
+
// @__NO_SIDE_EFFECTS__
|
|
354
431
|
export function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodMiniCIDRv6 {
|
|
355
432
|
return core._cidrv6(ZodMiniCIDRv6, params);
|
|
356
433
|
}
|
|
357
434
|
|
|
435
|
+
// ZodMiniMAC
|
|
436
|
+
export interface ZodMiniMAC extends _ZodMiniString<core.$ZodMACInternals> {
|
|
437
|
+
// _zod: core.$ZodMACInternals;
|
|
438
|
+
}
|
|
439
|
+
export const ZodMiniMAC: core.$constructor<ZodMiniMAC> = /*@__PURE__*/ core.$constructor("ZodMiniMAC", (inst, def) => {
|
|
440
|
+
core.$ZodMAC.init(inst, def);
|
|
441
|
+
ZodMiniStringFormat.init(inst, def);
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
// @__NO_SIDE_EFFECTS__
|
|
445
|
+
export function mac(params?: string | core.$ZodMACParams): ZodMiniMAC {
|
|
446
|
+
return core._mac(ZodMiniMAC, params);
|
|
447
|
+
}
|
|
448
|
+
|
|
358
449
|
// ZodMiniBase64
|
|
359
450
|
export interface ZodMiniBase64 extends _ZodMiniString<core.$ZodBase64Internals> {
|
|
360
451
|
// _zod: core.$ZodBase64Internals;
|
|
@@ -366,6 +457,7 @@ export const ZodMiniBase64: core.$constructor<ZodMiniBase64> = /*@__PURE__*/ cor
|
|
|
366
457
|
ZodMiniStringFormat.init(inst, def);
|
|
367
458
|
}
|
|
368
459
|
);
|
|
460
|
+
// @__NO_SIDE_EFFECTS__
|
|
369
461
|
export function base64(params?: string | core.$ZodBase64Params): ZodMiniBase64 {
|
|
370
462
|
return core._base64(ZodMiniBase64, params);
|
|
371
463
|
}
|
|
@@ -381,6 +473,7 @@ export const ZodMiniBase64URL: core.$constructor<ZodMiniBase64URL> = /*@__PURE__
|
|
|
381
473
|
ZodMiniStringFormat.init(inst, def);
|
|
382
474
|
}
|
|
383
475
|
);
|
|
476
|
+
// @__NO_SIDE_EFFECTS__
|
|
384
477
|
export function base64url(params?: string | core.$ZodBase64URLParams): ZodMiniBase64URL {
|
|
385
478
|
return core._base64url(ZodMiniBase64URL, params);
|
|
386
479
|
}
|
|
@@ -397,10 +490,41 @@ export const ZodMiniE164: core.$constructor<ZodMiniE164> = /*@__PURE__*/ core.$c
|
|
|
397
490
|
}
|
|
398
491
|
);
|
|
399
492
|
|
|
493
|
+
// @__NO_SIDE_EFFECTS__
|
|
400
494
|
export function e164(params?: string | core.$ZodE164Params): ZodMiniE164 {
|
|
401
495
|
return core._e164(ZodMiniE164, params);
|
|
402
496
|
}
|
|
403
497
|
|
|
498
|
+
// ZodMiniCreditCard
|
|
499
|
+
export interface ZodMiniCreditCard extends _ZodMiniString<core.$ZodCreditCardInternals> {}
|
|
500
|
+
export const ZodMiniCreditCard: core.$constructor<ZodMiniCreditCard> = /*@__PURE__*/ core.$constructor(
|
|
501
|
+
"ZodMiniCreditCard",
|
|
502
|
+
(inst, def) => {
|
|
503
|
+
core.$ZodCreditCard.init(inst, def);
|
|
504
|
+
ZodMiniStringFormat.init(inst, def);
|
|
505
|
+
}
|
|
506
|
+
);
|
|
507
|
+
|
|
508
|
+
// @__NO_SIDE_EFFECTS__
|
|
509
|
+
export function creditCard(params?: string | core.$ZodCreditCardParams): ZodMiniCreditCard {
|
|
510
|
+
return core._creditCard(ZodMiniCreditCard, params);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// ZodMiniIBAN
|
|
514
|
+
export interface ZodMiniIBAN extends _ZodMiniString<core.$ZodIBANInternals> {}
|
|
515
|
+
export const ZodMiniIBAN: core.$constructor<ZodMiniIBAN> = /*@__PURE__*/ core.$constructor(
|
|
516
|
+
"ZodMiniIBAN",
|
|
517
|
+
(inst, def) => {
|
|
518
|
+
core.$ZodIBAN.init(inst, def);
|
|
519
|
+
ZodMiniStringFormat.init(inst, def);
|
|
520
|
+
}
|
|
521
|
+
);
|
|
522
|
+
|
|
523
|
+
// @__NO_SIDE_EFFECTS__
|
|
524
|
+
export function iban(params?: string | core.$ZodIBANParams): ZodMiniIBAN {
|
|
525
|
+
return core._iban(ZodMiniIBAN, params);
|
|
526
|
+
}
|
|
527
|
+
|
|
404
528
|
// ZodMiniJWT
|
|
405
529
|
export interface ZodMiniJWT extends _ZodMiniString<core.$ZodJWTInternals> {
|
|
406
530
|
// _zod: core.$ZodJWTInternals;
|
|
@@ -410,6 +534,7 @@ export const ZodMiniJWT: core.$constructor<ZodMiniJWT> = /*@__PURE__*/ core.$con
|
|
|
410
534
|
ZodMiniStringFormat.init(inst, def);
|
|
411
535
|
});
|
|
412
536
|
|
|
537
|
+
// @__NO_SIDE_EFFECTS__
|
|
413
538
|
export function jwt(params?: string | core.$ZodJWTParams): ZodMiniJWT {
|
|
414
539
|
return core._jwt(ZodMiniJWT, params);
|
|
415
540
|
}
|
|
@@ -428,6 +553,7 @@ export const ZodMiniCustomStringFormat: core.$constructor<ZodMiniCustomStringFor
|
|
|
428
553
|
}
|
|
429
554
|
);
|
|
430
555
|
|
|
556
|
+
// @__NO_SIDE_EFFECTS__
|
|
431
557
|
export function stringFormat<Format extends string>(
|
|
432
558
|
format: Format,
|
|
433
559
|
fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp,
|
|
@@ -436,6 +562,38 @@ export function stringFormat<Format extends string>(
|
|
|
436
562
|
return core._stringFormat(ZodMiniCustomStringFormat, format, fnOrRegex, _params) as any;
|
|
437
563
|
}
|
|
438
564
|
|
|
565
|
+
// @__NO_SIDE_EFFECTS__
|
|
566
|
+
export function hostname(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hostname"> {
|
|
567
|
+
return core._stringFormat(ZodMiniCustomStringFormat, "hostname", regexes.hostname, _params) as any;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// @__NO_SIDE_EFFECTS__
|
|
571
|
+
export function hex(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hex"> {
|
|
572
|
+
return core._stringFormat(ZodMiniCustomStringFormat, "hex", regexes.hex, _params) as any;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// @__NO_SIDE_EFFECTS__
|
|
576
|
+
export function currencyCode(
|
|
577
|
+
_params?: string | core.$ZodStringFormatParams
|
|
578
|
+
): ZodMiniCustomStringFormat<"currency_code"> {
|
|
579
|
+
return core._stringFormat(ZodMiniCustomStringFormat, "currency_code", regexes.currencyCode, _params) as any;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
// @__NO_SIDE_EFFECTS__
|
|
583
|
+
export function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(
|
|
584
|
+
alg: Alg,
|
|
585
|
+
params?: {
|
|
586
|
+
enc?: Enc;
|
|
587
|
+
} & core.$ZodStringFormatParams
|
|
588
|
+
): ZodMiniCustomStringFormat<`${Alg}_${Enc}`> {
|
|
589
|
+
const enc = params?.enc ?? "hex";
|
|
590
|
+
const format = `${alg}_${enc}` as const;
|
|
591
|
+
const regex = core.regexes[format as keyof typeof core.regexes] as RegExp;
|
|
592
|
+
// check for unrecognized format
|
|
593
|
+
if (!regex) throw new Error(`Unrecognized hash format: ${format}`);
|
|
594
|
+
return core._stringFormat(ZodMiniCustomStringFormat, format, regex, params) as any;
|
|
595
|
+
}
|
|
596
|
+
|
|
439
597
|
// ZodMiniNumber
|
|
440
598
|
interface _ZodMiniNumber<T extends core.$ZodNumberInternals<unknown> = core.$ZodNumberInternals<unknown>>
|
|
441
599
|
extends _ZodMiniType<T>,
|
|
@@ -453,12 +611,15 @@ export const ZodMiniNumber: core.$constructor<ZodMiniNumber> = /*@__PURE__*/ cor
|
|
|
453
611
|
}
|
|
454
612
|
);
|
|
455
613
|
|
|
614
|
+
// @__NO_SIDE_EFFECTS__
|
|
456
615
|
export function number(params?: string | core.$ZodNumberParams): ZodMiniNumber<number> {
|
|
457
616
|
return core._number(ZodMiniNumber, params) as any;
|
|
458
617
|
}
|
|
459
618
|
|
|
460
619
|
// ZodMiniNumberFormat
|
|
461
|
-
export interface ZodMiniNumberFormat extends
|
|
620
|
+
export interface ZodMiniNumberFormat<Format extends core.$ZodNumberFormats = core.$ZodNumberFormats>
|
|
621
|
+
extends _ZodMiniNumber<core.$ZodNumberFormatInternals<Format>>,
|
|
622
|
+
core.$ZodNumberFormat<Format> {}
|
|
462
623
|
export const ZodMiniNumberFormat: core.$constructor<ZodMiniNumberFormat> = /*@__PURE__*/ core.$constructor(
|
|
463
624
|
"ZodMiniNumberFormat",
|
|
464
625
|
(inst, def) => {
|
|
@@ -469,32 +630,42 @@ export const ZodMiniNumberFormat: core.$constructor<ZodMiniNumberFormat> = /*@__
|
|
|
469
630
|
|
|
470
631
|
// int
|
|
471
632
|
|
|
472
|
-
|
|
473
|
-
|
|
633
|
+
// @__NO_SIDE_EFFECTS__
|
|
634
|
+
export interface ZodMiniInt extends ZodMiniNumberFormat<"safeint"> {}
|
|
635
|
+
export function int(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniInt {
|
|
636
|
+
return core._int(ZodMiniNumberFormat, params) as ZodMiniInt;
|
|
474
637
|
}
|
|
475
638
|
|
|
476
639
|
// float32
|
|
477
640
|
|
|
478
|
-
|
|
479
|
-
|
|
641
|
+
// @__NO_SIDE_EFFECTS__
|
|
642
|
+
export interface ZodMiniFloat32 extends ZodMiniNumberFormat<"float32"> {}
|
|
643
|
+
export function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniFloat32 {
|
|
644
|
+
return core._float32(ZodMiniNumberFormat, params) as ZodMiniFloat32;
|
|
480
645
|
}
|
|
481
646
|
|
|
482
647
|
// float64
|
|
483
648
|
|
|
484
|
-
|
|
485
|
-
|
|
649
|
+
// @__NO_SIDE_EFFECTS__
|
|
650
|
+
export interface ZodMiniFloat64 extends ZodMiniNumberFormat<"float64"> {}
|
|
651
|
+
export function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniFloat64 {
|
|
652
|
+
return core._float64(ZodMiniNumberFormat, params) as ZodMiniFloat64;
|
|
486
653
|
}
|
|
487
654
|
|
|
488
655
|
// int32
|
|
489
656
|
|
|
490
|
-
|
|
491
|
-
|
|
657
|
+
// @__NO_SIDE_EFFECTS__
|
|
658
|
+
export interface ZodMiniInt32 extends ZodMiniNumberFormat<"int32"> {}
|
|
659
|
+
export function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniInt32 {
|
|
660
|
+
return core._int32(ZodMiniNumberFormat, params) as ZodMiniInt32;
|
|
492
661
|
}
|
|
493
662
|
|
|
494
663
|
// uint32
|
|
495
664
|
|
|
496
|
-
|
|
497
|
-
|
|
665
|
+
// @__NO_SIDE_EFFECTS__
|
|
666
|
+
export interface ZodMiniUInt32 extends ZodMiniNumberFormat<"uint32"> {}
|
|
667
|
+
export function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniUInt32 {
|
|
668
|
+
return core._uint32(ZodMiniNumberFormat, params) as ZodMiniUInt32;
|
|
498
669
|
}
|
|
499
670
|
|
|
500
671
|
// ZodMiniBoolean
|
|
@@ -509,6 +680,7 @@ export const ZodMiniBoolean: core.$constructor<ZodMiniBoolean> = /*@__PURE__*/ c
|
|
|
509
680
|
}
|
|
510
681
|
);
|
|
511
682
|
|
|
683
|
+
// @__NO_SIDE_EFFECTS__
|
|
512
684
|
export function boolean(params?: string | core.$ZodBooleanParams): ZodMiniBoolean<boolean> {
|
|
513
685
|
return core._boolean(ZodMiniBoolean, params) as any;
|
|
514
686
|
}
|
|
@@ -525,6 +697,7 @@ export const ZodMiniBigInt: core.$constructor<ZodMiniBigInt> = /*@__PURE__*/ cor
|
|
|
525
697
|
}
|
|
526
698
|
);
|
|
527
699
|
|
|
700
|
+
// @__NO_SIDE_EFFECTS__
|
|
528
701
|
export function bigint(params?: string | core.$ZodBigIntParams): ZodMiniBigInt<bigint> {
|
|
529
702
|
return core._bigint(ZodMiniBigInt, params) as any;
|
|
530
703
|
}
|
|
@@ -532,8 +705,9 @@ export function bigint(params?: string | core.$ZodBigIntParams): ZodMiniBigInt<b
|
|
|
532
705
|
// bigint formats
|
|
533
706
|
|
|
534
707
|
// ZodMiniBigIntFormat
|
|
535
|
-
export interface ZodMiniBigIntFormat extends
|
|
536
|
-
|
|
708
|
+
export interface ZodMiniBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats>
|
|
709
|
+
extends _ZodMiniType<core.$ZodBigIntFormatInternals<Format>> {
|
|
710
|
+
// _zod: core.$ZodBigIntFormatInternals<Format>;
|
|
537
711
|
}
|
|
538
712
|
export const ZodMiniBigIntFormat: core.$constructor<ZodMiniBigIntFormat> = /*@__PURE__*/ core.$constructor(
|
|
539
713
|
"ZodMiniBigIntFormat",
|
|
@@ -545,14 +719,18 @@ export const ZodMiniBigIntFormat: core.$constructor<ZodMiniBigIntFormat> = /*@__
|
|
|
545
719
|
|
|
546
720
|
// int64
|
|
547
721
|
|
|
548
|
-
|
|
549
|
-
|
|
722
|
+
// @__NO_SIDE_EFFECTS__
|
|
723
|
+
export interface ZodMiniInt64 extends ZodMiniBigIntFormat<"int64"> {}
|
|
724
|
+
export function int64(params?: string | core.$ZodBigIntFormatParams): ZodMiniInt64 {
|
|
725
|
+
return core._int64(ZodMiniBigIntFormat, params) as ZodMiniInt64;
|
|
550
726
|
}
|
|
551
727
|
|
|
552
728
|
// uint64
|
|
553
729
|
|
|
554
|
-
|
|
555
|
-
|
|
730
|
+
// @__NO_SIDE_EFFECTS__
|
|
731
|
+
export interface ZodMiniUInt64 extends ZodMiniBigIntFormat<"uint64"> {}
|
|
732
|
+
export function uint64(params?: string | core.$ZodBigIntFormatParams): ZodMiniUInt64 {
|
|
733
|
+
return core._uint64(ZodMiniBigIntFormat, params) as ZodMiniUInt64;
|
|
556
734
|
}
|
|
557
735
|
|
|
558
736
|
// ZodMiniSymbol
|
|
@@ -567,6 +745,7 @@ export const ZodMiniSymbol: core.$constructor<ZodMiniSymbol> = /*@__PURE__*/ cor
|
|
|
567
745
|
}
|
|
568
746
|
);
|
|
569
747
|
|
|
748
|
+
// @__NO_SIDE_EFFECTS__
|
|
570
749
|
export function symbol(params?: string | core.$ZodSymbolParams): ZodMiniSymbol {
|
|
571
750
|
return core._symbol(ZodMiniSymbol, params) as any;
|
|
572
751
|
}
|
|
@@ -583,6 +762,7 @@ export const ZodMiniUndefined: core.$constructor<ZodMiniUndefined> = /*@__PURE__
|
|
|
583
762
|
}
|
|
584
763
|
);
|
|
585
764
|
|
|
765
|
+
// @__NO_SIDE_EFFECTS__
|
|
586
766
|
function _undefined(params?: string | core.$ZodUndefinedParams): ZodMiniUndefined {
|
|
587
767
|
return core._undefined(ZodMiniUndefined, params) as any;
|
|
588
768
|
}
|
|
@@ -600,6 +780,7 @@ export const ZodMiniNull: core.$constructor<ZodMiniNull> = /*@__PURE__*/ core.$c
|
|
|
600
780
|
}
|
|
601
781
|
);
|
|
602
782
|
|
|
783
|
+
// @__NO_SIDE_EFFECTS__
|
|
603
784
|
function _null(params?: string | core.$ZodNullParams): ZodMiniNull {
|
|
604
785
|
return core._null(ZodMiniNull, params) as any;
|
|
605
786
|
}
|
|
@@ -614,6 +795,7 @@ export const ZodMiniAny: core.$constructor<ZodMiniAny> = /*@__PURE__*/ core.$con
|
|
|
614
795
|
ZodMiniType.init(inst, def);
|
|
615
796
|
});
|
|
616
797
|
|
|
798
|
+
// @__NO_SIDE_EFFECTS__
|
|
617
799
|
export function any(): ZodMiniAny {
|
|
618
800
|
return core._any(ZodMiniAny) as any;
|
|
619
801
|
}
|
|
@@ -630,6 +812,7 @@ export const ZodMiniUnknown: core.$constructor<ZodMiniUnknown> = /*@__PURE__*/ c
|
|
|
630
812
|
}
|
|
631
813
|
);
|
|
632
814
|
|
|
815
|
+
// @__NO_SIDE_EFFECTS__
|
|
633
816
|
export function unknown(): ZodMiniUnknown {
|
|
634
817
|
return core._unknown(ZodMiniUnknown) as any;
|
|
635
818
|
}
|
|
@@ -646,6 +829,7 @@ export const ZodMiniNever: core.$constructor<ZodMiniNever> = /*@__PURE__*/ core.
|
|
|
646
829
|
}
|
|
647
830
|
);
|
|
648
831
|
|
|
832
|
+
// @__NO_SIDE_EFFECTS__
|
|
649
833
|
export function never(params?: string | core.$ZodNeverParams): ZodMiniNever {
|
|
650
834
|
return core._never(ZodMiniNever, params) as any;
|
|
651
835
|
}
|
|
@@ -662,6 +846,7 @@ export const ZodMiniVoid: core.$constructor<ZodMiniVoid> = /*@__PURE__*/ core.$c
|
|
|
662
846
|
}
|
|
663
847
|
);
|
|
664
848
|
|
|
849
|
+
// @__NO_SIDE_EFFECTS__
|
|
665
850
|
function _void(params?: string | core.$ZodVoidParams): ZodMiniVoid {
|
|
666
851
|
return core._void(ZodMiniVoid, params) as any;
|
|
667
852
|
}
|
|
@@ -680,6 +865,7 @@ export const ZodMiniDate: core.$constructor<ZodMiniDate> = /*@__PURE__*/ core.$c
|
|
|
680
865
|
}
|
|
681
866
|
);
|
|
682
867
|
|
|
868
|
+
// @__NO_SIDE_EFFECTS__
|
|
683
869
|
export function date(params?: string | core.$ZodDateParams): ZodMiniDate<Date> {
|
|
684
870
|
return core._date(ZodMiniDate, params) as any;
|
|
685
871
|
}
|
|
@@ -699,6 +885,7 @@ export const ZodMiniArray: core.$constructor<ZodMiniArray> = /*@__PURE__*/ core.
|
|
|
699
885
|
);
|
|
700
886
|
|
|
701
887
|
export function array<T extends SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodMiniArray<T>;
|
|
888
|
+
// @__NO_SIDE_EFFECTS__
|
|
702
889
|
export function array<T extends SomeType>(element: SomeType, params?: any): ZodMiniArray<T> {
|
|
703
890
|
return new ZodMiniArray({
|
|
704
891
|
type: "array",
|
|
@@ -708,9 +895,10 @@ export function array<T extends SomeType>(element: SomeType, params?: any): ZodM
|
|
|
708
895
|
}
|
|
709
896
|
|
|
710
897
|
// .keyof
|
|
711
|
-
|
|
898
|
+
// @__NO_SIDE_EFFECTS__
|
|
899
|
+
export function keyof<T extends ZodMiniObject>(schema: T): ZodMiniEnum<util.KeysEnum<T["shape"]>> {
|
|
712
900
|
const shape = schema._zod.def.shape;
|
|
713
|
-
return
|
|
901
|
+
return _enum(Object.keys(shape)) as any;
|
|
714
902
|
}
|
|
715
903
|
|
|
716
904
|
// ZodMiniObject
|
|
@@ -727,113 +915,163 @@ export const ZodMiniObject: core.$constructor<ZodMiniObject> = /*@__PURE__*/ cor
|
|
|
727
915
|
(inst, def) => {
|
|
728
916
|
core.$ZodObject.init(inst, def);
|
|
729
917
|
ZodMiniType.init(inst, def);
|
|
730
|
-
util.
|
|
918
|
+
util.installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
731
919
|
}
|
|
732
920
|
);
|
|
921
|
+
// @__NO_SIDE_EFFECTS__
|
|
733
922
|
export function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(
|
|
734
923
|
shape?: T,
|
|
735
924
|
params?: string | core.$ZodObjectParams
|
|
736
|
-
): ZodMiniObject<T
|
|
925
|
+
): ZodMiniObject<util.Writeable<T>, core.$strip> {
|
|
737
926
|
const def: core.$ZodObjectDef = {
|
|
738
927
|
type: "object",
|
|
739
|
-
|
|
740
|
-
util.assignProp(this, "shape", { ...shape });
|
|
741
|
-
return this.shape;
|
|
742
|
-
},
|
|
928
|
+
shape: shape ?? {},
|
|
743
929
|
...util.normalizeParams(params),
|
|
744
930
|
};
|
|
745
931
|
return new ZodMiniObject(def) as any;
|
|
746
932
|
}
|
|
747
933
|
|
|
748
934
|
// strictObject
|
|
935
|
+
// @__NO_SIDE_EFFECTS__
|
|
749
936
|
export function strictObject<T extends core.$ZodLooseShape>(
|
|
750
937
|
shape: T,
|
|
751
938
|
params?: string | core.$ZodObjectParams
|
|
752
|
-
): ZodMiniObject<T
|
|
939
|
+
): ZodMiniObject<util.Writeable<T>, core.$strict> {
|
|
753
940
|
return new ZodMiniObject({
|
|
754
941
|
type: "object",
|
|
755
|
-
|
|
756
|
-
get shape() {
|
|
757
|
-
util.assignProp(this, "shape", { ...shape });
|
|
758
|
-
return this.shape;
|
|
759
|
-
},
|
|
942
|
+
shape,
|
|
760
943
|
catchall: never(),
|
|
761
944
|
...util.normalizeParams(params),
|
|
762
945
|
}) as any;
|
|
763
946
|
}
|
|
764
947
|
|
|
765
948
|
// looseObject
|
|
949
|
+
// @__NO_SIDE_EFFECTS__
|
|
766
950
|
export function looseObject<T extends core.$ZodLooseShape>(
|
|
767
951
|
shape: T,
|
|
768
952
|
params?: string | core.$ZodObjectParams
|
|
769
|
-
): ZodMiniObject<T
|
|
953
|
+
): ZodMiniObject<util.Writeable<T>, core.$loose> {
|
|
770
954
|
return new ZodMiniObject({
|
|
771
955
|
type: "object",
|
|
772
|
-
|
|
773
|
-
get shape() {
|
|
774
|
-
util.assignProp(this, "shape", { ...shape });
|
|
775
|
-
return this.shape;
|
|
776
|
-
},
|
|
777
|
-
// get optional() {
|
|
778
|
-
// return util.optionalKeys(shape);
|
|
779
|
-
// },
|
|
956
|
+
shape,
|
|
780
957
|
catchall: unknown(),
|
|
781
958
|
...util.normalizeParams(params),
|
|
782
959
|
}) as any;
|
|
783
960
|
}
|
|
784
961
|
|
|
785
962
|
// object methods
|
|
963
|
+
// @__NO_SIDE_EFFECTS__
|
|
786
964
|
export function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(
|
|
787
965
|
schema: T,
|
|
788
966
|
shape: U
|
|
789
|
-
): ZodMiniObject<util.Extend<T["shape"], U
|
|
967
|
+
): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]> {
|
|
790
968
|
return util.extend(schema, shape);
|
|
791
969
|
}
|
|
792
970
|
|
|
793
|
-
|
|
971
|
+
export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
|
|
972
|
+
[K in keyof Ext]: K extends keyof Base
|
|
973
|
+
? core.output<Ext[K]> extends core.output<Base[K]>
|
|
974
|
+
? core.input<Ext[K]> extends core.input<Base[K]>
|
|
975
|
+
? Ext[K]
|
|
976
|
+
: never
|
|
977
|
+
: never
|
|
978
|
+
: Ext[K];
|
|
979
|
+
};
|
|
980
|
+
|
|
981
|
+
// @__NO_SIDE_EFFECTS__
|
|
982
|
+
export function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(
|
|
983
|
+
schema: T,
|
|
984
|
+
shape: SafeExtendShape<T["shape"], U>
|
|
985
|
+
): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]> {
|
|
986
|
+
return util.safeExtend(schema, shape as any);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* @deprecated Use [`z.extend(A, B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
991
|
+
*/
|
|
992
|
+
// @__NO_SIDE_EFFECTS__
|
|
794
993
|
export function merge<T extends ZodMiniObject, U extends ZodMiniObject>(
|
|
795
994
|
a: T,
|
|
796
995
|
b: U
|
|
797
|
-
): ZodMiniObject<util.Extend<T["shape"], U["shape"]>,
|
|
798
|
-
|
|
799
|
-
return util.extend(schema, shape);
|
|
996
|
+
): ZodMiniObject<util.Extend<T["shape"], U["shape"]>, U["_zod"]["config"]> {
|
|
997
|
+
return util.merge(a, b) as any;
|
|
800
998
|
}
|
|
801
999
|
|
|
1000
|
+
// @__NO_SIDE_EFFECTS__
|
|
802
1001
|
export function pick<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(
|
|
803
1002
|
schema: T,
|
|
804
|
-
mask: M
|
|
1003
|
+
mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>
|
|
805
1004
|
): ZodMiniObject<util.Flatten<Pick<T["shape"], keyof T["shape"] & keyof M>>, T["_zod"]["config"]> {
|
|
806
1005
|
return util.pick(schema, mask as any);
|
|
807
1006
|
}
|
|
808
1007
|
|
|
809
1008
|
// .omit
|
|
810
1009
|
|
|
811
|
-
|
|
1010
|
+
// @__NO_SIDE_EFFECTS__
|
|
1011
|
+
export function omit<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(
|
|
812
1012
|
schema: T,
|
|
813
|
-
mask: M
|
|
1013
|
+
mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>
|
|
814
1014
|
): ZodMiniObject<util.Flatten<Omit<T["shape"], keyof M>>, T["_zod"]["config"]> {
|
|
815
1015
|
return util.omit(schema, mask);
|
|
816
1016
|
}
|
|
817
1017
|
|
|
1018
|
+
// @__NO_SIDE_EFFECTS__
|
|
818
1019
|
export function partial<T extends ZodMiniObject>(
|
|
819
1020
|
schema: T
|
|
820
1021
|
): ZodMiniObject<
|
|
821
1022
|
{
|
|
822
|
-
[k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
|
|
1023
|
+
-readonly [k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
|
|
823
1024
|
},
|
|
824
1025
|
T["_zod"]["config"]
|
|
825
1026
|
>;
|
|
1027
|
+
// @__NO_SIDE_EFFECTS__
|
|
826
1028
|
export function partial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(
|
|
827
1029
|
schema: T,
|
|
828
|
-
mask: M
|
|
1030
|
+
mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>
|
|
829
1031
|
): ZodMiniObject<
|
|
830
1032
|
{
|
|
831
|
-
[k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
|
|
1033
|
+
-readonly [k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
|
|
832
1034
|
},
|
|
833
1035
|
T["_zod"]["config"]
|
|
834
1036
|
>;
|
|
835
|
-
|
|
836
|
-
|
|
1037
|
+
// @__NO_SIDE_EFFECTS__
|
|
1038
|
+
export function partial<T extends util.TupleItems, Rest extends SomeType | null>(
|
|
1039
|
+
schema: ZodMiniTuple<T, Rest>
|
|
1040
|
+
): ZodMiniTuple<{ -readonly [k in keyof T]: ZodMiniOptional<T[k]> }, Rest>;
|
|
1041
|
+
// @__NO_SIDE_EFFECTS__
|
|
1042
|
+
export function partial(schema: ZodMiniObject | ZodMiniTuple, mask?: object) {
|
|
1043
|
+
const def = schema._zod.def;
|
|
1044
|
+
if (def.type !== "tuple") return util.partial(ZodMiniOptional, schema as ZodMiniObject, mask);
|
|
1045
|
+
// a refinement was authored against the full arity; partialing would run it on a shorter array
|
|
1046
|
+
if (def.checks?.length) throw new Error(".partial() cannot be used on tuple schemas containing refinements");
|
|
1047
|
+
return util.clone(schema, {
|
|
1048
|
+
...def,
|
|
1049
|
+
items: def.items.map((item) => new ZodMiniOptional({ type: "optional", innerType: item as core.$ZodType })),
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
// @__NO_SIDE_EFFECTS__
|
|
1054
|
+
export function exactPartial<T extends ZodMiniObject>(
|
|
1055
|
+
schema: T
|
|
1056
|
+
): ZodMiniObject<
|
|
1057
|
+
{
|
|
1058
|
+
-readonly [k in keyof T["shape"]]: ZodMiniExactOptional<T["shape"][k]>;
|
|
1059
|
+
},
|
|
1060
|
+
T["_zod"]["config"]
|
|
1061
|
+
>;
|
|
1062
|
+
// @__NO_SIDE_EFFECTS__
|
|
1063
|
+
export function exactPartial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(
|
|
1064
|
+
schema: T,
|
|
1065
|
+
mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>
|
|
1066
|
+
): ZodMiniObject<
|
|
1067
|
+
{
|
|
1068
|
+
-readonly [k in keyof T["shape"]]: k extends keyof M ? ZodMiniExactOptional<T["shape"][k]> : T["shape"][k];
|
|
1069
|
+
},
|
|
1070
|
+
T["_zod"]["config"]
|
|
1071
|
+
>;
|
|
1072
|
+
// @__NO_SIDE_EFFECTS__
|
|
1073
|
+
export function exactPartial(schema: ZodMiniObject, mask?: object) {
|
|
1074
|
+
return util.partial(ZodMiniExactOptional, schema, mask, "exactPartial");
|
|
837
1075
|
}
|
|
838
1076
|
|
|
839
1077
|
export type RequiredInterfaceShape<
|
|
@@ -847,17 +1085,19 @@ export type RequiredInterfaceShape<
|
|
|
847
1085
|
}
|
|
848
1086
|
>;
|
|
849
1087
|
|
|
1088
|
+
// @__NO_SIDE_EFFECTS__
|
|
850
1089
|
export function required<T extends ZodMiniObject>(
|
|
851
1090
|
schema: T
|
|
852
1091
|
): ZodMiniObject<
|
|
853
1092
|
{
|
|
854
|
-
[k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
|
1093
|
+
-readonly [k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
|
|
855
1094
|
},
|
|
856
1095
|
T["_zod"]["config"]
|
|
857
1096
|
>;
|
|
1097
|
+
// @__NO_SIDE_EFFECTS__
|
|
858
1098
|
export function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(
|
|
859
1099
|
schema: T,
|
|
860
|
-
mask: M
|
|
1100
|
+
mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>
|
|
861
1101
|
): ZodMiniObject<
|
|
862
1102
|
util.Extend<
|
|
863
1103
|
T["shape"],
|
|
@@ -867,15 +1107,18 @@ export function required<T extends ZodMiniObject, M extends util.Mask<keyof T["s
|
|
|
867
1107
|
>,
|
|
868
1108
|
T["_zod"]["config"]
|
|
869
1109
|
>;
|
|
1110
|
+
// @__NO_SIDE_EFFECTS__
|
|
870
1111
|
export function required(schema: ZodMiniObject, mask?: object) {
|
|
871
1112
|
return util.required(ZodMiniNonOptional, schema, mask);
|
|
872
1113
|
}
|
|
873
1114
|
|
|
1115
|
+
// @__NO_SIDE_EFFECTS__
|
|
874
1116
|
export function catchall<T extends ZodMiniObject, U extends SomeType>(
|
|
875
1117
|
inst: T,
|
|
876
1118
|
catchall: U
|
|
877
1119
|
): ZodMiniObject<T["shape"], core.$catchall<U>> {
|
|
878
|
-
|
|
1120
|
+
// `mergeDefs` rather than a spread: spreading reads `shape`, and resolving it can mint a whole fresh subtree
|
|
1121
|
+
return inst.clone(util.mergeDefs(inst._zod.def, { catchall: catchall as any })) as any;
|
|
879
1122
|
}
|
|
880
1123
|
|
|
881
1124
|
// ZodMiniUnion
|
|
@@ -891,6 +1134,7 @@ export const ZodMiniUnion: core.$constructor<ZodMiniUnion> = /*@__PURE__*/ core.
|
|
|
891
1134
|
}
|
|
892
1135
|
);
|
|
893
1136
|
|
|
1137
|
+
// @__NO_SIDE_EFFECTS__
|
|
894
1138
|
export function union<const T extends readonly SomeType[]>(
|
|
895
1139
|
options: T,
|
|
896
1140
|
params?: string | core.$ZodUnionParams
|
|
@@ -902,10 +1146,37 @@ export function union<const T extends readonly SomeType[]>(
|
|
|
902
1146
|
}) as any;
|
|
903
1147
|
}
|
|
904
1148
|
|
|
1149
|
+
// ZodMiniXor
|
|
1150
|
+
export interface ZodMiniXor<T extends readonly SomeType[] = readonly core.$ZodType[]>
|
|
1151
|
+
extends _ZodMiniType<core.$ZodXorInternals<T>> {
|
|
1152
|
+
// _zod: core.$ZodXorInternals<T>;
|
|
1153
|
+
}
|
|
1154
|
+
export const ZodMiniXor: core.$constructor<ZodMiniXor> = /*@__PURE__*/ core.$constructor("ZodMiniXor", (inst, def) => {
|
|
1155
|
+
ZodMiniUnion.init(inst, def);
|
|
1156
|
+
core.$ZodXor.init(inst, def);
|
|
1157
|
+
});
|
|
1158
|
+
|
|
1159
|
+
/** Creates an exclusive union (XOR) where exactly one option must match.
|
|
1160
|
+
* Unlike regular unions that succeed when any option matches, xor fails if
|
|
1161
|
+
* zero or more than one option matches the input. */
|
|
1162
|
+
export function xor<const T extends readonly SomeType[]>(
|
|
1163
|
+
options: T,
|
|
1164
|
+
params?: string | core.$ZodXorParams
|
|
1165
|
+
): ZodMiniXor<T> {
|
|
1166
|
+
return new ZodMiniXor({
|
|
1167
|
+
type: "union",
|
|
1168
|
+
options: options as any as core.$ZodType[],
|
|
1169
|
+
inclusive: false,
|
|
1170
|
+
...util.normalizeParams(params),
|
|
1171
|
+
}) as any;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
905
1174
|
// ZodMiniDiscriminatedUnion
|
|
906
|
-
export interface ZodMiniDiscriminatedUnion<
|
|
907
|
-
extends
|
|
908
|
-
|
|
1175
|
+
export interface ZodMiniDiscriminatedUnion<
|
|
1176
|
+
Options extends readonly SomeType[] = readonly core.$ZodType[],
|
|
1177
|
+
Disc extends string = string,
|
|
1178
|
+
> extends ZodMiniUnion<Options> {
|
|
1179
|
+
_zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
|
|
909
1180
|
}
|
|
910
1181
|
export const ZodMiniDiscriminatedUnion: core.$constructor<ZodMiniDiscriminatedUnion> = /*@__PURE__*/ core.$constructor(
|
|
911
1182
|
"ZodMiniDiscriminatedUnion",
|
|
@@ -915,19 +1186,21 @@ export const ZodMiniDiscriminatedUnion: core.$constructor<ZodMiniDiscriminatedUn
|
|
|
915
1186
|
}
|
|
916
1187
|
);
|
|
917
1188
|
|
|
1189
|
+
// @__NO_SIDE_EFFECTS__
|
|
918
1190
|
export function discriminatedUnion<
|
|
919
1191
|
Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]],
|
|
1192
|
+
Disc extends string,
|
|
920
1193
|
>(
|
|
921
|
-
discriminator:
|
|
1194
|
+
discriminator: Disc,
|
|
922
1195
|
options: Types,
|
|
923
1196
|
params?: string | core.$ZodDiscriminatedUnionParams
|
|
924
|
-
): ZodMiniDiscriminatedUnion<Types> {
|
|
1197
|
+
): ZodMiniDiscriminatedUnion<Types, Disc> {
|
|
925
1198
|
return new ZodMiniDiscriminatedUnion({
|
|
926
1199
|
type: "union",
|
|
927
|
-
options,
|
|
1200
|
+
options: options as any as core.$ZodType[],
|
|
928
1201
|
discriminator,
|
|
929
1202
|
...util.normalizeParams(params),
|
|
930
|
-
}) as ZodMiniDiscriminatedUnion<Types>;
|
|
1203
|
+
}) as any as ZodMiniDiscriminatedUnion<Types, Disc>;
|
|
931
1204
|
}
|
|
932
1205
|
|
|
933
1206
|
// ZodMiniIntersection
|
|
@@ -943,6 +1216,7 @@ export const ZodMiniIntersection: core.$constructor<ZodMiniIntersection> = /*@__
|
|
|
943
1216
|
}
|
|
944
1217
|
);
|
|
945
1218
|
|
|
1219
|
+
// @__NO_SIDE_EFFECTS__
|
|
946
1220
|
export function intersection<T extends SomeType, U extends SomeType>(left: T, right: U): ZodMiniIntersection<T, U> {
|
|
947
1221
|
return new ZodMiniIntersection({
|
|
948
1222
|
type: "intersection",
|
|
@@ -976,6 +1250,7 @@ export function tuple<const T extends readonly [SomeType, ...SomeType[]], Rest e
|
|
|
976
1250
|
params?: string | core.$ZodTupleParams
|
|
977
1251
|
): ZodMiniTuple<T, Rest>;
|
|
978
1252
|
export function tuple(items: [], params?: string | core.$ZodTupleParams): ZodMiniTuple<[], null>;
|
|
1253
|
+
// @__NO_SIDE_EFFECTS__
|
|
979
1254
|
export function tuple(
|
|
980
1255
|
items: SomeType[],
|
|
981
1256
|
_paramsOrRest?: string | core.$ZodTupleParams | SomeType,
|
|
@@ -1007,11 +1282,21 @@ export const ZodMiniRecord: core.$constructor<ZodMiniRecord> = /*@__PURE__*/ cor
|
|
|
1007
1282
|
}
|
|
1008
1283
|
);
|
|
1009
1284
|
|
|
1285
|
+
// @__NO_SIDE_EFFECTS__
|
|
1010
1286
|
export function record<Key extends core.$ZodRecordKey, Value extends SomeType>(
|
|
1011
1287
|
keyType: Key,
|
|
1012
1288
|
valueType: Value,
|
|
1013
1289
|
params?: string | core.$ZodRecordParams
|
|
1014
1290
|
): ZodMiniRecord<Key, Value> {
|
|
1291
|
+
// v3-compat: z.record(valueType, params?) — defaults keyType to z.string()
|
|
1292
|
+
if (!valueType || !(valueType as any)._zod) {
|
|
1293
|
+
return new ZodMiniRecord({
|
|
1294
|
+
type: "record",
|
|
1295
|
+
keyType: string() as any,
|
|
1296
|
+
valueType: keyType as any as core.$ZodType,
|
|
1297
|
+
...util.normalizeParams(valueType as string | core.$ZodRecordParams | undefined),
|
|
1298
|
+
}) as any;
|
|
1299
|
+
}
|
|
1015
1300
|
return new ZodMiniRecord({
|
|
1016
1301
|
type: "record",
|
|
1017
1302
|
keyType,
|
|
@@ -1019,6 +1304,7 @@ export function record<Key extends core.$ZodRecordKey, Value extends SomeType>(
|
|
|
1019
1304
|
...util.normalizeParams(params),
|
|
1020
1305
|
}) as any;
|
|
1021
1306
|
}
|
|
1307
|
+
// @__NO_SIDE_EFFECTS__
|
|
1022
1308
|
export function partialRecord<Key extends core.$ZodRecordKey, Value extends SomeType>(
|
|
1023
1309
|
keyType: Key,
|
|
1024
1310
|
valueType: Value,
|
|
@@ -1026,9 +1312,24 @@ export function partialRecord<Key extends core.$ZodRecordKey, Value extends Some
|
|
|
1026
1312
|
): ZodMiniRecord<Key & core.$partial, Value> {
|
|
1027
1313
|
return new ZodMiniRecord({
|
|
1028
1314
|
type: "record",
|
|
1029
|
-
keyType
|
|
1315
|
+
keyType,
|
|
1030
1316
|
valueType: valueType as any,
|
|
1031
1317
|
...util.normalizeParams(params),
|
|
1318
|
+
partial: true,
|
|
1319
|
+
}) as any;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
export function looseRecord<Key extends core.$ZodRecordKey, Value extends SomeType>(
|
|
1323
|
+
keyType: Key,
|
|
1324
|
+
valueType: Value,
|
|
1325
|
+
params?: string | core.$ZodRecordParams
|
|
1326
|
+
): ZodMiniRecord<Key, Value> {
|
|
1327
|
+
return new ZodMiniRecord({
|
|
1328
|
+
type: "record",
|
|
1329
|
+
keyType,
|
|
1330
|
+
valueType: valueType as any as core.$ZodType,
|
|
1331
|
+
mode: "loose",
|
|
1332
|
+
...util.normalizeParams(params),
|
|
1032
1333
|
}) as any;
|
|
1033
1334
|
}
|
|
1034
1335
|
|
|
@@ -1042,6 +1343,7 @@ export const ZodMiniMap: core.$constructor<ZodMiniMap> = /*@__PURE__*/ core.$con
|
|
|
1042
1343
|
ZodMiniType.init(inst, def);
|
|
1043
1344
|
});
|
|
1044
1345
|
|
|
1346
|
+
// @__NO_SIDE_EFFECTS__
|
|
1045
1347
|
export function map<Key extends SomeType, Value extends SomeType>(
|
|
1046
1348
|
keyType: Key,
|
|
1047
1349
|
valueType: Value,
|
|
@@ -1064,6 +1366,7 @@ export const ZodMiniSet: core.$constructor<ZodMiniSet> = /*@__PURE__*/ core.$con
|
|
|
1064
1366
|
ZodMiniType.init(inst, def);
|
|
1065
1367
|
});
|
|
1066
1368
|
|
|
1369
|
+
// @__NO_SIDE_EFFECTS__
|
|
1067
1370
|
export function set<Value extends SomeType>(valueType: Value, params?: string | core.$ZodSetParams): ZodMiniSet<Value> {
|
|
1068
1371
|
return new ZodMiniSet({
|
|
1069
1372
|
type: "set",
|
|
@@ -1075,12 +1378,16 @@ export function set<Value extends SomeType>(valueType: Value, params?: string |
|
|
|
1075
1378
|
// ZodMiniEnum
|
|
1076
1379
|
export interface ZodMiniEnum<T extends util.EnumLike = util.EnumLike> extends _ZodMiniType<core.$ZodEnumInternals<T>> {
|
|
1077
1380
|
// _zod: core.$ZodEnumInternals<T>;
|
|
1381
|
+
options: Array<T[keyof T]>;
|
|
1078
1382
|
}
|
|
1079
1383
|
export const ZodMiniEnum: core.$constructor<ZodMiniEnum> = /*@__PURE__*/ core.$constructor(
|
|
1080
1384
|
"ZodMiniEnum",
|
|
1081
1385
|
(inst, def) => {
|
|
1082
1386
|
core.$ZodEnum.init(inst, def);
|
|
1083
1387
|
ZodMiniType.init(inst, def);
|
|
1388
|
+
|
|
1389
|
+
// reuse the parsed value set so a numeric TS enum's reverse-mapping keys stay out
|
|
1390
|
+
inst.options = [...inst._zod.values] as util.EnumValue[];
|
|
1084
1391
|
}
|
|
1085
1392
|
);
|
|
1086
1393
|
|
|
@@ -1089,6 +1396,7 @@ function _enum<const T extends readonly string[]>(
|
|
|
1089
1396
|
params?: string | core.$ZodEnumParams
|
|
1090
1397
|
): ZodMiniEnum<util.ToEnum<T[number]>>;
|
|
1091
1398
|
function _enum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
|
|
1399
|
+
// @__NO_SIDE_EFFECTS__
|
|
1092
1400
|
function _enum(values: any, params?: string | core.$ZodEnumParams) {
|
|
1093
1401
|
const entries: any = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
1094
1402
|
|
|
@@ -1100,6 +1408,7 @@ function _enum(values: any, params?: string | core.$ZodEnumParams) {
|
|
|
1100
1408
|
}
|
|
1101
1409
|
export { _enum as enum };
|
|
1102
1410
|
|
|
1411
|
+
// @__NO_SIDE_EFFECTS__
|
|
1103
1412
|
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
|
|
1104
1413
|
*
|
|
1105
1414
|
* ```ts
|
|
@@ -1136,6 +1445,7 @@ export function literal<const T extends util.Literal>(
|
|
|
1136
1445
|
value: T,
|
|
1137
1446
|
params?: string | core.$ZodLiteralParams
|
|
1138
1447
|
): ZodMiniLiteral<T>;
|
|
1448
|
+
// @__NO_SIDE_EFFECTS__
|
|
1139
1449
|
export function literal(value: any, params: any) {
|
|
1140
1450
|
return new ZodMiniLiteral({
|
|
1141
1451
|
type: "literal",
|
|
@@ -1156,6 +1466,7 @@ export const ZodMiniFile: core.$constructor<ZodMiniFile> = /*@__PURE__*/ core.$c
|
|
|
1156
1466
|
}
|
|
1157
1467
|
);
|
|
1158
1468
|
|
|
1469
|
+
// @__NO_SIDE_EFFECTS__
|
|
1159
1470
|
export function file(params?: string | core.$ZodFileParams): ZodMiniFile {
|
|
1160
1471
|
return core._file(ZodMiniFile, params) as any;
|
|
1161
1472
|
}
|
|
@@ -1172,6 +1483,7 @@ export const ZodMiniTransform: core.$constructor<ZodMiniTransform> = /*@__PURE__
|
|
|
1172
1483
|
}
|
|
1173
1484
|
);
|
|
1174
1485
|
|
|
1486
|
+
// @__NO_SIDE_EFFECTS__
|
|
1175
1487
|
export function transform<I = unknown, O = I>(
|
|
1176
1488
|
fn: (input: I, ctx: core.ParsePayload) => O
|
|
1177
1489
|
): ZodMiniTransform<Awaited<O>, I> {
|
|
@@ -1195,6 +1507,7 @@ export const ZodMiniOptional: core.$constructor<ZodMiniOptional> = /*@__PURE__*/
|
|
|
1195
1507
|
}
|
|
1196
1508
|
);
|
|
1197
1509
|
|
|
1510
|
+
// @__NO_SIDE_EFFECTS__
|
|
1198
1511
|
export function optional<T extends SomeType>(innerType: T): ZodMiniOptional<T> {
|
|
1199
1512
|
return new ZodMiniOptional({
|
|
1200
1513
|
type: "optional",
|
|
@@ -1202,6 +1515,28 @@ export function optional<T extends SomeType>(innerType: T): ZodMiniOptional<T> {
|
|
|
1202
1515
|
}) as any;
|
|
1203
1516
|
}
|
|
1204
1517
|
|
|
1518
|
+
// ZodMiniExactOptional
|
|
1519
|
+
export interface ZodMiniExactOptional<T extends SomeType = core.$ZodType>
|
|
1520
|
+
extends _ZodMiniType<core.$ZodExactOptionalInternals<T>>,
|
|
1521
|
+
core.$ZodExactOptional<T> {
|
|
1522
|
+
// _zod: core.$ZodExactOptionalInternals<T>;
|
|
1523
|
+
}
|
|
1524
|
+
export const ZodMiniExactOptional: core.$constructor<ZodMiniExactOptional> = /*@__PURE__*/ core.$constructor(
|
|
1525
|
+
"ZodMiniExactOptional",
|
|
1526
|
+
(inst, def) => {
|
|
1527
|
+
core.$ZodExactOptional.init(inst, def);
|
|
1528
|
+
ZodMiniType.init(inst, def);
|
|
1529
|
+
}
|
|
1530
|
+
);
|
|
1531
|
+
|
|
1532
|
+
// @__NO_SIDE_EFFECTS__
|
|
1533
|
+
export function exactOptional<T extends SomeType>(innerType: T): ZodMiniExactOptional<T> {
|
|
1534
|
+
return new ZodMiniExactOptional({
|
|
1535
|
+
type: "optional",
|
|
1536
|
+
innerType: innerType as any as core.$ZodType,
|
|
1537
|
+
}) as any;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1205
1540
|
// ZodMiniNullable
|
|
1206
1541
|
export interface ZodMiniNullable<T extends SomeType = core.$ZodType>
|
|
1207
1542
|
extends _ZodMiniType<core.$ZodNullableInternals<T>> {
|
|
@@ -1215,6 +1550,7 @@ export const ZodMiniNullable: core.$constructor<ZodMiniNullable> = /*@__PURE__*/
|
|
|
1215
1550
|
}
|
|
1216
1551
|
);
|
|
1217
1552
|
|
|
1553
|
+
// @__NO_SIDE_EFFECTS__
|
|
1218
1554
|
export function nullable<T extends SomeType>(innerType: T): ZodMiniNullable<T> {
|
|
1219
1555
|
return new ZodMiniNullable({
|
|
1220
1556
|
type: "nullable",
|
|
@@ -1223,6 +1559,7 @@ export function nullable<T extends SomeType>(innerType: T): ZodMiniNullable<T> {
|
|
|
1223
1559
|
}
|
|
1224
1560
|
|
|
1225
1561
|
// nullish
|
|
1562
|
+
// @__NO_SIDE_EFFECTS__
|
|
1226
1563
|
export function nullish<T extends SomeType>(innerType: T): ZodMiniOptional<ZodMiniNullable<T>> {
|
|
1227
1564
|
return optional(nullable(innerType));
|
|
1228
1565
|
}
|
|
@@ -1239,6 +1576,7 @@ export const ZodMiniDefault: core.$constructor<ZodMiniDefault> = /*@__PURE__*/ c
|
|
|
1239
1576
|
}
|
|
1240
1577
|
);
|
|
1241
1578
|
|
|
1579
|
+
// @__NO_SIDE_EFFECTS__
|
|
1242
1580
|
export function _default<T extends SomeType>(
|
|
1243
1581
|
innerType: T,
|
|
1244
1582
|
defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)
|
|
@@ -1247,7 +1585,7 @@ export function _default<T extends SomeType>(
|
|
|
1247
1585
|
type: "default",
|
|
1248
1586
|
innerType: innerType as any as core.$ZodType,
|
|
1249
1587
|
get defaultValue() {
|
|
1250
|
-
return typeof defaultValue === "function" ? (defaultValue as Function)() : defaultValue;
|
|
1588
|
+
return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
|
|
1251
1589
|
},
|
|
1252
1590
|
}) as any;
|
|
1253
1591
|
}
|
|
@@ -1264,15 +1602,16 @@ export const ZodMiniPrefault: core.$constructor<ZodMiniPrefault> = /*@__PURE__*/
|
|
|
1264
1602
|
ZodMiniType.init(inst, def);
|
|
1265
1603
|
}
|
|
1266
1604
|
);
|
|
1605
|
+
// @__NO_SIDE_EFFECTS__
|
|
1267
1606
|
export function prefault<T extends SomeType>(
|
|
1268
1607
|
innerType: T,
|
|
1269
|
-
defaultValue:
|
|
1608
|
+
defaultValue: core.input<T> | (() => core.input<T>)
|
|
1270
1609
|
): ZodMiniPrefault<T> {
|
|
1271
1610
|
return new ZodMiniPrefault({
|
|
1272
1611
|
type: "prefault",
|
|
1273
1612
|
innerType: innerType as any as core.$ZodType,
|
|
1274
1613
|
get defaultValue() {
|
|
1275
|
-
return typeof defaultValue === "function" ? (defaultValue as Function)() : defaultValue;
|
|
1614
|
+
return typeof defaultValue === "function" ? (defaultValue as Function)() : util.shallowClone(defaultValue);
|
|
1276
1615
|
},
|
|
1277
1616
|
}) as any;
|
|
1278
1617
|
}
|
|
@@ -1290,6 +1629,7 @@ export const ZodMiniNonOptional: core.$constructor<ZodMiniNonOptional> = /*@__PU
|
|
|
1290
1629
|
}
|
|
1291
1630
|
);
|
|
1292
1631
|
|
|
1632
|
+
// @__NO_SIDE_EFFECTS__
|
|
1293
1633
|
export function nonoptional<T extends SomeType>(
|
|
1294
1634
|
innerType: T,
|
|
1295
1635
|
params?: string | core.$ZodNonOptionalParams
|
|
@@ -1313,6 +1653,7 @@ export const ZodMiniSuccess: core.$constructor<ZodMiniSuccess> = /*@__PURE__*/ c
|
|
|
1313
1653
|
}
|
|
1314
1654
|
);
|
|
1315
1655
|
|
|
1656
|
+
// @__NO_SIDE_EFFECTS__
|
|
1316
1657
|
export function success<T extends SomeType>(innerType: T): ZodMiniSuccess<T> {
|
|
1317
1658
|
return new ZodMiniSuccess({
|
|
1318
1659
|
type: "success",
|
|
@@ -1332,6 +1673,7 @@ export const ZodMiniCatch: core.$constructor<ZodMiniCatch> = /*@__PURE__*/ core.
|
|
|
1332
1673
|
}
|
|
1333
1674
|
);
|
|
1334
1675
|
|
|
1676
|
+
// @__NO_SIDE_EFFECTS__
|
|
1335
1677
|
function _catch<T extends SomeType>(
|
|
1336
1678
|
innerType: T,
|
|
1337
1679
|
catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)
|
|
@@ -1339,7 +1681,7 @@ function _catch<T extends SomeType>(
|
|
|
1339
1681
|
return new ZodMiniCatch({
|
|
1340
1682
|
type: "catch",
|
|
1341
1683
|
innerType: innerType as any as core.$ZodType,
|
|
1342
|
-
catchValue: (typeof catchValue === "function" ? catchValue : (
|
|
1684
|
+
catchValue: (typeof catchValue === "function" ? catchValue : core.util.constantCatch(catchValue)) as (
|
|
1343
1685
|
ctx: core.$ZodCatchCtx
|
|
1344
1686
|
) => core.output<T>,
|
|
1345
1687
|
}) as any;
|
|
@@ -1355,6 +1697,7 @@ export const ZodMiniNaN: core.$constructor<ZodMiniNaN> = /*@__PURE__*/ core.$con
|
|
|
1355
1697
|
ZodMiniType.init(inst, def);
|
|
1356
1698
|
});
|
|
1357
1699
|
|
|
1700
|
+
// @__NO_SIDE_EFFECTS__
|
|
1358
1701
|
export function nan(params?: string | core.$ZodNaNParams): ZodMiniNaN {
|
|
1359
1702
|
return core._nan(ZodMiniNaN, params) as any;
|
|
1360
1703
|
}
|
|
@@ -1372,6 +1715,7 @@ export const ZodMiniPipe: core.$constructor<ZodMiniPipe> = /*@__PURE__*/ core.$c
|
|
|
1372
1715
|
}
|
|
1373
1716
|
);
|
|
1374
1717
|
|
|
1718
|
+
// @__NO_SIDE_EFFECTS__
|
|
1375
1719
|
export function pipe<
|
|
1376
1720
|
const A extends SomeType,
|
|
1377
1721
|
B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>,
|
|
@@ -1383,14 +1727,50 @@ export function pipe<
|
|
|
1383
1727
|
}) as any;
|
|
1384
1728
|
}
|
|
1385
1729
|
|
|
1386
|
-
//
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1730
|
+
// ZodMiniCodec
|
|
1731
|
+
export interface ZodMiniCodec<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType>
|
|
1732
|
+
extends ZodMiniPipe<A, B>,
|
|
1733
|
+
core.$ZodCodec<A, B> {
|
|
1734
|
+
_zod: core.$ZodCodecInternals<A, B>;
|
|
1735
|
+
def: core.$ZodCodecDef<A, B>;
|
|
1736
|
+
}
|
|
1737
|
+
export const ZodMiniCodec: core.$constructor<ZodMiniCodec> = /*@__PURE__*/ core.$constructor(
|
|
1738
|
+
"ZodMiniCodec",
|
|
1739
|
+
(inst, def) => {
|
|
1740
|
+
ZodMiniPipe.init(inst, def);
|
|
1741
|
+
core.$ZodCodec.init(inst, def);
|
|
1742
|
+
}
|
|
1743
|
+
);
|
|
1744
|
+
|
|
1745
|
+
// @__NO_SIDE_EFFECTS__
|
|
1746
|
+
export function codec<const A extends SomeType, B extends core.SomeType = core.$ZodType>(
|
|
1747
|
+
in_: A,
|
|
1748
|
+
out: B,
|
|
1749
|
+
params: {
|
|
1750
|
+
decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
|
|
1751
|
+
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
|
|
1752
|
+
}
|
|
1753
|
+
): ZodMiniCodec<A, B> {
|
|
1754
|
+
return new ZodMiniCodec({
|
|
1755
|
+
type: "pipe",
|
|
1756
|
+
in: in_ as any as core.$ZodType,
|
|
1757
|
+
out: out as any as core.$ZodType,
|
|
1758
|
+
transform: params.decode as any,
|
|
1759
|
+
reverseTransform: params.encode as any,
|
|
1760
|
+
}) as any;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
// @__NO_SIDE_EFFECTS__
|
|
1764
|
+
export function invertCodec<A extends SomeType, B extends SomeType>(codec: ZodMiniCodec<A, B>): ZodMiniCodec<B, A> {
|
|
1765
|
+
const def = codec._zod.def;
|
|
1766
|
+
return new ZodMiniCodec({
|
|
1767
|
+
type: "pipe",
|
|
1768
|
+
in: def.out as any,
|
|
1769
|
+
out: def.in as any,
|
|
1770
|
+
transform: def.reverseTransform as any,
|
|
1771
|
+
reverseTransform: def.transform as any,
|
|
1772
|
+
}) as any;
|
|
1773
|
+
}
|
|
1394
1774
|
|
|
1395
1775
|
// ZodMiniReadonly
|
|
1396
1776
|
export interface ZodMiniReadonly<T extends SomeType = core.$ZodType>
|
|
@@ -1405,6 +1785,7 @@ export const ZodMiniReadonly: core.$constructor<ZodMiniReadonly> = /*@__PURE__*/
|
|
|
1405
1785
|
}
|
|
1406
1786
|
);
|
|
1407
1787
|
|
|
1788
|
+
// @__NO_SIDE_EFFECTS__
|
|
1408
1789
|
export function readonly<T extends SomeType>(innerType: T): ZodMiniReadonly<T> {
|
|
1409
1790
|
return new ZodMiniReadonly({
|
|
1410
1791
|
type: "readonly",
|
|
@@ -1425,6 +1806,7 @@ export const ZodMiniTemplateLiteral: core.$constructor<ZodMiniTemplateLiteral> =
|
|
|
1425
1806
|
}
|
|
1426
1807
|
);
|
|
1427
1808
|
|
|
1809
|
+
// @__NO_SIDE_EFFECTS__
|
|
1428
1810
|
export function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(
|
|
1429
1811
|
parts: Parts,
|
|
1430
1812
|
params?: string | core.$ZodTemplateLiteralParams
|
|
@@ -1451,6 +1833,7 @@ export const ZodMiniLazy: core.$constructor<ZodMiniLazy> = /*@__PURE__*/ core.$c
|
|
|
1451
1833
|
// export function lazy<T extends object>(getter: () => T): T {
|
|
1452
1834
|
// return util.createTransparentProxy<T>(getter);
|
|
1453
1835
|
// }
|
|
1836
|
+
// @__NO_SIDE_EFFECTS__
|
|
1454
1837
|
function _lazy<T extends SomeType>(getter: () => T): ZodMiniLazy<T> {
|
|
1455
1838
|
return new ZodMiniLazy({
|
|
1456
1839
|
type: "lazy",
|
|
@@ -1471,6 +1854,7 @@ export const ZodMiniPromise: core.$constructor<ZodMiniPromise> = /*@__PURE__*/ c
|
|
|
1471
1854
|
}
|
|
1472
1855
|
);
|
|
1473
1856
|
|
|
1857
|
+
// @__NO_SIDE_EFFECTS__
|
|
1474
1858
|
export function promise<T extends SomeType>(innerType: T): ZodMiniPromise<T> {
|
|
1475
1859
|
return new ZodMiniPromise({
|
|
1476
1860
|
type: "promise",
|
|
@@ -1491,6 +1875,7 @@ export const ZodMiniCustom: core.$constructor<ZodMiniCustom> = /*@__PURE__*/ cor
|
|
|
1491
1875
|
);
|
|
1492
1876
|
|
|
1493
1877
|
// custom checks
|
|
1878
|
+
// @__NO_SIDE_EFFECTS__
|
|
1494
1879
|
export function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O> {
|
|
1495
1880
|
const ch = new core.$ZodCheck({
|
|
1496
1881
|
check: "custom",
|
|
@@ -1501,8 +1886,8 @@ export function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$
|
|
|
1501
1886
|
return ch;
|
|
1502
1887
|
}
|
|
1503
1888
|
|
|
1504
|
-
// ZodCustom
|
|
1505
|
-
//
|
|
1889
|
+
// ZodCustom custom schema
|
|
1890
|
+
// @__NO_SIDE_EFFECTS__
|
|
1506
1891
|
export function custom<O = unknown, I = O>(
|
|
1507
1892
|
fn?: (data: O) => unknown,
|
|
1508
1893
|
_params?: string | core.$ZodCustomParams | undefined
|
|
@@ -1511,6 +1896,7 @@ export function custom<O = unknown, I = O>(
|
|
|
1511
1896
|
}
|
|
1512
1897
|
|
|
1513
1898
|
// refine
|
|
1899
|
+
// @__NO_SIDE_EFFECTS__
|
|
1514
1900
|
export function refine<T>(
|
|
1515
1901
|
fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>,
|
|
1516
1902
|
_params: string | core.$ZodCustomParams = {}
|
|
@@ -1518,40 +1904,62 @@ export function refine<T>(
|
|
|
1518
1904
|
return core._refine(ZodMiniCustom, fn, _params);
|
|
1519
1905
|
}
|
|
1520
1906
|
|
|
1907
|
+
// superRefine
|
|
1908
|
+
// @__NO_SIDE_EFFECTS__
|
|
1909
|
+
export function superRefine<T>(
|
|
1910
|
+
fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>,
|
|
1911
|
+
params?: core.$ZodSuperRefineParams
|
|
1912
|
+
): core.$ZodCheck<T> {
|
|
1913
|
+
return core._superRefine(fn, params);
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
// Re-export describe and meta from core
|
|
1917
|
+
export const describe = core.describe;
|
|
1918
|
+
export const meta = core.meta;
|
|
1919
|
+
|
|
1521
1920
|
// instanceof
|
|
1522
1921
|
abstract class Class {
|
|
1523
1922
|
constructor(..._args: any[]) {}
|
|
1524
1923
|
}
|
|
1924
|
+
// @__NO_SIDE_EFFECTS__
|
|
1525
1925
|
function _instanceof<T extends typeof Class>(
|
|
1526
1926
|
cls: T,
|
|
1527
|
-
params: core.$ZodCustomParams = {
|
|
1528
|
-
error: `Input not instance of ${cls.name}`,
|
|
1529
|
-
}
|
|
1927
|
+
params: core.$ZodCustomParams = {}
|
|
1530
1928
|
): ZodMiniCustom<InstanceType<T>, InstanceType<T>> {
|
|
1531
1929
|
const inst = custom((data) => data instanceof cls, params);
|
|
1532
1930
|
inst._zod.bag.Class = cls;
|
|
1931
|
+
// Override check to emit invalid_type instead of custom
|
|
1932
|
+
inst._zod.check = (payload) => {
|
|
1933
|
+
if (!(payload.value instanceof cls)) {
|
|
1934
|
+
payload.issues.push({
|
|
1935
|
+
code: "invalid_type",
|
|
1936
|
+
expected: cls.name,
|
|
1937
|
+
input: payload.value,
|
|
1938
|
+
inst,
|
|
1939
|
+
path: [...(inst._zod.def.path ?? [])],
|
|
1940
|
+
});
|
|
1941
|
+
}
|
|
1942
|
+
};
|
|
1533
1943
|
return inst as any;
|
|
1534
1944
|
}
|
|
1535
1945
|
export { _instanceof as instanceof };
|
|
1536
1946
|
|
|
1537
1947
|
// stringbool
|
|
1538
|
-
export const stringbool: (
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
...args
|
|
1549
|
-
) as any;
|
|
1948
|
+
export const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMiniCodec<ZodMiniString, ZodMiniBoolean> =
|
|
1949
|
+
(...args) =>
|
|
1950
|
+
core._stringbool(
|
|
1951
|
+
{
|
|
1952
|
+
Codec: ZodMiniCodec,
|
|
1953
|
+
Boolean: ZodMiniBoolean,
|
|
1954
|
+
String: ZodMiniString,
|
|
1955
|
+
},
|
|
1956
|
+
...args
|
|
1957
|
+
) as any;
|
|
1550
1958
|
|
|
1551
1959
|
// json
|
|
1552
1960
|
|
|
1553
1961
|
// json
|
|
1554
|
-
type _ZodMiniJSONSchema = ZodMiniUnion<
|
|
1962
|
+
export type _ZodMiniJSONSchema = ZodMiniUnion<
|
|
1555
1963
|
[
|
|
1556
1964
|
ZodMiniString,
|
|
1557
1965
|
ZodMiniNumber,
|
|
@@ -1561,7 +1969,7 @@ type _ZodMiniJSONSchema = ZodMiniUnion<
|
|
|
1561
1969
|
ZodMiniRecord<ZodMiniString<string>, ZodMiniJSONSchema>,
|
|
1562
1970
|
]
|
|
1563
1971
|
>;
|
|
1564
|
-
type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
|
|
1972
|
+
export type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
|
|
1565
1973
|
|
|
1566
1974
|
export interface ZodMiniJSONSchemaInternals extends _ZodMiniJSONSchemaInternals {
|
|
1567
1975
|
output: util.JSONType;
|
|
@@ -1571,9 +1979,73 @@ export interface ZodMiniJSONSchema extends _ZodMiniJSONSchema {
|
|
|
1571
1979
|
_zod: ZodMiniJSONSchemaInternals;
|
|
1572
1980
|
}
|
|
1573
1981
|
|
|
1982
|
+
// @__NO_SIDE_EFFECTS__
|
|
1574
1983
|
export function json(): ZodMiniJSONSchema {
|
|
1575
1984
|
const jsonSchema: any = _lazy(() => {
|
|
1576
1985
|
return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
|
|
1577
1986
|
});
|
|
1578
1987
|
return jsonSchema;
|
|
1579
1988
|
}
|
|
1989
|
+
|
|
1990
|
+
// ZodMiniFunction
|
|
1991
|
+
export interface ZodMiniFunction<
|
|
1992
|
+
Args extends core.$ZodFunctionIn = core.$ZodFunctionIn,
|
|
1993
|
+
Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut,
|
|
1994
|
+
> extends _ZodMiniType<core.$ZodFunctionInternals<Args, Returns>>,
|
|
1995
|
+
core.$ZodFunction<Args, Returns> {
|
|
1996
|
+
_def: core.$ZodFunctionDef<Args, Returns>;
|
|
1997
|
+
_input: core.$InferInnerFunctionType<Args, Returns>;
|
|
1998
|
+
_output: core.$InferOuterFunctionType<Args, Returns>;
|
|
1999
|
+
|
|
2000
|
+
input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(
|
|
2001
|
+
args: Items,
|
|
2002
|
+
rest?: Rest
|
|
2003
|
+
): ZodMiniFunction<ZodMiniTuple<Items, Rest>, Returns>;
|
|
2004
|
+
input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): ZodMiniFunction<NewArgs, Returns>;
|
|
2005
|
+
input(...args: any[]): ZodMiniFunction<any, Returns>;
|
|
2006
|
+
|
|
2007
|
+
output<NewReturns extends core.$ZodFunctionOut>(output: NewReturns): ZodMiniFunction<Args, NewReturns>;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
export const ZodMiniFunction: core.$constructor<ZodMiniFunction> = /*@__PURE__*/ core.$constructor(
|
|
2011
|
+
"ZodMiniFunction",
|
|
2012
|
+
(inst, def) => {
|
|
2013
|
+
core.$ZodFunction.init(inst, def);
|
|
2014
|
+
ZodMiniType.init(inst, def);
|
|
2015
|
+
}
|
|
2016
|
+
);
|
|
2017
|
+
|
|
2018
|
+
export function _function(): ZodMiniFunction;
|
|
2019
|
+
export function _function<const In extends Array<SomeType> = Array<SomeType>>(params: {
|
|
2020
|
+
input: In;
|
|
2021
|
+
}): ZodMiniFunction<ZodMiniTuple<In, null>, core.$ZodFunctionOut>;
|
|
2022
|
+
export function _function<
|
|
2023
|
+
const In extends Array<SomeType> = Array<SomeType>,
|
|
2024
|
+
const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut,
|
|
2025
|
+
>(params: {
|
|
2026
|
+
input: In;
|
|
2027
|
+
output: Out;
|
|
2028
|
+
}): ZodMiniFunction<ZodMiniTuple<In, null>, Out>;
|
|
2029
|
+
export function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn>(params: {
|
|
2030
|
+
input: In;
|
|
2031
|
+
}): ZodMiniFunction<In, core.$ZodFunctionOut>;
|
|
2032
|
+
export function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
|
|
2033
|
+
output: Out;
|
|
2034
|
+
}): ZodMiniFunction<core.$ZodFunctionIn, Out>;
|
|
2035
|
+
export function _function<
|
|
2036
|
+
In extends core.$ZodFunctionIn = core.$ZodFunctionIn,
|
|
2037
|
+
Out extends core.$ZodFunctionOut = core.$ZodFunctionOut,
|
|
2038
|
+
>(params?: { input: In; output: Out }): ZodMiniFunction<In, Out>;
|
|
2039
|
+
// @__NO_SIDE_EFFECTS__
|
|
2040
|
+
export function _function(params?: {
|
|
2041
|
+
output?: core.$ZodFunctionOut;
|
|
2042
|
+
input?: core.$ZodFunctionArgs | Array<SomeType>;
|
|
2043
|
+
}): ZodMiniFunction {
|
|
2044
|
+
return new ZodMiniFunction({
|
|
2045
|
+
type: "function",
|
|
2046
|
+
input: Array.isArray(params?.input) ? tuple(params?.input as any) : (params?.input ?? array(unknown())),
|
|
2047
|
+
output: params?.output ?? unknown(),
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
export { _function as function };
|