@psnext/slingcli 3.1.20260904-1 → 3.3.20260914-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/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-PBNSMEG7.js → chunk-BRL3MDQL.js} +10 -10
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/model-selector.js +79 -32
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +25 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/EventSource.md +4 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +33 -43
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +16 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +7 -2
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +9 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +221 -12
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +76 -30
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +37 -8
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +106 -22
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +29 -5
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/decorator-handler.js +7 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +21 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +155 -32
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +65 -9
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +13 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-utils.js +217 -27
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +43 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/parse.js +150 -147
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +2 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +22 -0
- package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +3 -3
- package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +4 -4
- package/node_modules/@earendil-works/pi-coding-agent/package.json +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/errors/index.js +20 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +11 -10
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +11 -10
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +25 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/errors/errors.js +18 -0
- package/node_modules/@smithy/core/dist-es/submodules/errors/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js +11 -10
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.browser.js +2 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.js +23 -8
- package/node_modules/@smithy/core/dist-types/submodules/errors/errors.d.ts +44 -0
- package/node_modules/@smithy/core/dist-types/submodules/errors/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/errors.d.ts +44 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
- package/node_modules/@smithy/core/errors.d.ts +5 -0
- package/node_modules/@smithy/core/errors.js +5 -0
- package/node_modules/@smithy/core/package.json +11 -2
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.d.ts +1 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
- package/node_modules/@types/node/http.d.ts +1 -1
- package/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/node/perf_hooks.d.ts +31 -19
- package/node_modules/@types/node/quic.d.ts +6 -4
- package/node_modules/@types/node/stream/web.d.ts +20 -0
- package/node_modules/@types/node/tls.d.ts +26 -15
- package/node_modules/@types/node/vfs.d.ts +7 -6
- package/node_modules/@types/node/web-globals/streams.d.ts +4 -0
- package/node_modules/@types/node/zlib.d.ts +17 -0
- package/node_modules/hono/dist/cjs/client/client.js +4 -4
- package/node_modules/hono/dist/cjs/hono-base.js +7 -6
- package/node_modules/hono/dist/cjs/jsx/base.js +18 -1
- package/node_modules/hono/dist/cjs/jsx/components.js +25 -26
- package/node_modules/hono/dist/cjs/jsx/context.js +5 -5
- package/node_modules/hono/dist/cjs/jsx/dom/server.js +5 -1
- package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +2 -2
- package/node_modules/hono/dist/cjs/jsx/streaming.js +4 -5
- package/node_modules/hono/dist/client/client.js +4 -4
- package/node_modules/hono/dist/hono-base.js +7 -6
- package/node_modules/hono/dist/jsx/base.js +15 -1
- package/node_modules/hono/dist/jsx/components.js +26 -27
- package/node_modules/hono/dist/jsx/context.js +6 -6
- package/node_modules/hono/dist/jsx/dom/server.js +5 -1
- package/node_modules/hono/dist/jsx/intrinsic-element/components.js +3 -3
- package/node_modules/hono/dist/jsx/streaming.js +5 -6
- package/node_modules/hono/dist/types/context.d.ts +2 -2
- package/node_modules/hono/dist/types/jsx/base.d.ts +3 -0
- package/node_modules/hono/package.json +2 -2
- package/node_modules/jose/dist/types/index.d.ts +1 -2
- package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -11
- package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +13 -16
- package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -11
- package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -19
- package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +10 -16
- package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +18 -21
- package/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -1
- package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +4 -6
- package/node_modules/jose/dist/types/jwks/local.d.ts +5 -4
- package/node_modules/jose/dist/types/jwks/remote.d.ts +20 -21
- package/node_modules/jose/dist/types/jws/compact/sign.d.ts +4 -4
- package/node_modules/jose/dist/types/jws/compact/verify.d.ts +8 -11
- package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -5
- package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +8 -11
- package/node_modules/jose/dist/types/jws/general/sign.d.ts +10 -14
- package/node_modules/jose/dist/types/jws/general/verify.d.ts +11 -17
- package/node_modules/jose/dist/types/jwt/decrypt.d.ts +14 -11
- package/node_modules/jose/dist/types/jwt/encrypt.d.ts +24 -22
- package/node_modules/jose/dist/types/jwt/sign.d.ts +3 -7
- package/node_modules/jose/dist/types/jwt/unsecured.d.ts +2 -6
- package/node_modules/jose/dist/types/jwt/verify.d.ts +13 -6
- package/node_modules/jose/dist/types/key/export.d.ts +6 -6
- package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +9 -14
- package/node_modules/jose/dist/types/key/generate_secret.d.ts +10 -10
- package/node_modules/jose/dist/types/key/import.d.ts +19 -18
- package/node_modules/jose/dist/types/types.d.ts +152 -247
- package/node_modules/jose/dist/types/util/base64url.d.ts +7 -7
- package/node_modules/jose/dist/types/util/decode_jwt.d.ts +6 -1
- package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -3
- package/node_modules/jose/dist/types/util/errors.d.ts +29 -40
- package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +1 -2
- package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +9 -26
- package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +3 -3
- package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +11 -30
- package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +6 -6
- package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +33 -57
- package/node_modules/jose/dist/webapi/jwk/embedded.js +3 -4
- package/node_modules/jose/dist/webapi/jwk/thumbprint.js +3 -6
- package/node_modules/jose/dist/webapi/jwks/local.js +16 -10
- package/node_modules/jose/dist/webapi/jwks/remote.js +2 -2
- package/node_modules/jose/dist/webapi/jws/compact/sign.js +2 -4
- package/node_modules/jose/dist/webapi/jws/compact/verify.js +2 -2
- package/node_modules/jose/dist/webapi/jws/flattened/sign.js +8 -15
- package/node_modules/jose/dist/webapi/jws/flattened/verify.js +4 -14
- package/node_modules/jose/dist/webapi/jws/general/sign.js +4 -11
- package/node_modules/jose/dist/webapi/jws/general/verify.js +5 -7
- package/node_modules/jose/dist/webapi/jwt/decrypt.js +2 -3
- package/node_modules/jose/dist/webapi/jwt/encrypt.js +11 -25
- package/node_modules/jose/dist/webapi/jwt/sign.js +1 -1
- package/node_modules/jose/dist/webapi/jwt/unsecured.js +1 -2
- package/node_modules/jose/dist/webapi/jwt/verify.js +4 -4
- package/node_modules/jose/dist/webapi/key/export.js +12 -16
- package/node_modules/jose/dist/webapi/key/generate_key_pair.js +4 -13
- package/node_modules/jose/dist/webapi/key/generate_secret.js +1 -1
- package/node_modules/jose/dist/webapi/key/import.js +5 -9
- package/node_modules/jose/dist/webapi/lib/asn1.js +2 -4
- package/node_modules/jose/dist/webapi/lib/buffer_utils.js +35 -0
- package/node_modules/jose/dist/webapi/lib/content_encryption.js +21 -29
- package/node_modules/jose/dist/webapi/lib/deflate.js +9 -19
- package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +0 -4
- package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +21 -54
- package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +26 -59
- package/node_modules/jose/dist/webapi/lib/jws_sign.js +29 -43
- package/node_modules/jose/dist/webapi/lib/jws_verify.js +37 -45
- package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +1 -1
- package/node_modules/jose/dist/webapi/lib/key.js +119 -59
- package/node_modules/jose/dist/webapi/lib/key_management.js +45 -80
- package/node_modules/jose/dist/webapi/lib/{options.js → validate.js} +64 -3
- package/node_modules/jose/dist/webapi/util/base64url.js +5 -19
- package/node_modules/jose/dist/webapi/util/decode_jwt.js +1 -1
- package/node_modules/jose/dist/webapi/util/decode_protected_header.js +1 -1
- package/node_modules/jose/package.json +1 -1
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +70 -14
- package/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/undici/lib/handler/retry-handler.js +42 -7
- package/node_modules/undici/lib/interceptor/cache.js +20 -1
- package/node_modules/undici/lib/interceptor/decompress.js +146 -14
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/node_modules/undici-types/client.d.ts +8 -3
- package/node_modules/undici-types/connector.d.ts +1 -0
- package/node_modules/undici-types/cookies.d.ts +1 -1
- package/node_modules/undici-types/dispatcher.d.ts +3 -3
- package/node_modules/undici-types/errors.d.ts +10 -0
- package/node_modules/undici-types/fetch.d.ts +5 -1
- package/node_modules/undici-types/handlers.d.ts +2 -0
- package/node_modules/undici-types/interceptors.d.ts +1 -1
- package/node_modules/undici-types/mock-interceptor.d.ts +5 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/proxy-agent.d.ts +7 -0
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/compile.cjs +19 -0
- package/node_modules/zod/index.cjs +19 -0
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +8 -7
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v4/classic/external.ts +2 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
- package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
- package/node_modules/zod/src/v4/core/api.ts +44 -28
- package/node_modules/zod/src/v4/core/checks.ts +62 -102
- package/node_modules/zod/src/v4/core/compile.ts +218 -93
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/doc.ts +6 -2
- package/node_modules/zod/src/v4/core/errors.ts +3 -6
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
- package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
- package/node_modules/zod/src/v4/core/parse.ts +37 -16
- package/node_modules/zod/src/v4/core/regexes.ts +14 -4
- package/node_modules/zod/src/v4/core/schemas.ts +296 -132
- 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 +35 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
- package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
- package/node_modules/zod/src/v4/core/util.ts +218 -147
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/locales/ar.ts +2 -0
- package/node_modules/zod/src/v4/locales/az.ts +2 -0
- package/node_modules/zod/src/v4/locales/be.ts +2 -0
- package/node_modules/zod/src/v4/locales/bg.ts +2 -0
- package/node_modules/zod/src/v4/locales/bn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ca.ts +2 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
- package/node_modules/zod/src/v4/locales/cs.ts +2 -0
- package/node_modules/zod/src/v4/locales/da.ts +2 -0
- package/node_modules/zod/src/v4/locales/de.ts +2 -0
- package/node_modules/zod/src/v4/locales/el.ts +2 -0
- package/node_modules/zod/src/v4/locales/en.ts +2 -0
- package/node_modules/zod/src/v4/locales/eo.ts +2 -0
- package/node_modules/zod/src/v4/locales/es.ts +2 -0
- package/node_modules/zod/src/v4/locales/fa.ts +2 -0
- package/node_modules/zod/src/v4/locales/fi.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr.ts +2 -0
- package/node_modules/zod/src/v4/locales/gu.ts +2 -0
- package/node_modules/zod/src/v4/locales/he.ts +2 -0
- package/node_modules/zod/src/v4/locales/hi.ts +2 -0
- package/node_modules/zod/src/v4/locales/hr.ts +2 -0
- package/node_modules/zod/src/v4/locales/hu.ts +2 -0
- package/node_modules/zod/src/v4/locales/hy.ts +2 -0
- package/node_modules/zod/src/v4/locales/id.ts +2 -0
- package/node_modules/zod/src/v4/locales/index.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +2 -0
- package/node_modules/zod/src/v4/locales/it.ts +2 -0
- package/node_modules/zod/src/v4/locales/ja.ts +2 -0
- package/node_modules/zod/src/v4/locales/ka.ts +2 -0
- package/node_modules/zod/src/v4/locales/km.ts +2 -0
- package/node_modules/zod/src/v4/locales/kn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ko.ts +2 -0
- package/node_modules/zod/src/v4/locales/lt.ts +2 -0
- package/node_modules/zod/src/v4/locales/mk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ms.ts +2 -0
- package/node_modules/zod/src/v4/locales/ne.ts +2 -0
- package/node_modules/zod/src/v4/locales/nl.ts +2 -0
- package/node_modules/zod/src/v4/locales/nn.ts +2 -0
- package/node_modules/zod/src/v4/locales/no.ts +2 -0
- package/node_modules/zod/src/v4/locales/ota.ts +2 -0
- package/node_modules/zod/src/v4/locales/pl.ts +2 -0
- package/node_modules/zod/src/v4/locales/ps.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt.ts +2 -0
- package/node_modules/zod/src/v4/locales/ro.ts +2 -0
- package/node_modules/zod/src/v4/locales/ru.ts +2 -0
- package/node_modules/zod/src/v4/locales/sk.ts +2 -0
- package/node_modules/zod/src/v4/locales/sl.ts +2 -0
- package/node_modules/zod/src/v4/locales/sv.ts +2 -0
- package/node_modules/zod/src/v4/locales/ta.ts +2 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +2 -0
- package/node_modules/zod/src/v4/locales/tk.ts +2 -0
- package/node_modules/zod/src/v4/locales/tr.ts +2 -0
- package/node_modules/zod/src/v4/locales/uk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ur.ts +2 -0
- package/node_modules/zod/src/v4/locales/uz.ts +2 -0
- package/node_modules/zod/src/v4/locales/vi.ts +2 -0
- package/node_modules/zod/src/v4/locales/yo.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
- package/node_modules/zod/src/v4/mini/external.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
- package/node_modules/zod/v3/ZodError.cjs +19 -0
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +19 -0
- package/node_modules/zod/v4/classic/checks.cjs +19 -0
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/classic/errors.cjs +19 -0
- package/node_modules/zod/v4/classic/external.cjs +22 -1
- package/node_modules/zod/v4/classic/external.d.cts +1 -1
- package/node_modules/zod/v4/classic/external.d.ts +1 -1
- package/node_modules/zod/v4/classic/external.js +1 -1
- package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
- package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
- package/node_modules/zod/v4/classic/in-out.cjs +19 -0
- package/node_modules/zod/v4/classic/index.cjs +19 -0
- package/node_modules/zod/v4/classic/iso.cjs +19 -0
- package/node_modules/zod/v4/classic/parse.cjs +19 -0
- package/node_modules/zod/v4/classic/schemas.cjs +100 -35
- package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
- package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
- package/node_modules/zod/v4/classic/schemas.js +77 -33
- package/node_modules/zod/v4/core/api.cjs +45 -22
- package/node_modules/zod/v4/core/api.d.cts +12 -6
- package/node_modules/zod/v4/core/api.d.ts +12 -6
- package/node_modules/zod/v4/core/api.js +25 -22
- package/node_modules/zod/v4/core/checks.cjs +51 -97
- package/node_modules/zod/v4/core/checks.d.cts +17 -1
- package/node_modules/zod/v4/core/checks.d.ts +17 -1
- package/node_modules/zod/v4/core/checks.js +31 -96
- package/node_modules/zod/v4/core/compile.cjs +173 -78
- package/node_modules/zod/v4/core/compile.d.cts +18 -4
- package/node_modules/zod/v4/core/compile.d.ts +18 -4
- package/node_modules/zod/v4/core/compile.js +154 -79
- package/node_modules/zod/v4/core/core.cjs +20 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/doc.cjs +26 -2
- package/node_modules/zod/v4/core/doc.js +7 -2
- package/node_modules/zod/v4/core/errors.cjs +21 -5
- package/node_modules/zod/v4/core/errors.js +2 -5
- package/node_modules/zod/v4/core/index.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
- package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/memoizer.cjs +111 -23
- package/node_modules/zod/v4/core/memoizer.js +69 -23
- package/node_modules/zod/v4/core/parse.cjs +56 -16
- package/node_modules/zod/v4/core/parse.js +37 -16
- package/node_modules/zod/v4/core/regexes.cjs +31 -6
- package/node_modules/zod/v4/core/regexes.d.cts +3 -0
- package/node_modules/zod/v4/core/regexes.d.ts +3 -0
- package/node_modules/zod/v4/core/regexes.js +10 -4
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/schemas.cjs +302 -114
- package/node_modules/zod/v4/core/schemas.d.cts +28 -8
- package/node_modules/zod/v4/core/schemas.d.ts +28 -8
- package/node_modules/zod/v4/core/schemas.js +279 -113
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
- package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.js +7 -6
- package/node_modules/zod/v4/core/util.cjs +177 -143
- package/node_modules/zod/v4/core/util.d.cts +25 -4
- package/node_modules/zod/v4/core/util.d.ts +25 -4
- package/node_modules/zod/v4/core/util.js +156 -143
- 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 +19 -0
- package/node_modules/zod/v4/index.cjs +19 -0
- package/node_modules/zod/v4/locales/ar.cjs +2 -0
- package/node_modules/zod/v4/locales/ar.js +2 -0
- package/node_modules/zod/v4/locales/az.cjs +2 -0
- package/node_modules/zod/v4/locales/az.js +2 -0
- package/node_modules/zod/v4/locales/be.cjs +2 -0
- package/node_modules/zod/v4/locales/be.js +2 -0
- package/node_modules/zod/v4/locales/bg.cjs +2 -0
- package/node_modules/zod/v4/locales/bg.js +2 -0
- package/node_modules/zod/v4/locales/bn.cjs +2 -0
- package/node_modules/zod/v4/locales/bn.js +2 -0
- package/node_modules/zod/v4/locales/ca.cjs +2 -0
- package/node_modules/zod/v4/locales/ca.js +2 -0
- package/node_modules/zod/v4/locales/ckb.cjs +2 -0
- package/node_modules/zod/v4/locales/ckb.js +2 -0
- package/node_modules/zod/v4/locales/cs.cjs +2 -0
- package/node_modules/zod/v4/locales/cs.js +2 -0
- package/node_modules/zod/v4/locales/da.cjs +2 -0
- package/node_modules/zod/v4/locales/da.js +2 -0
- package/node_modules/zod/v4/locales/de.cjs +2 -0
- package/node_modules/zod/v4/locales/de.js +2 -0
- package/node_modules/zod/v4/locales/el.cjs +2 -0
- package/node_modules/zod/v4/locales/el.js +2 -0
- package/node_modules/zod/v4/locales/en.cjs +2 -0
- package/node_modules/zod/v4/locales/en.js +2 -0
- package/node_modules/zod/v4/locales/eo.cjs +2 -0
- package/node_modules/zod/v4/locales/eo.js +2 -0
- package/node_modules/zod/v4/locales/es.cjs +2 -0
- package/node_modules/zod/v4/locales/es.js +2 -0
- package/node_modules/zod/v4/locales/fa.cjs +2 -0
- package/node_modules/zod/v4/locales/fa.js +2 -0
- package/node_modules/zod/v4/locales/fi.cjs +2 -0
- package/node_modules/zod/v4/locales/fi.js +2 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
- package/node_modules/zod/v4/locales/fr-CA.js +2 -0
- package/node_modules/zod/v4/locales/fr.cjs +2 -0
- package/node_modules/zod/v4/locales/fr.js +2 -0
- package/node_modules/zod/v4/locales/gu.cjs +2 -0
- package/node_modules/zod/v4/locales/gu.js +2 -0
- package/node_modules/zod/v4/locales/he.cjs +2 -0
- package/node_modules/zod/v4/locales/he.js +2 -0
- package/node_modules/zod/v4/locales/hi.cjs +2 -0
- package/node_modules/zod/v4/locales/hi.js +2 -0
- package/node_modules/zod/v4/locales/hr.cjs +2 -0
- package/node_modules/zod/v4/locales/hr.js +2 -0
- package/node_modules/zod/v4/locales/hu.cjs +2 -0
- package/node_modules/zod/v4/locales/hu.js +2 -0
- package/node_modules/zod/v4/locales/hy.cjs +2 -0
- package/node_modules/zod/v4/locales/hy.js +2 -0
- package/node_modules/zod/v4/locales/id.cjs +2 -0
- package/node_modules/zod/v4/locales/id.js +2 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -1
- package/node_modules/zod/v4/locales/index.d.cts +1 -0
- package/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +2 -0
- package/node_modules/zod/v4/locales/is.js +2 -0
- package/node_modules/zod/v4/locales/it.cjs +2 -0
- package/node_modules/zod/v4/locales/it.js +2 -0
- package/node_modules/zod/v4/locales/ja.cjs +2 -0
- package/node_modules/zod/v4/locales/ja.js +2 -0
- package/node_modules/zod/v4/locales/ka.cjs +2 -0
- package/node_modules/zod/v4/locales/ka.js +2 -0
- package/node_modules/zod/v4/locales/km.cjs +2 -0
- package/node_modules/zod/v4/locales/km.js +2 -0
- package/node_modules/zod/v4/locales/kn.cjs +2 -0
- package/node_modules/zod/v4/locales/kn.js +2 -0
- package/node_modules/zod/v4/locales/ko.cjs +2 -0
- package/node_modules/zod/v4/locales/ko.js +2 -0
- package/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/node_modules/zod/v4/locales/lt.js +2 -0
- package/node_modules/zod/v4/locales/mk.cjs +2 -0
- package/node_modules/zod/v4/locales/mk.js +2 -0
- package/node_modules/zod/v4/locales/ms.cjs +2 -0
- package/node_modules/zod/v4/locales/ms.js +2 -0
- package/node_modules/zod/v4/locales/ne.cjs +2 -0
- package/node_modules/zod/v4/locales/ne.js +2 -0
- package/node_modules/zod/v4/locales/nl.cjs +2 -0
- package/node_modules/zod/v4/locales/nl.js +2 -0
- package/node_modules/zod/v4/locales/nn.cjs +2 -0
- package/node_modules/zod/v4/locales/nn.js +2 -0
- package/node_modules/zod/v4/locales/no.cjs +2 -0
- package/node_modules/zod/v4/locales/no.js +2 -0
- package/node_modules/zod/v4/locales/ota.cjs +2 -0
- package/node_modules/zod/v4/locales/ota.js +2 -0
- package/node_modules/zod/v4/locales/pl.cjs +2 -0
- package/node_modules/zod/v4/locales/pl.js +2 -0
- package/node_modules/zod/v4/locales/ps.cjs +2 -0
- package/node_modules/zod/v4/locales/ps.js +2 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
- package/node_modules/zod/v4/locales/pt-BR.js +2 -0
- package/node_modules/zod/v4/locales/pt.cjs +2 -0
- package/node_modules/zod/v4/locales/pt.js +2 -0
- package/node_modules/zod/v4/locales/ro.cjs +2 -0
- package/node_modules/zod/v4/locales/ro.js +2 -0
- package/node_modules/zod/v4/locales/ru.cjs +2 -0
- package/node_modules/zod/v4/locales/ru.js +2 -0
- package/node_modules/zod/v4/locales/sk.cjs +2 -0
- package/node_modules/zod/v4/locales/sk.js +2 -0
- package/node_modules/zod/v4/locales/sl.cjs +2 -0
- package/node_modules/zod/v4/locales/sl.js +2 -0
- package/node_modules/zod/v4/locales/sv.cjs +2 -0
- package/node_modules/zod/v4/locales/sv.js +2 -0
- package/node_modules/zod/v4/locales/ta.cjs +2 -0
- package/node_modules/zod/v4/locales/ta.js +2 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +2 -0
- package/node_modules/zod/v4/locales/th.js +2 -0
- package/node_modules/zod/v4/locales/tk.cjs +2 -0
- package/node_modules/zod/v4/locales/tk.js +2 -0
- package/node_modules/zod/v4/locales/tr.cjs +2 -0
- package/node_modules/zod/v4/locales/tr.js +2 -0
- package/node_modules/zod/v4/locales/uk.cjs +2 -0
- package/node_modules/zod/v4/locales/uk.js +2 -0
- package/node_modules/zod/v4/locales/ur.cjs +2 -0
- package/node_modules/zod/v4/locales/ur.js +2 -0
- package/node_modules/zod/v4/locales/uz.cjs +2 -0
- package/node_modules/zod/v4/locales/uz.js +2 -0
- package/node_modules/zod/v4/locales/vi.cjs +2 -0
- package/node_modules/zod/v4/locales/vi.js +2 -0
- package/node_modules/zod/v4/locales/yo.cjs +2 -0
- package/node_modules/zod/v4/locales/yo.js +2 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-CN.js +2 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-TW.js +2 -0
- package/node_modules/zod/v4/mini/checks.cjs +19 -0
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/mini/external.cjs +22 -1
- package/node_modules/zod/v4/mini/external.d.cts +1 -1
- package/node_modules/zod/v4/mini/external.d.ts +1 -1
- package/node_modules/zod/v4/mini/external.js +1 -1
- package/node_modules/zod/v4/mini/in-out.cjs +19 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +19 -0
- package/node_modules/zod/v4/mini/schemas.cjs +44 -8
- package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
- package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
- package/node_modules/zod/v4/mini/schemas.js +21 -6
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/package.json +2 -2
- package/slingshot/index.js +201 -198
- package/node_modules/jose/dist/webapi/lib/base64.js +0 -20
- package/node_modules/jose/dist/webapi/lib/crypto_key.js +0 -27
- package/node_modules/jose/dist/webapi/lib/helpers.js +0 -45
- package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +0 -12
- package/node_modules/jose/dist/webapi/lib/is_key_like.js +0 -19
- package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +0 -19
- package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +0 -10
- package/node_modules/jose/dist/webapi/lib/key_options.js +0 -8
- package/node_modules/jose/dist/webapi/lib/signing.js +0 -22
- package/node_modules/jose/dist/webapi/lib/type_checks.js +0 -30
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.$ZodCyclicError = void 0;
|
|
4
27
|
exports.isRecursiveSchema = isRecursiveSchema;
|
|
5
28
|
exports.memoizer = memoizer;
|
|
6
29
|
exports.isBackEdge = isBackEdge;
|
|
30
|
+
const util = __importStar(require("./util.cjs"));
|
|
7
31
|
class $ZodCyclicError extends Error {
|
|
8
32
|
constructor() {
|
|
9
33
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -14,32 +38,62 @@ exports.$ZodCyclicError = $ZodCyclicError;
|
|
|
14
38
|
/** Keyed off the context object every schema in one parse call already shares. */
|
|
15
39
|
const STATE = "~memo";
|
|
16
40
|
const NO_ISSUES = [];
|
|
41
|
+
// a value a cycle can close through
|
|
42
|
+
function isRef(value) {
|
|
43
|
+
return value !== null && typeof value === "object";
|
|
44
|
+
}
|
|
17
45
|
// Receivers prefix paths in place, so the cache and every hand-out need their own copies.
|
|
18
46
|
function cloneIssues(issues) {
|
|
19
47
|
return issues.map((iss) => (iss.path ? { ...iss, path: iss.path.slice() } : { ...iss }));
|
|
20
48
|
}
|
|
21
49
|
const recursive = /*@__PURE__*/ new WeakMap();
|
|
50
|
+
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
|
|
51
|
+
const NONE = 0;
|
|
52
|
+
const ASSUMED = 1;
|
|
53
|
+
const PROVEN = 2;
|
|
22
54
|
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
|
|
23
|
-
function isRecursive(inst, stack) {
|
|
55
|
+
function isRecursive(inst, stack, resolve) {
|
|
24
56
|
const cached = recursive.get(inst);
|
|
25
57
|
if (cached !== undefined)
|
|
26
|
-
return cached;
|
|
58
|
+
return cached ? PROVEN : NONE;
|
|
27
59
|
// Relative to the walk in progress, so not cached.
|
|
28
60
|
if (stack.has(inst))
|
|
29
|
-
return
|
|
61
|
+
return PROVEN;
|
|
30
62
|
stack.add(inst);
|
|
31
|
-
let result =
|
|
63
|
+
let result = NONE;
|
|
32
64
|
const check = (child) => {
|
|
33
|
-
if (
|
|
34
|
-
|
|
65
|
+
if (result !== PROVEN && child?._zod) {
|
|
66
|
+
const answer = isRecursive(child, stack, resolve);
|
|
67
|
+
if (answer > result)
|
|
68
|
+
result = answer;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
// `Reflect.ownKeys` rather than `Object.keys`, so a cycle through a declared symbol key is still seen
|
|
72
|
+
const shape = (sh, spread) => {
|
|
73
|
+
let answer = NONE;
|
|
74
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
75
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
76
|
+
// an object resolves its shape by spread, so a key it does not enumerate is never parsed; `z.properties` reads every own key and so keeps them all
|
|
77
|
+
if (spread && !desc.enumerable)
|
|
78
|
+
continue;
|
|
79
|
+
// resolving runs user code, and a factory mints a fresh subtree per read, so an edge the walk can't follow counts as a cycle
|
|
80
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
81
|
+
if (child > answer)
|
|
82
|
+
answer = child;
|
|
83
|
+
}
|
|
84
|
+
return answer;
|
|
85
|
+
};
|
|
86
|
+
const merge = (answer) => {
|
|
87
|
+
if (answer > result)
|
|
88
|
+
result = answer;
|
|
35
89
|
};
|
|
36
90
|
const def = inst._zod.def;
|
|
37
91
|
const kind = def.type;
|
|
38
92
|
switch (kind) {
|
|
39
93
|
case "object": {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
94
|
+
const raw = util.rawShape(def);
|
|
95
|
+
// a def with no raw shape answers `shape` from an accessor of its own, and running that can mint a whole fresh subtree
|
|
96
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
43
97
|
check(def.catchall);
|
|
44
98
|
break;
|
|
45
99
|
}
|
|
@@ -86,10 +140,13 @@ function isRecursive(inst, stack) {
|
|
|
86
140
|
check(def.input);
|
|
87
141
|
check(def.output);
|
|
88
142
|
break;
|
|
89
|
-
//
|
|
90
|
-
case "lazy":
|
|
91
|
-
|
|
143
|
+
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
144
|
+
case "lazy": {
|
|
145
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);
|
|
146
|
+
// walked with resolution off: one hop sees past the deferral, and a lazy that yields only another unresolved lazy is generative, so it stops there
|
|
147
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
92
148
|
break;
|
|
149
|
+
}
|
|
93
150
|
// a leaf by choice: `parts` are regex fragments, not data positions
|
|
94
151
|
case "template_literal":
|
|
95
152
|
// leaves
|
|
@@ -133,8 +190,13 @@ function isRecursive(inst, stack) {
|
|
|
133
190
|
}
|
|
134
191
|
}
|
|
135
192
|
stack.delete(inst);
|
|
136
|
-
|
|
137
|
-
|
|
193
|
+
return settle(inst, result);
|
|
194
|
+
}
|
|
195
|
+
/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */
|
|
196
|
+
function settle(inst, answer) {
|
|
197
|
+
if (answer !== ASSUMED)
|
|
198
|
+
recursive.set(inst, answer === PROVEN);
|
|
199
|
+
return answer;
|
|
138
200
|
}
|
|
139
201
|
/**
|
|
140
202
|
* Whether one parse can re-enter this schema, i.e. its subtree contains a cycle.
|
|
@@ -143,12 +205,13 @@ function isRecursive(inst, stack) {
|
|
|
143
205
|
* generated fast path has no context to key on.
|
|
144
206
|
*/
|
|
145
207
|
function isRecursiveSchema(inst) {
|
|
146
|
-
|
|
208
|
+
// z.compile never parses, so nothing would ever resolve a lazy for it; it runs once and already treats a throw here as recursive
|
|
209
|
+
return isRecursive(inst, new Set(), true) !== NONE;
|
|
147
210
|
}
|
|
148
211
|
function bucketFor(state, inst) {
|
|
149
212
|
let bucket = state.buckets.get(inst);
|
|
150
213
|
if (!bucket) {
|
|
151
|
-
bucket = new
|
|
214
|
+
bucket = new WeakMap();
|
|
152
215
|
state.buckets.set(inst, bucket);
|
|
153
216
|
}
|
|
154
217
|
return bucket;
|
|
@@ -187,7 +250,8 @@ const memo = {
|
|
|
187
250
|
attach(inst) {
|
|
188
251
|
var _a;
|
|
189
252
|
let isRecursiveInst;
|
|
190
|
-
|
|
253
|
+
let rechecked = false;
|
|
254
|
+
// a recursive schema is re-entered many times per parse and its bucket never changes
|
|
191
255
|
let lastCtx;
|
|
192
256
|
let lastBucket;
|
|
193
257
|
// Wraps `parse` in a deferred so it sees the container's final parse. Core's own deferred copies `parse` into `run` when there are no checks, and it ran first, so `run` is patched to match; with checks, `run` reads `parse` dynamically.
|
|
@@ -196,21 +260,26 @@ const memo = {
|
|
|
196
260
|
const base = inst._zod.parse;
|
|
197
261
|
const wrapped = (payload, ctx) => {
|
|
198
262
|
if (isRecursiveInst === undefined) {
|
|
199
|
-
|
|
200
|
-
if (
|
|
263
|
+
const walked = isRecursive(inst, new Set(), false);
|
|
264
|
+
if (walked === NONE) {
|
|
201
265
|
// Nothing here can ever fire, so take it back out.
|
|
202
266
|
inst._zod.parse = base;
|
|
203
267
|
if (inst._zod.run === wrapped)
|
|
204
268
|
inst._zod.run = base;
|
|
205
269
|
return base(payload, ctx);
|
|
206
270
|
}
|
|
271
|
+
// this parse resolves the deferred edges on its own path, so ask once more before latching
|
|
272
|
+
if (walked === PROVEN || rechecked)
|
|
273
|
+
isRecursiveInst = true;
|
|
274
|
+
else
|
|
275
|
+
rechecked = true;
|
|
207
276
|
}
|
|
208
277
|
const input = payload.value;
|
|
209
|
-
if (input
|
|
278
|
+
if (!isRef(input))
|
|
210
279
|
return base(payload, ctx);
|
|
211
280
|
let state = ctx[STATE];
|
|
212
281
|
if (!state) {
|
|
213
|
-
state = { buckets: new
|
|
282
|
+
state = { buckets: new WeakMap(), backEdges: undefined };
|
|
214
283
|
ctx[STATE] = state;
|
|
215
284
|
}
|
|
216
285
|
let bucket;
|
|
@@ -232,7 +301,7 @@ const memo = {
|
|
|
232
301
|
else {
|
|
233
302
|
// Still being parsed: its own checks cover it, so skip them here.
|
|
234
303
|
payload.memo = true;
|
|
235
|
-
state.backEdges ?? (state.backEdges = new
|
|
304
|
+
state.backEdges ?? (state.backEdges = new WeakSet());
|
|
236
305
|
state.backEdges.add(hit.value);
|
|
237
306
|
}
|
|
238
307
|
return payload;
|
|
@@ -268,5 +337,24 @@ function memoizer() {
|
|
|
268
337
|
/** Whether this value is a node a back-edge resolved to before it finished. */
|
|
269
338
|
function isBackEdge(ctx, value) {
|
|
270
339
|
const backEdges = ctx[STATE]?.backEdges;
|
|
271
|
-
return backEdges !== undefined && value
|
|
340
|
+
return backEdges !== undefined && isRef(value) && backEdges.has(value);
|
|
272
341
|
}
|
|
342
|
+
|
|
343
|
+
// seal-cjs-exports
|
|
344
|
+
(function () {
|
|
345
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
346
|
+
for (var i = 0; i < keys.length; i++) {
|
|
347
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
348
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
349
|
+
var value;
|
|
350
|
+
try {
|
|
351
|
+
value = desc.get();
|
|
352
|
+
} catch (e) {
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
355
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
356
|
+
if (value === undefined) continue;
|
|
357
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
358
|
+
}
|
|
359
|
+
Object.freeze(exports);
|
|
360
|
+
})();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as util from "./util.js";
|
|
1
2
|
export class $ZodCyclicError extends Error {
|
|
2
3
|
constructor() {
|
|
3
4
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -7,32 +8,62 @@ export class $ZodCyclicError extends Error {
|
|
|
7
8
|
/** Keyed off the context object every schema in one parse call already shares. */
|
|
8
9
|
const STATE = "~memo";
|
|
9
10
|
const NO_ISSUES = [];
|
|
11
|
+
// a value a cycle can close through
|
|
12
|
+
function isRef(value) {
|
|
13
|
+
return value !== null && typeof value === "object";
|
|
14
|
+
}
|
|
10
15
|
// Receivers prefix paths in place, so the cache and every hand-out need their own copies.
|
|
11
16
|
function cloneIssues(issues) {
|
|
12
17
|
return issues.map((iss) => (iss.path ? { ...iss, path: iss.path.slice() } : { ...iss }));
|
|
13
18
|
}
|
|
14
19
|
const recursive = /*@__PURE__*/ new WeakMap();
|
|
20
|
+
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
|
|
21
|
+
const NONE = 0;
|
|
22
|
+
const ASSUMED = 1;
|
|
23
|
+
const PROVEN = 2;
|
|
15
24
|
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
|
|
16
|
-
function isRecursive(inst, stack) {
|
|
25
|
+
function isRecursive(inst, stack, resolve) {
|
|
17
26
|
const cached = recursive.get(inst);
|
|
18
27
|
if (cached !== undefined)
|
|
19
|
-
return cached;
|
|
28
|
+
return cached ? PROVEN : NONE;
|
|
20
29
|
// Relative to the walk in progress, so not cached.
|
|
21
30
|
if (stack.has(inst))
|
|
22
|
-
return
|
|
31
|
+
return PROVEN;
|
|
23
32
|
stack.add(inst);
|
|
24
|
-
let result =
|
|
33
|
+
let result = NONE;
|
|
25
34
|
const check = (child) => {
|
|
26
|
-
if (
|
|
27
|
-
|
|
35
|
+
if (result !== PROVEN && child?._zod) {
|
|
36
|
+
const answer = isRecursive(child, stack, resolve);
|
|
37
|
+
if (answer > result)
|
|
38
|
+
result = answer;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
// `Reflect.ownKeys` rather than `Object.keys`, so a cycle through a declared symbol key is still seen
|
|
42
|
+
const shape = (sh, spread) => {
|
|
43
|
+
let answer = NONE;
|
|
44
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
45
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
46
|
+
// an object resolves its shape by spread, so a key it does not enumerate is never parsed; `z.properties` reads every own key and so keeps them all
|
|
47
|
+
if (spread && !desc.enumerable)
|
|
48
|
+
continue;
|
|
49
|
+
// resolving runs user code, and a factory mints a fresh subtree per read, so an edge the walk can't follow counts as a cycle
|
|
50
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
51
|
+
if (child > answer)
|
|
52
|
+
answer = child;
|
|
53
|
+
}
|
|
54
|
+
return answer;
|
|
55
|
+
};
|
|
56
|
+
const merge = (answer) => {
|
|
57
|
+
if (answer > result)
|
|
58
|
+
result = answer;
|
|
28
59
|
};
|
|
29
60
|
const def = inst._zod.def;
|
|
30
61
|
const kind = def.type;
|
|
31
62
|
switch (kind) {
|
|
32
63
|
case "object": {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
64
|
+
const raw = util.rawShape(def);
|
|
65
|
+
// a def with no raw shape answers `shape` from an accessor of its own, and running that can mint a whole fresh subtree
|
|
66
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
36
67
|
check(def.catchall);
|
|
37
68
|
break;
|
|
38
69
|
}
|
|
@@ -79,10 +110,13 @@ function isRecursive(inst, stack) {
|
|
|
79
110
|
check(def.input);
|
|
80
111
|
check(def.output);
|
|
81
112
|
break;
|
|
82
|
-
//
|
|
83
|
-
case "lazy":
|
|
84
|
-
|
|
113
|
+
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
114
|
+
case "lazy": {
|
|
115
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : undefined);
|
|
116
|
+
// walked with resolution off: one hop sees past the deferral, and a lazy that yields only another unresolved lazy is generative, so it stops there
|
|
117
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
85
118
|
break;
|
|
119
|
+
}
|
|
86
120
|
// a leaf by choice: `parts` are regex fragments, not data positions
|
|
87
121
|
case "template_literal":
|
|
88
122
|
// leaves
|
|
@@ -126,8 +160,13 @@ function isRecursive(inst, stack) {
|
|
|
126
160
|
}
|
|
127
161
|
}
|
|
128
162
|
stack.delete(inst);
|
|
129
|
-
|
|
130
|
-
|
|
163
|
+
return settle(inst, result);
|
|
164
|
+
}
|
|
165
|
+
/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */
|
|
166
|
+
function settle(inst, answer) {
|
|
167
|
+
if (answer !== ASSUMED)
|
|
168
|
+
recursive.set(inst, answer === PROVEN);
|
|
169
|
+
return answer;
|
|
131
170
|
}
|
|
132
171
|
/**
|
|
133
172
|
* Whether one parse can re-enter this schema, i.e. its subtree contains a cycle.
|
|
@@ -136,12 +175,13 @@ function isRecursive(inst, stack) {
|
|
|
136
175
|
* generated fast path has no context to key on.
|
|
137
176
|
*/
|
|
138
177
|
export function isRecursiveSchema(inst) {
|
|
139
|
-
|
|
178
|
+
// z.compile never parses, so nothing would ever resolve a lazy for it; it runs once and already treats a throw here as recursive
|
|
179
|
+
return isRecursive(inst, new Set(), true) !== NONE;
|
|
140
180
|
}
|
|
141
181
|
function bucketFor(state, inst) {
|
|
142
182
|
let bucket = state.buckets.get(inst);
|
|
143
183
|
if (!bucket) {
|
|
144
|
-
bucket = new
|
|
184
|
+
bucket = new WeakMap();
|
|
145
185
|
state.buckets.set(inst, bucket);
|
|
146
186
|
}
|
|
147
187
|
return bucket;
|
|
@@ -180,7 +220,8 @@ const memo = {
|
|
|
180
220
|
attach(inst) {
|
|
181
221
|
var _a;
|
|
182
222
|
let isRecursiveInst;
|
|
183
|
-
|
|
223
|
+
let rechecked = false;
|
|
224
|
+
// a recursive schema is re-entered many times per parse and its bucket never changes
|
|
184
225
|
let lastCtx;
|
|
185
226
|
let lastBucket;
|
|
186
227
|
// Wraps `parse` in a deferred so it sees the container's final parse. Core's own deferred copies `parse` into `run` when there are no checks, and it ran first, so `run` is patched to match; with checks, `run` reads `parse` dynamically.
|
|
@@ -189,21 +230,26 @@ const memo = {
|
|
|
189
230
|
const base = inst._zod.parse;
|
|
190
231
|
const wrapped = (payload, ctx) => {
|
|
191
232
|
if (isRecursiveInst === undefined) {
|
|
192
|
-
|
|
193
|
-
if (
|
|
233
|
+
const walked = isRecursive(inst, new Set(), false);
|
|
234
|
+
if (walked === NONE) {
|
|
194
235
|
// Nothing here can ever fire, so take it back out.
|
|
195
236
|
inst._zod.parse = base;
|
|
196
237
|
if (inst._zod.run === wrapped)
|
|
197
238
|
inst._zod.run = base;
|
|
198
239
|
return base(payload, ctx);
|
|
199
240
|
}
|
|
241
|
+
// this parse resolves the deferred edges on its own path, so ask once more before latching
|
|
242
|
+
if (walked === PROVEN || rechecked)
|
|
243
|
+
isRecursiveInst = true;
|
|
244
|
+
else
|
|
245
|
+
rechecked = true;
|
|
200
246
|
}
|
|
201
247
|
const input = payload.value;
|
|
202
|
-
if (input
|
|
248
|
+
if (!isRef(input))
|
|
203
249
|
return base(payload, ctx);
|
|
204
250
|
let state = ctx[STATE];
|
|
205
251
|
if (!state) {
|
|
206
|
-
state = { buckets: new
|
|
252
|
+
state = { buckets: new WeakMap(), backEdges: undefined };
|
|
207
253
|
ctx[STATE] = state;
|
|
208
254
|
}
|
|
209
255
|
let bucket;
|
|
@@ -225,7 +271,7 @@ const memo = {
|
|
|
225
271
|
else {
|
|
226
272
|
// Still being parsed: its own checks cover it, so skip them here.
|
|
227
273
|
payload.memo = true;
|
|
228
|
-
state.backEdges ?? (state.backEdges = new
|
|
274
|
+
state.backEdges ?? (state.backEdges = new WeakSet());
|
|
229
275
|
state.backEdges.add(hit.value);
|
|
230
276
|
}
|
|
231
277
|
return payload;
|
|
@@ -261,5 +307,5 @@ export function memoizer() {
|
|
|
261
307
|
/** Whether this value is a node a back-edge resolved to before it finished. */
|
|
262
308
|
export function isBackEdge(ctx, value) {
|
|
263
309
|
const backEdges = ctx[STATE]?.backEdges;
|
|
264
|
-
return backEdges !== undefined && value
|
|
310
|
+
return backEdges !== undefined && isRef(value) && backEdges.has(value);
|
|
265
311
|
}
|
|
@@ -72,26 +72,38 @@ const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
72
72
|
if (result instanceof Promise) {
|
|
73
73
|
throw new core.$ZodAsyncError();
|
|
74
74
|
}
|
|
75
|
-
return result.issues.length
|
|
76
|
-
? {
|
|
77
|
-
success: false,
|
|
78
|
-
error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
79
|
-
}
|
|
80
|
-
: { success: true, data: result.value };
|
|
75
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
81
76
|
};
|
|
82
77
|
exports._safeParse = _safeParse;
|
|
83
78
|
exports.safeParse = (0, exports._safeParse)(errors.$ZodRealError);
|
|
79
|
+
// the error is built on the first read of `error`: finalizing the issues and constructing the instance is most of a failing parse, and a caller that only branches on `success` never pays it. a getter in the literal keeps this small; the alternative, one shared accessor descriptor plus a hidden state slot, reads ~15% faster but costs ~75 B gzipped in every bundle
|
|
80
|
+
function failure(Err, issues, ctx) {
|
|
81
|
+
let error;
|
|
82
|
+
return {
|
|
83
|
+
success: false,
|
|
84
|
+
get error() {
|
|
85
|
+
if (!error) {
|
|
86
|
+
error = new Err(issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
|
|
87
|
+
// finalizeIssue drops `input`, so the built error holds nothing; keeping the raw issues past this point pins the parsed value for the life of the result
|
|
88
|
+
issues = undefined;
|
|
89
|
+
ctx = undefined;
|
|
90
|
+
}
|
|
91
|
+
return error;
|
|
92
|
+
},
|
|
93
|
+
set error(e) {
|
|
94
|
+
error = e;
|
|
95
|
+
// a replacement makes the getter's branch unreachable, so the captures have to go here too
|
|
96
|
+
issues = undefined;
|
|
97
|
+
ctx = undefined;
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
84
101
|
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
85
102
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
86
103
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
87
104
|
if (result instanceof Promise)
|
|
88
105
|
result = await result;
|
|
89
|
-
return result.issues.length
|
|
90
|
-
? {
|
|
91
|
-
success: false,
|
|
92
|
-
error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
93
|
-
}
|
|
94
|
-
: { success: true, data: result.value };
|
|
106
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
95
107
|
};
|
|
96
108
|
exports._safeParseAsync = _safeParseAsync;
|
|
97
109
|
exports.safeParseAsync = (0, exports._safeParseAsync)(errors.$ZodRealError);
|
|
@@ -101,12 +113,19 @@ const COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
|
101
113
|
// Deliberately tiny, because v8 will not inline a body carrying the fallback's object literals and throw. Everything that is not the compiled happy path lives in validateFallback, and that split is worth ~35% on a compiled schema.
|
|
102
114
|
exports.validate = ((schema, value, _ctx) => {
|
|
103
115
|
const validator = schema._zod.bag.validator;
|
|
104
|
-
if (validator !== undefined
|
|
105
|
-
|
|
116
|
+
if (validator !== undefined) {
|
|
117
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
118
|
+
return true;
|
|
119
|
+
// a definite sentinel means the runtime would reject, so skip the re-parse; a ctx can still change the answer
|
|
120
|
+
if (validator.definite === true && _ctx === undefined)
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
106
123
|
return validateFallback(schema, value, _ctx);
|
|
107
124
|
});
|
|
108
125
|
function validateFallback(schema, value, _ctx) {
|
|
109
|
-
const ctx = _ctx
|
|
126
|
+
const ctx = _ctx
|
|
127
|
+
? { ..._ctx, async: false, abortEarly: true }
|
|
128
|
+
: { async: false, abortEarly: true };
|
|
110
129
|
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
111
130
|
let result;
|
|
112
131
|
if (fallbackRun) {
|
|
@@ -124,7 +143,9 @@ function validateFallback(schema, value, _ctx) {
|
|
|
124
143
|
}
|
|
125
144
|
// no fast path: the compiler keeps async parses on the runtime, because a promise-returning callback that is not declared async compiles to a throw
|
|
126
145
|
const validateAsync = async (schema, value, _ctx) => {
|
|
127
|
-
const ctx = _ctx
|
|
146
|
+
const ctx = _ctx
|
|
147
|
+
? { ..._ctx, async: true, abortEarly: true }
|
|
148
|
+
: { async: true, abortEarly: true };
|
|
128
149
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
129
150
|
if (result instanceof Promise)
|
|
130
151
|
result = await result;
|
|
@@ -191,3 +212,22 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
191
212
|
};
|
|
192
213
|
exports._safeDecodeAsync = _safeDecodeAsync;
|
|
193
214
|
exports.safeDecodeAsync = (0, exports._safeDecodeAsync)(errors.$ZodRealError);
|
|
215
|
+
|
|
216
|
+
// seal-cjs-exports
|
|
217
|
+
(function () {
|
|
218
|
+
var keys = Object.getOwnPropertyNames(exports);
|
|
219
|
+
for (var i = 0; i < keys.length; i++) {
|
|
220
|
+
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
|
|
221
|
+
if (!desc || !desc.get || !desc.configurable) continue;
|
|
222
|
+
var value;
|
|
223
|
+
try {
|
|
224
|
+
value = desc.get();
|
|
225
|
+
} catch (e) {
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
// a circular require may not have settled this one yet, so leave it live
|
|
229
|
+
if (value === undefined) continue;
|
|
230
|
+
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
|
|
231
|
+
}
|
|
232
|
+
Object.freeze(exports);
|
|
233
|
+
})();
|
|
@@ -44,25 +44,37 @@ export const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
|
44
44
|
if (result instanceof Promise) {
|
|
45
45
|
throw new core.$ZodAsyncError();
|
|
46
46
|
}
|
|
47
|
-
return result.issues.length
|
|
48
|
-
? {
|
|
49
|
-
success: false,
|
|
50
|
-
error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
51
|
-
}
|
|
52
|
-
: { success: true, data: result.value };
|
|
47
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
53
48
|
};
|
|
54
49
|
export const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);
|
|
50
|
+
// the error is built on the first read of `error`: finalizing the issues and constructing the instance is most of a failing parse, and a caller that only branches on `success` never pays it. a getter in the literal keeps this small; the alternative, one shared accessor descriptor plus a hidden state slot, reads ~15% faster but costs ~75 B gzipped in every bundle
|
|
51
|
+
function failure(Err, issues, ctx) {
|
|
52
|
+
let error;
|
|
53
|
+
return {
|
|
54
|
+
success: false,
|
|
55
|
+
get error() {
|
|
56
|
+
if (!error) {
|
|
57
|
+
error = new Err(issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
|
|
58
|
+
// finalizeIssue drops `input`, so the built error holds nothing; keeping the raw issues past this point pins the parsed value for the life of the result
|
|
59
|
+
issues = undefined;
|
|
60
|
+
ctx = undefined;
|
|
61
|
+
}
|
|
62
|
+
return error;
|
|
63
|
+
},
|
|
64
|
+
set error(e) {
|
|
65
|
+
error = e;
|
|
66
|
+
// a replacement makes the getter's branch unreachable, so the captures have to go here too
|
|
67
|
+
issues = undefined;
|
|
68
|
+
ctx = undefined;
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
55
72
|
export const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
56
73
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
57
74
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
58
75
|
if (result instanceof Promise)
|
|
59
76
|
result = await result;
|
|
60
|
-
return result.issues.length
|
|
61
|
-
? {
|
|
62
|
-
success: false,
|
|
63
|
-
error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
64
|
-
}
|
|
65
|
-
: { success: true, data: result.value };
|
|
77
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : { success: true, data: result.value };
|
|
66
78
|
};
|
|
67
79
|
export const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);
|
|
68
80
|
// registry mirrors of the compiler's sentinels, so this module never imports the compiler
|
|
@@ -71,12 +83,19 @@ const COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
|
71
83
|
// Deliberately tiny, because v8 will not inline a body carrying the fallback's object literals and throw. Everything that is not the compiled happy path lives in validateFallback, and that split is worth ~35% on a compiled schema.
|
|
72
84
|
export const validate = ((schema, value, _ctx) => {
|
|
73
85
|
const validator = schema._zod.bag.validator;
|
|
74
|
-
if (validator !== undefined
|
|
75
|
-
|
|
86
|
+
if (validator !== undefined) {
|
|
87
|
+
if (validator(value) !== COMPILE_INVALID)
|
|
88
|
+
return true;
|
|
89
|
+
// a definite sentinel means the runtime would reject, so skip the re-parse; a ctx can still change the answer
|
|
90
|
+
if (validator.definite === true && _ctx === undefined)
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
76
93
|
return validateFallback(schema, value, _ctx);
|
|
77
94
|
});
|
|
78
95
|
function validateFallback(schema, value, _ctx) {
|
|
79
|
-
const ctx = _ctx
|
|
96
|
+
const ctx = _ctx
|
|
97
|
+
? { ..._ctx, async: false, abortEarly: true }
|
|
98
|
+
: { async: false, abortEarly: true };
|
|
80
99
|
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
81
100
|
let result;
|
|
82
101
|
if (fallbackRun) {
|
|
@@ -94,7 +113,9 @@ function validateFallback(schema, value, _ctx) {
|
|
|
94
113
|
}
|
|
95
114
|
// no fast path: the compiler keeps async parses on the runtime, because a promise-returning callback that is not declared async compiles to a throw
|
|
96
115
|
export const validateAsync = async (schema, value, _ctx) => {
|
|
97
|
-
const ctx = _ctx
|
|
116
|
+
const ctx = _ctx
|
|
117
|
+
? { ..._ctx, async: true, abortEarly: true }
|
|
118
|
+
: { async: true, abortEarly: true };
|
|
98
119
|
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
99
120
|
if (result instanceof Promise)
|
|
100
121
|
result = await result;
|