@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
|
@@ -98,11 +98,29 @@ type ToZodKeyMismatch<Expected, Received> = schemas.$ZodType & {
|
|
|
98
98
|
"types do not match": { expected: Expected; received: Received };
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
// An enum reference and the union of exactly its members are mutually assignable but not identical, so `AssertEqual` alone rejects `z.enum(SomeEnum)` against a `SomeEnum` target. Unioning each side with a private dummy forces the union to be rebuilt, which collapses that one difference and nothing else — plain literals against an enum, member subsets, brands and `any` all still fail. The symbol is not exported, so no user type can smuggle it in and cancel a real difference.
|
|
102
|
+
declare const toZodDummy: unique symbol;
|
|
103
|
+
|
|
104
|
+
// Homomorphic, so `readonly` and optional modifiers survive the rebuild and only leaves are normalized. An intersection flattens here, which is why an intersection target and the flat object with the same keys match each other. A callable stops the walk because `keyof` a function is `never`, so mapping one would erase its signature and make every function compare equal.
|
|
105
|
+
type ToZodNormalize<T> = [T] extends [(...args: any[]) => any]
|
|
106
|
+
? T
|
|
107
|
+
: [T] extends [object]
|
|
108
|
+
? { [K in keyof T]: ToZodNormalize<T[K]> }
|
|
109
|
+
: T | typeof toZodDummy;
|
|
110
|
+
|
|
111
|
+
type ToZodEqual<Output, T> = AssertEqual<Output, T> extends true
|
|
112
|
+
? true
|
|
113
|
+
: IsAny<Output> extends true
|
|
114
|
+
? false
|
|
115
|
+
: IsAny<T> extends true
|
|
116
|
+
? false
|
|
117
|
+
: AssertEqual<ToZodNormalize<Output>, ToZodNormalize<T>>;
|
|
118
|
+
|
|
101
119
|
// Rebuilds the shape with a marker on each key that disagrees, so the diagnostic names the key instead of failing the whole schema at the top level. A key the target lacks reports `expected: never`; a key the schema lacks reports `received: never`.
|
|
102
120
|
type ToZodShape<Shape, T> = {
|
|
103
121
|
[K in keyof Shape]: Shape[K] extends schemas.$ZodType
|
|
104
122
|
? K extends keyof T
|
|
105
|
-
?
|
|
123
|
+
? ToZodEqual<Shape[K]["_zod"]["output"], T[K]> extends true
|
|
106
124
|
? Shape[K]
|
|
107
125
|
: ToZodKeyMismatch<T[K], Shape[K]["_zod"]["output"]>
|
|
108
126
|
: ToZodKeyMismatch<never, Shape[K]["_zod"]["output"]>
|
|
@@ -129,6 +147,17 @@ export type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K
|
|
|
129
147
|
export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
|
|
130
148
|
export type NoUndefined<T> = T extends undefined ? never : T;
|
|
131
149
|
export type Whatever = {} | undefined | null;
|
|
150
|
+
// literal inputs widen to their primitive so a property check over `"https:"` accepts a `string` property
|
|
151
|
+
export type Widen<T> = T extends string
|
|
152
|
+
? string
|
|
153
|
+
: T extends number
|
|
154
|
+
? number
|
|
155
|
+
: T extends boolean
|
|
156
|
+
? boolean
|
|
157
|
+
: T extends bigint
|
|
158
|
+
? bigint
|
|
159
|
+
: T;
|
|
160
|
+
|
|
132
161
|
export type LoosePartial<T extends object> = InexactPartial<T> & {
|
|
133
162
|
[k: string]: unknown;
|
|
134
163
|
};
|
|
@@ -232,7 +261,7 @@ export function assertNotEqual<A, B>(val: AssertNotEqual<A, B>): AssertNotEqual<
|
|
|
232
261
|
}
|
|
233
262
|
|
|
234
263
|
export function toZod<T>(): <S extends schemas.$ZodType>(
|
|
235
|
-
schema:
|
|
264
|
+
schema: ToZodEqual<S["_zod"]["output"], T> extends true ? S : ToZodTarget<S, T>
|
|
236
265
|
) => S {
|
|
237
266
|
return (schema) => schema as any;
|
|
238
267
|
}
|
|
@@ -261,18 +290,28 @@ export function jsonStringifyReplacer(_: string, value: any): any {
|
|
|
261
290
|
return value;
|
|
262
291
|
}
|
|
263
292
|
|
|
293
|
+
// the accessor lives on a shared prototype: an own accessor makes every box a dictionary-mode object (~360 B and a slow load per read against ~100 B and an inlined getter here)
|
|
294
|
+
class Cached<T> {
|
|
295
|
+
_getter: (() => T) | undefined;
|
|
296
|
+
_value: T | undefined;
|
|
297
|
+
|
|
298
|
+
constructor(getter: () => T) {
|
|
299
|
+
this._getter = getter;
|
|
300
|
+
this._value = undefined;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
get value(): T {
|
|
304
|
+
const getter = this._getter;
|
|
305
|
+
if (getter !== undefined) {
|
|
306
|
+
this._value = getter();
|
|
307
|
+
this._getter = undefined;
|
|
308
|
+
}
|
|
309
|
+
return this._value as T;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
264
313
|
export function cached<T>(getter: () => T): { value: T } {
|
|
265
|
-
|
|
266
|
-
return {
|
|
267
|
-
get value() {
|
|
268
|
-
if (!set) {
|
|
269
|
-
const value = getter();
|
|
270
|
-
Object.defineProperty(this, "value", { value });
|
|
271
|
-
return value;
|
|
272
|
-
}
|
|
273
|
-
throw new Error("cached value already set");
|
|
274
|
-
},
|
|
275
|
-
};
|
|
314
|
+
return new Cached(getter);
|
|
276
315
|
}
|
|
277
316
|
|
|
278
317
|
export function nullish(input: any): boolean {
|
|
@@ -338,6 +377,80 @@ export function assignProp<T extends object, K extends PropertyKey>(
|
|
|
338
377
|
});
|
|
339
378
|
}
|
|
340
379
|
|
|
380
|
+
/** A def's `shape` accessor, carrying whichever object it currently answers from. */
|
|
381
|
+
export interface ShapeGetter {
|
|
382
|
+
(): Record<PropertyKey, any>;
|
|
383
|
+
raw: Record<PropertyKey, any>;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
|
|
388
|
+
*
|
|
389
|
+
* Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
|
|
390
|
+
*/
|
|
391
|
+
export function rawShape(def: any): Record<PropertyKey, any> | undefined {
|
|
392
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
393
|
+
return desc?.get ? (desc.get as ShapeGetter).raw : desc?.value;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// where a builder reads its source's keys and descriptors, resolving only a shape a def answers for itself. A shape resolves by object spread, so only its enumerable keys are ever part of it.
|
|
397
|
+
function sourceShape(schema: schemas.$ZodObject): Record<PropertyKey, any> {
|
|
398
|
+
return rawShape(schema._zod.def) ?? (schema._zod.def.shape as any);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// a key whose value is not settled yet, self-caching so every read after the first gets the same one
|
|
402
|
+
function deferProp(target: object, key: PropertyKey, getter: () => any): void {
|
|
403
|
+
Object.defineProperty(target, key, {
|
|
404
|
+
get(this: any) {
|
|
405
|
+
const value = getter();
|
|
406
|
+
assignProp(this, key as any, value);
|
|
407
|
+
return value;
|
|
408
|
+
},
|
|
409
|
+
enumerable: true,
|
|
410
|
+
configurable: true,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Writes a settled key. A plain assignment is much cheaper than `defineProperty` and produces the same descriptor, but it runs whatever setter already answers to the key — an accessor this shape deferred, or an inherited one, which `__proto__` has on every object and prototype pollution can add for any name.
|
|
415
|
+
function putProp(target: any, key: PropertyKey, value: any): void {
|
|
416
|
+
if (key in target) assignProp(target, key as any, value);
|
|
417
|
+
else target[key] = value;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.
|
|
422
|
+
*
|
|
423
|
+
* A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.
|
|
424
|
+
*/
|
|
425
|
+
function mirrorShape(
|
|
426
|
+
target: object,
|
|
427
|
+
source: schemas.$ZodObject,
|
|
428
|
+
keys: PropertyKey[],
|
|
429
|
+
wrap?: ((value: any, key: PropertyKey) => any) | null
|
|
430
|
+
): void {
|
|
431
|
+
const raw = sourceShape(source);
|
|
432
|
+
for (const key of keys) {
|
|
433
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key)!;
|
|
434
|
+
if (!desc.enumerable) continue;
|
|
435
|
+
if (desc.get) {
|
|
436
|
+
deferProp(target, key, () => {
|
|
437
|
+
const value = (source._zod.def.shape as any)[key];
|
|
438
|
+
return wrap ? wrap(value, key) : value;
|
|
439
|
+
});
|
|
440
|
+
} else putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// same, for a plain shape a caller passed rather than a schema's
|
|
445
|
+
function mirrorProps(target: object, source: Record<PropertyKey, any>): void {
|
|
446
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
447
|
+
const desc = Object.getOwnPropertyDescriptor(source, key)!;
|
|
448
|
+
if (!desc.enumerable) continue;
|
|
449
|
+
if (desc.get) deferProp(target, key, () => source[key as any]);
|
|
450
|
+
else putProp(target, key, desc.value);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
341
454
|
export function mergeDefs(...defs: Record<string, any>[]): any {
|
|
342
455
|
const mergedDescriptors: Record<string, PropertyDescriptor> = {};
|
|
343
456
|
|
|
@@ -647,25 +760,24 @@ export function pick(schema: schemas.$ZodObject, mask: Record<string, unknown>):
|
|
|
647
760
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
648
761
|
}
|
|
649
762
|
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
const newShape: Writeable<schemas.$ZodShape> = {};
|
|
653
|
-
// `for...in` skips symbols, so a symbol in the mask would select nothing
|
|
654
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
655
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
656
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
657
|
-
}
|
|
658
|
-
if (!mask[key as string]) continue;
|
|
659
|
-
assignProp(newShape, key as string, (currDef.shape as any)[key]!);
|
|
660
|
-
}
|
|
763
|
+
const newShape: Writeable<schemas.$ZodShape> = {};
|
|
764
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
661
765
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
},
|
|
665
|
-
checks: [],
|
|
666
|
-
});
|
|
766
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] })) as any;
|
|
767
|
+
}
|
|
667
768
|
|
|
668
|
-
|
|
769
|
+
// the mask keys that select something, checked against the source's shape without resolving it
|
|
770
|
+
function maskedKeys(schema: schemas.$ZodObject, mask: object): PropertyKey[] {
|
|
771
|
+
const raw = sourceShape(schema);
|
|
772
|
+
const keys: PropertyKey[] = [];
|
|
773
|
+
// `for...in` skips symbols, so a symbol in the mask would select nothing
|
|
774
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
775
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
|
|
776
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
777
|
+
}
|
|
778
|
+
if ((mask as any)[key]) keys.push(key);
|
|
779
|
+
}
|
|
780
|
+
return keys;
|
|
669
781
|
}
|
|
670
782
|
|
|
671
783
|
export function omit(schema: schemas.$ZodObject, mask: object): any {
|
|
@@ -677,24 +789,15 @@ export function omit(schema: schemas.$ZodObject, mask: object): any {
|
|
|
677
789
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
678
790
|
}
|
|
679
791
|
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
if (!(mask as any)[key]) continue;
|
|
688
|
-
|
|
689
|
-
delete newShape[key as string];
|
|
690
|
-
}
|
|
691
|
-
assignProp(this, "shape", newShape); // self-caching
|
|
692
|
-
return newShape;
|
|
693
|
-
},
|
|
694
|
-
checks: [],
|
|
695
|
-
});
|
|
792
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
793
|
+
const newShape: Writeable<schemas.$ZodShape> = {};
|
|
794
|
+
mirrorShape(
|
|
795
|
+
newShape,
|
|
796
|
+
schema,
|
|
797
|
+
Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key))
|
|
798
|
+
);
|
|
696
799
|
|
|
697
|
-
return clone(schema,
|
|
800
|
+
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
698
801
|
}
|
|
699
802
|
|
|
700
803
|
export function extend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any {
|
|
@@ -706,7 +809,7 @@ export function extend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): an
|
|
|
706
809
|
const hasChecks = checks && checks.length > 0;
|
|
707
810
|
if (hasChecks) {
|
|
708
811
|
// Only throw if new shape overlaps with existing shape. Use getOwnPropertyDescriptor to check key existence without accessing values
|
|
709
|
-
const existingShape = schema
|
|
812
|
+
const existingShape = sourceShape(schema);
|
|
710
813
|
for (const key of Reflect.ownKeys(shape)) {
|
|
711
814
|
if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
|
|
712
815
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
@@ -714,28 +817,22 @@ export function extend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): an
|
|
|
714
817
|
}
|
|
715
818
|
}
|
|
716
819
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
820
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) })) as any;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// the source's keys, then the caller's overlaid on top
|
|
824
|
+
function extended(schema: schemas.$ZodObject, shape: schemas.$ZodShape): schemas.$ZodShape {
|
|
825
|
+
const newShape: Writeable<schemas.$ZodShape> = {};
|
|
826
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
827
|
+
mirrorProps(newShape, shape);
|
|
828
|
+
return newShape;
|
|
725
829
|
}
|
|
726
830
|
|
|
727
831
|
export function safeExtend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any {
|
|
728
832
|
if (!isPlainObject(shape)) {
|
|
729
833
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
730
834
|
}
|
|
731
|
-
|
|
732
|
-
get shape() {
|
|
733
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
734
|
-
assignProp(this, "shape", _shape); // self-caching
|
|
735
|
-
return _shape;
|
|
736
|
-
},
|
|
737
|
-
});
|
|
738
|
-
return clone(schema, def) as any;
|
|
835
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) })) as any;
|
|
739
836
|
}
|
|
740
837
|
|
|
741
838
|
export function merge(a: schemas.$ZodObject, b: schemas.$ZodObject): any {
|
|
@@ -745,12 +842,12 @@ export function merge(a: schemas.$ZodObject, b: schemas.$ZodObject): any {
|
|
|
745
842
|
if (a._zod.def.checks?.length) {
|
|
746
843
|
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
747
844
|
}
|
|
845
|
+
const newShape: Writeable<schemas.$ZodShape> = {};
|
|
846
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
847
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
848
|
+
|
|
748
849
|
const def = mergeDefs(a._zod.def, {
|
|
749
|
-
|
|
750
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
751
|
-
assignProp(this, "shape", _shape); // self-caching
|
|
752
|
-
return _shape;
|
|
753
|
-
},
|
|
850
|
+
shape: newShape,
|
|
754
851
|
get catchall() {
|
|
755
852
|
return b._zod.def.catchall;
|
|
756
853
|
},
|
|
@@ -773,45 +870,17 @@ export function partial(
|
|
|
773
870
|
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
774
871
|
}
|
|
775
872
|
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
}
|
|
786
|
-
if (!(mask as any)[key]) continue;
|
|
787
|
-
// if (oldShape[key]!._zod.optin === "optional") continue;
|
|
788
|
-
(shape as any)[key] = Class
|
|
789
|
-
? new Class({
|
|
790
|
-
type: "optional",
|
|
791
|
-
innerType: (oldShape as any)[key]!,
|
|
792
|
-
})
|
|
793
|
-
: (oldShape as any)[key]!;
|
|
794
|
-
}
|
|
795
|
-
} else {
|
|
796
|
-
// the spread copies symbol keys; `for...in` would not reach them
|
|
797
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
798
|
-
// if (oldShape[key]!._zod.optin === "optional") continue;
|
|
799
|
-
(shape as any)[key] = Class
|
|
800
|
-
? new Class({
|
|
801
|
-
type: "optional",
|
|
802
|
-
innerType: (oldShape as any)[key]!,
|
|
803
|
-
})
|
|
804
|
-
: (oldShape as any)[key]!;
|
|
805
|
-
}
|
|
806
|
-
}
|
|
873
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
|
|
874
|
+
const newShape: Writeable<schemas.$ZodShape> = {};
|
|
875
|
+
mirrorShape(
|
|
876
|
+
newShape,
|
|
877
|
+
schema,
|
|
878
|
+
Reflect.ownKeys(sourceShape(schema)),
|
|
879
|
+
Class &&
|
|
880
|
+
((value, key) => (selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value })))
|
|
881
|
+
);
|
|
807
882
|
|
|
808
|
-
|
|
809
|
-
return shape;
|
|
810
|
-
},
|
|
811
|
-
checks: [],
|
|
812
|
-
});
|
|
813
|
-
|
|
814
|
-
return clone(schema, def) as any;
|
|
883
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] })) as any;
|
|
815
884
|
}
|
|
816
885
|
|
|
817
886
|
export function required(
|
|
@@ -819,39 +888,14 @@ export function required(
|
|
|
819
888
|
schema: schemas.$ZodObject,
|
|
820
889
|
mask: object | undefined
|
|
821
890
|
): any {
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
for (const key of Reflect.ownKeys(mask)) {
|
|
829
|
-
if (!Object.prototype.hasOwnProperty.call(shape, key)) {
|
|
830
|
-
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
831
|
-
}
|
|
832
|
-
if (!(mask as any)[key]) continue;
|
|
833
|
-
// overwrite with non-optional
|
|
834
|
-
(shape as any)[key] = new Class({
|
|
835
|
-
type: "nonoptional",
|
|
836
|
-
innerType: (oldShape as any)[key]!,
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
} else {
|
|
840
|
-
for (const key of Reflect.ownKeys(oldShape)) {
|
|
841
|
-
// overwrite with non-optional
|
|
842
|
-
(shape as any)[key] = new Class({
|
|
843
|
-
type: "nonoptional",
|
|
844
|
-
innerType: (oldShape as any)[key]!,
|
|
845
|
-
});
|
|
846
|
-
}
|
|
847
|
-
}
|
|
891
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
|
|
892
|
+
const newShape: Writeable<schemas.$ZodShape> = {};
|
|
893
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) =>
|
|
894
|
+
// overwrite with non-optional
|
|
895
|
+
selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value })
|
|
896
|
+
);
|
|
848
897
|
|
|
849
|
-
|
|
850
|
-
return shape;
|
|
851
|
-
},
|
|
852
|
-
});
|
|
853
|
-
|
|
854
|
-
return clone(schema, def) as any;
|
|
898
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape })) as any;
|
|
855
899
|
}
|
|
856
900
|
|
|
857
901
|
export type Constructor<T, Def extends any[] = any[]> = new (...args: Def) => T;
|
|
@@ -920,13 +964,18 @@ export function finalizeIssue(
|
|
|
920
964
|
unwrapMessage(config.localeError?.(iss)) ??
|
|
921
965
|
"Invalid input");
|
|
922
966
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
967
|
+
// an explicit own-key copy beats object rest with excluded keys, which v8 routes through a generic runtime call; Object.keys rather than for-in so an issue pushed with a prototype does not leak inherited keys, and an own __proto__ key is dropped rather than assigned through the setter
|
|
968
|
+
const full: any = {};
|
|
969
|
+
for (const k of Object.keys(iss)) {
|
|
970
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__") continue;
|
|
971
|
+
full[k] = (iss as any)[k];
|
|
972
|
+
}
|
|
973
|
+
full.path ??= [];
|
|
974
|
+
full.message = message;
|
|
926
975
|
if (ctx?.reportInput) {
|
|
927
|
-
|
|
976
|
+
full.input = iss.input;
|
|
928
977
|
}
|
|
929
|
-
return
|
|
978
|
+
return full;
|
|
930
979
|
}
|
|
931
980
|
|
|
932
981
|
export function getSizableOrigin(input: any): "set" | "map" | "file" | "unknown" {
|
|
@@ -1079,17 +1128,39 @@ export function members(proto: object, table: object): void {
|
|
|
1079
1128
|
}
|
|
1080
1129
|
|
|
1081
1130
|
/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
|
|
1082
|
-
export function own<T>(inst: object, key:
|
|
1131
|
+
export function own<T>(inst: object, key: PropertyKey, value: T, enumerable = true): T {
|
|
1083
1132
|
Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
|
|
1084
1133
|
return value;
|
|
1085
1134
|
}
|
|
1086
1135
|
|
|
1087
1136
|
/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
|
|
1088
|
-
export function hide<T>(inst: object, key:
|
|
1137
|
+
export function hide<T>(inst: object, key: PropertyKey, value: T): T {
|
|
1089
1138
|
return own(inst, key, value, false);
|
|
1090
1139
|
}
|
|
1091
1140
|
|
|
1092
|
-
|
|
1141
|
+
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
|
|
1142
|
+
export /*@__NO_SIDE_EFFECTS__*/ function derived<T>(
|
|
1143
|
+
computes: { [K in keyof T]?: (inst: T) => T[K] },
|
|
1144
|
+
table: ProtoOf<T>
|
|
1145
|
+
): ProtoOf<T> {
|
|
1146
|
+
for (const key in computes) {
|
|
1147
|
+
const compute = computes[key]!;
|
|
1148
|
+
// an object literal's accessor is configurable and enumerable, and `members` copies the descriptor as written
|
|
1149
|
+
Object.defineProperty(table, key, {
|
|
1150
|
+
configurable: true,
|
|
1151
|
+
enumerable: true,
|
|
1152
|
+
get(this: T) {
|
|
1153
|
+
return own(this as object, key, compute(this));
|
|
1154
|
+
},
|
|
1155
|
+
set(this: T, value: T[typeof key]) {
|
|
1156
|
+
own(this as object, key, value);
|
|
1157
|
+
},
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
return table;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
function defineBound(proto: object, key: PropertyKey, fn: AnyFunc): void {
|
|
1093
1164
|
Object.defineProperty(proto, key, {
|
|
1094
1165
|
configurable: true,
|
|
1095
1166
|
get(this: any) {
|
|
@@ -46,6 +46,8 @@ const error: () => errors.$ZodErrorMap = () => {
|
|
|
46
46
|
json_string: "συμβολοσειρά JSON",
|
|
47
47
|
e164: "αριθμός E.164",
|
|
48
48
|
credit_card: "αριθμός πιστωτικής κάρτας",
|
|
49
|
+
currency_code: "κωδικός νομίσματος",
|
|
50
|
+
iban: "IBAN",
|
|
49
51
|
jwt: "JWT",
|
|
50
52
|
template_literal: "είσοδος",
|
|
51
53
|
};
|
|
@@ -45,7 +45,9 @@ const error: () => errors.$ZodErrorMap = () => {
|
|
|
45
45
|
base64url: "base64url-encoded string",
|
|
46
46
|
json_string: "JSON string",
|
|
47
47
|
e164: "E.164 number",
|
|
48
|
+
currency_code: "currency code",
|
|
48
49
|
credit_card: "credit card number",
|
|
50
|
+
iban: "IBAN",
|
|
49
51
|
jwt: "JWT",
|
|
50
52
|
template_literal: "input",
|
|
51
53
|
};
|
|
@@ -45,6 +45,8 @@ const error: () => errors.$ZodErrorMap = () => {
|
|
|
45
45
|
json_string: "cadena JSON",
|
|
46
46
|
e164: "número E.164",
|
|
47
47
|
credit_card: "número de tarjeta de crédito",
|
|
48
|
+
currency_code: "código de moneda",
|
|
49
|
+
iban: "IBAN",
|
|
48
50
|
jwt: "JWT",
|
|
49
51
|
template_literal: "entrada",
|
|
50
52
|
};
|
|
@@ -50,6 +50,8 @@ const error: () => errors.$ZodErrorMap = () => {
|
|
|
50
50
|
json_string: "JSON-merkkijono",
|
|
51
51
|
e164: "E.164-luku",
|
|
52
52
|
credit_card: "luottokortin numero",
|
|
53
|
+
currency_code: "valuuttakoodi",
|
|
54
|
+
iban: "IBAN",
|
|
53
55
|
jwt: "JWT",
|
|
54
56
|
template_literal: "templaattimerkkijono",
|
|
55
57
|
};
|