@psnext/slingcli 3.3.20260911-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/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-VDBOM5UG.js → chunk-BRL3MDQL.js} +1 -1
- 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/@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/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/package.json +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert/strict.d.ts +13 -56
- package/node_modules/@types/node/assert.d.ts +189 -190
- package/node_modules/@types/node/async_hooks.d.ts +151 -43
- package/node_modules/@types/node/buffer.buffer.d.ts +12 -13
- package/node_modules/@types/node/buffer.d.ts +103 -237
- package/node_modules/@types/node/child_process.d.ts +39 -154
- package/node_modules/@types/node/cluster.d.ts +238 -384
- package/node_modules/@types/node/console.d.ts +45 -404
- package/node_modules/@types/node/constants.d.ts +3 -10
- package/node_modules/@types/node/crypto.d.ts +1000 -1593
- package/node_modules/@types/node/dgram.d.ts +133 -81
- package/node_modules/@types/node/diagnostics_channel.d.ts +277 -59
- package/node_modules/@types/node/dns/promises.d.ts +9 -15
- package/node_modules/@types/node/dns.d.ts +136 -183
- package/node_modules/@types/node/domain.d.ts +12 -32
- package/node_modules/@types/node/events.d.ts +872 -840
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +256 -85
- package/node_modules/@types/node/fs.d.ts +865 -525
- package/node_modules/@types/node/globals.d.ts +12 -34
- package/node_modules/@types/node/globals.typedarray.d.ts +63 -0
- package/node_modules/@types/node/http.d.ts +433 -312
- package/node_modules/@types/node/http2.d.ts +545 -891
- package/node_modules/@types/node/https.d.ts +64 -243
- package/node_modules/@types/node/index.d.ts +25 -7
- package/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@types/node/inspector.d.ts +70 -58
- package/node_modules/@types/node/inspector.generated.d.ts +764 -410
- package/node_modules/@types/node/module.d.ts +54 -219
- package/node_modules/@types/node/net.d.ts +208 -222
- package/node_modules/@types/node/os.d.ts +41 -49
- package/node_modules/@types/node/package.json +13 -3
- package/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@types/node/path.d.ts +119 -141
- package/node_modules/@types/node/perf_hooks.d.ts +339 -690
- package/node_modules/@types/node/process.d.ts +389 -205
- package/node_modules/@types/node/punycode.d.ts +3 -31
- package/node_modules/@types/node/querystring.d.ts +3 -16
- package/node_modules/@types/node/quic.d.ts +2153 -0
- package/node_modules/@types/node/readline/promises.d.ts +3 -6
- package/node_modules/@types/node/readline.d.ts +66 -152
- package/node_modules/@types/node/repl.d.ts +101 -109
- package/node_modules/@types/node/sea.d.ts +1 -116
- package/node_modules/@types/node/sqlite.d.ts +486 -68
- package/node_modules/@types/node/stream/consumers.d.ts +91 -15
- package/node_modules/@types/node/stream/iter.d.ts +452 -0
- package/node_modules/@types/node/stream/promises.d.ts +136 -15
- package/node_modules/@types/node/stream/web.d.ts +197 -454
- package/node_modules/@types/node/stream.d.ts +603 -491
- package/node_modules/@types/node/string_decoder.d.ts +3 -43
- package/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/node_modules/@types/node/test.d.ts +513 -292
- package/node_modules/@types/node/timers/promises.d.ts +3 -18
- package/node_modules/@types/node/timers.d.ts +3 -141
- package/node_modules/@types/node/tls.d.ts +166 -257
- package/node_modules/@types/node/trace_events.d.ts +3 -97
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -8
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +2 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +26 -6
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/node_modules/@types/node/tty.d.ts +61 -43
- package/node_modules/@types/node/url.d.ts +156 -584
- package/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@types/node/util.d.ts +170 -1099
- package/node_modules/@types/node/v8.d.ts +175 -36
- package/node_modules/@types/node/vfs.d.ts +211 -0
- package/node_modules/@types/node/vm.d.ts +292 -209
- package/node_modules/@types/node/wasi.d.ts +24 -74
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
- package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@types/node/web-globals/events.d.ts +9 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +14 -0
- package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
- package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +97 -0
- package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +257 -407
- package/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@types/node/zlib.d.ts +24 -165
- package/node_modules/undici-types/agent.d.ts +12 -13
- package/node_modules/undici-types/api.d.ts +26 -26
- package/node_modules/undici-types/balanced-pool.d.ts +13 -12
- package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +63 -37
- package/node_modules/undici-types/connector.d.ts +5 -2
- package/node_modules/undici-types/cookies.d.ts +3 -1
- package/node_modules/undici-types/diagnostics-channel.d.ts +18 -10
- package/node_modules/undici-types/dispatcher.d.ts +136 -139
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +4 -3
- package/node_modules/undici-types/errors.d.ts +92 -54
- package/node_modules/undici-types/eventsource.d.ts +9 -4
- package/node_modules/undici-types/fetch.d.ts +51 -25
- package/node_modules/undici-types/formdata.d.ts +7 -7
- package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/node_modules/undici-types/global-origin.d.ts +5 -5
- package/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/undici-types/handlers.d.ts +10 -9
- package/node_modules/undici-types/header.d.ts +162 -1
- package/node_modules/undici-types/index.d.ts +69 -47
- package/node_modules/undici-types/interceptors.d.ts +72 -9
- package/node_modules/undici-types/mock-agent.d.ts +36 -18
- package/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/undici-types/mock-client.d.ts +6 -4
- package/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/node_modules/undici-types/mock-interceptor.d.ts +26 -21
- package/node_modules/undici-types/mock-pool.d.ts +6 -4
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +0 -4
- package/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/node_modules/undici-types/pool.d.ts +14 -14
- package/node_modules/undici-types/proxy-agent.d.ts +14 -6
- package/node_modules/undici-types/readable.d.ts +19 -16
- package/node_modules/undici-types/retry-agent.d.ts +1 -1
- package/node_modules/undici-types/retry-handler.d.ts +19 -10
- package/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/undici-types/util.d.ts +3 -3
- package/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/undici-types/webidl.d.ts +148 -30
- package/node_modules/undici-types/websocket.d.ts +48 -10
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +14 -30
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +1 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +2 -11
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -4
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +1 -1
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +53 -137
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +70 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +87 -35
- package/node_modules/zod/src/v4/core/api.ts +21 -29
- package/node_modules/zod/src/v4/core/checks.ts +61 -1
- package/node_modules/zod/src/v4/core/compile.ts +35 -24
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +9 -63
- package/node_modules/zod/src/v4/core/memoizer.ts +2 -5
- package/node_modules/zod/src/v4/core/regexes.ts +4 -0
- package/node_modules/zod/src/v4/core/schemas.ts +36 -109
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +177 -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 +1 -1
- package/node_modules/zod/src/v4/core/util.ts +0 -4
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/src/v4/core/visit.ts +0 -11
- package/node_modules/zod/src/v4/locales/ar.ts +1 -0
- package/node_modules/zod/src/v4/locales/az.ts +1 -0
- package/node_modules/zod/src/v4/locales/be.ts +1 -0
- package/node_modules/zod/src/v4/locales/bg.ts +1 -0
- package/node_modules/zod/src/v4/locales/bn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ca.ts +1 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +1 -0
- package/node_modules/zod/src/v4/locales/cs.ts +1 -0
- package/node_modules/zod/src/v4/locales/da.ts +1 -0
- package/node_modules/zod/src/v4/locales/de.ts +1 -0
- package/node_modules/zod/src/v4/locales/el.ts +1 -0
- package/node_modules/zod/src/v4/locales/en.ts +1 -0
- package/node_modules/zod/src/v4/locales/eo.ts +1 -0
- package/node_modules/zod/src/v4/locales/es.ts +1 -0
- package/node_modules/zod/src/v4/locales/fa.ts +1 -0
- package/node_modules/zod/src/v4/locales/fi.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +1 -0
- package/node_modules/zod/src/v4/locales/fr.ts +1 -0
- package/node_modules/zod/src/v4/locales/gu.ts +1 -0
- package/node_modules/zod/src/v4/locales/he.ts +1 -0
- package/node_modules/zod/src/v4/locales/hi.ts +1 -0
- package/node_modules/zod/src/v4/locales/hr.ts +1 -0
- package/node_modules/zod/src/v4/locales/hu.ts +1 -0
- package/node_modules/zod/src/v4/locales/hy.ts +1 -0
- package/node_modules/zod/src/v4/locales/id.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +1 -0
- package/node_modules/zod/src/v4/locales/it.ts +1 -0
- package/node_modules/zod/src/v4/locales/ja.ts +1 -0
- package/node_modules/zod/src/v4/locales/ka.ts +1 -0
- package/node_modules/zod/src/v4/locales/km.ts +1 -0
- package/node_modules/zod/src/v4/locales/kn.ts +1 -0
- package/node_modules/zod/src/v4/locales/ko.ts +1 -0
- package/node_modules/zod/src/v4/locales/lt.ts +1 -0
- package/node_modules/zod/src/v4/locales/mk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ms.ts +1 -0
- package/node_modules/zod/src/v4/locales/ne.ts +1 -0
- package/node_modules/zod/src/v4/locales/nl.ts +1 -0
- package/node_modules/zod/src/v4/locales/nn.ts +1 -0
- package/node_modules/zod/src/v4/locales/no.ts +1 -0
- package/node_modules/zod/src/v4/locales/ota.ts +1 -0
- package/node_modules/zod/src/v4/locales/pl.ts +1 -0
- package/node_modules/zod/src/v4/locales/ps.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +1 -0
- package/node_modules/zod/src/v4/locales/pt.ts +1 -0
- package/node_modules/zod/src/v4/locales/ro.ts +1 -0
- package/node_modules/zod/src/v4/locales/ru.ts +1 -0
- package/node_modules/zod/src/v4/locales/sk.ts +1 -0
- package/node_modules/zod/src/v4/locales/sl.ts +1 -0
- package/node_modules/zod/src/v4/locales/sv.ts +1 -0
- package/node_modules/zod/src/v4/locales/ta.ts +1 -0
- package/node_modules/zod/src/v4/locales/tg.ts +1 -0
- package/node_modules/zod/src/v4/locales/th.ts +1 -0
- package/node_modules/zod/src/v4/locales/tk.ts +1 -0
- package/node_modules/zod/src/v4/locales/tr.ts +1 -0
- package/node_modules/zod/src/v4/locales/uk.ts +1 -0
- package/node_modules/zod/src/v4/locales/ur.ts +1 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/locales/vi.ts +1 -0
- package/node_modules/zod/src/v4/locales/yo.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +1 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +1 -0
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +12 -23
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +56 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +7 -0
- package/node_modules/zod/v4/classic/checks.cjs +2 -1
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- package/node_modules/zod/v4/classic/schemas.cjs +11 -15
- package/node_modules/zod/v4/classic/schemas.d.cts +4 -6
- package/node_modules/zod/v4/classic/schemas.d.ts +4 -6
- package/node_modules/zod/v4/classic/schemas.js +9 -13
- package/node_modules/zod/v4/core/api.cjs +11 -23
- package/node_modules/zod/v4/core/api.d.cts +8 -4
- package/node_modules/zod/v4/core/api.d.ts +8 -4
- package/node_modules/zod/v4/core/api.js +11 -23
- package/node_modules/zod/v4/core/checks.cjs +32 -1
- package/node_modules/zod/v4/core/checks.d.cts +16 -0
- package/node_modules/zod/v4/core/checks.d.ts +16 -0
- package/node_modules/zod/v4/core/checks.js +31 -0
- package/node_modules/zod/v4/core/compile.cjs +12 -17
- package/node_modules/zod/v4/core/compile.js +13 -18
- package/node_modules/zod/v4/core/core.cjs +1 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/json-schema-processors.cjs +8 -44
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -1
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -1
- package/node_modules/zod/v4/core/json-schema-processors.js +8 -43
- package/node_modules/zod/v4/core/memoizer.cjs +2 -5
- package/node_modules/zod/v4/core/memoizer.js +2 -5
- package/node_modules/zod/v4/core/regexes.cjs +4 -2
- package/node_modules/zod/v4/core/regexes.d.cts +1 -0
- package/node_modules/zod/v4/core/regexes.d.ts +1 -0
- package/node_modules/zod/v4/core/regexes.js +2 -0
- package/node_modules/zod/v4/core/schemas.cjs +33 -73
- package/node_modules/zod/v4/core/schemas.d.cts +7 -22
- package/node_modules/zod/v4/core/schemas.d.ts +7 -22
- package/node_modules/zod/v4/core/schemas.js +30 -72
- package/node_modules/zod/v4/core/to-json-schema.cjs +0 -1
- package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -3
- package/node_modules/zod/v4/core/to-json-schema.js +1 -1
- package/node_modules/zod/v4/core/util.cjs +0 -4
- package/node_modules/zod/v4/core/util.js +0 -4
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/node_modules/zod/v4/core/visit.cjs +0 -12
- package/node_modules/zod/v4/core/visit.js +0 -12
- package/node_modules/zod/v4/locales/ar.cjs +1 -0
- package/node_modules/zod/v4/locales/ar.js +1 -0
- package/node_modules/zod/v4/locales/az.cjs +1 -0
- package/node_modules/zod/v4/locales/az.js +1 -0
- package/node_modules/zod/v4/locales/be.cjs +1 -0
- package/node_modules/zod/v4/locales/be.js +1 -0
- package/node_modules/zod/v4/locales/bg.cjs +1 -0
- package/node_modules/zod/v4/locales/bg.js +1 -0
- package/node_modules/zod/v4/locales/bn.cjs +1 -0
- package/node_modules/zod/v4/locales/bn.js +1 -0
- package/node_modules/zod/v4/locales/ca.cjs +1 -0
- package/node_modules/zod/v4/locales/ca.js +1 -0
- package/node_modules/zod/v4/locales/ckb.cjs +1 -0
- package/node_modules/zod/v4/locales/ckb.js +1 -0
- package/node_modules/zod/v4/locales/cs.cjs +1 -0
- package/node_modules/zod/v4/locales/cs.js +1 -0
- package/node_modules/zod/v4/locales/da.cjs +1 -0
- package/node_modules/zod/v4/locales/da.js +1 -0
- package/node_modules/zod/v4/locales/de.cjs +1 -0
- package/node_modules/zod/v4/locales/de.js +1 -0
- package/node_modules/zod/v4/locales/el.cjs +1 -0
- package/node_modules/zod/v4/locales/el.js +1 -0
- package/node_modules/zod/v4/locales/en.cjs +1 -0
- package/node_modules/zod/v4/locales/en.js +1 -0
- package/node_modules/zod/v4/locales/eo.cjs +1 -0
- package/node_modules/zod/v4/locales/eo.js +1 -0
- package/node_modules/zod/v4/locales/es.cjs +1 -0
- package/node_modules/zod/v4/locales/es.js +1 -0
- package/node_modules/zod/v4/locales/fa.cjs +1 -0
- package/node_modules/zod/v4/locales/fa.js +1 -0
- package/node_modules/zod/v4/locales/fi.cjs +1 -0
- package/node_modules/zod/v4/locales/fi.js +1 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +1 -0
- package/node_modules/zod/v4/locales/fr-CA.js +1 -0
- package/node_modules/zod/v4/locales/fr.cjs +1 -0
- package/node_modules/zod/v4/locales/fr.js +1 -0
- package/node_modules/zod/v4/locales/gu.cjs +1 -0
- package/node_modules/zod/v4/locales/gu.js +1 -0
- package/node_modules/zod/v4/locales/he.cjs +1 -0
- package/node_modules/zod/v4/locales/he.js +1 -0
- package/node_modules/zod/v4/locales/hi.cjs +1 -0
- package/node_modules/zod/v4/locales/hi.js +1 -0
- package/node_modules/zod/v4/locales/hr.cjs +1 -0
- package/node_modules/zod/v4/locales/hr.js +1 -0
- package/node_modules/zod/v4/locales/hu.cjs +1 -0
- package/node_modules/zod/v4/locales/hu.js +1 -0
- package/node_modules/zod/v4/locales/hy.cjs +1 -0
- package/node_modules/zod/v4/locales/hy.js +1 -0
- package/node_modules/zod/v4/locales/id.cjs +1 -0
- package/node_modules/zod/v4/locales/id.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +1 -0
- package/node_modules/zod/v4/locales/is.js +1 -0
- package/node_modules/zod/v4/locales/it.cjs +1 -0
- package/node_modules/zod/v4/locales/it.js +1 -0
- package/node_modules/zod/v4/locales/ja.cjs +1 -0
- package/node_modules/zod/v4/locales/ja.js +1 -0
- package/node_modules/zod/v4/locales/ka.cjs +1 -0
- package/node_modules/zod/v4/locales/ka.js +1 -0
- package/node_modules/zod/v4/locales/km.cjs +1 -0
- package/node_modules/zod/v4/locales/km.js +1 -0
- package/node_modules/zod/v4/locales/kn.cjs +1 -0
- package/node_modules/zod/v4/locales/kn.js +1 -0
- package/node_modules/zod/v4/locales/ko.cjs +1 -0
- package/node_modules/zod/v4/locales/ko.js +1 -0
- package/node_modules/zod/v4/locales/lt.cjs +1 -0
- package/node_modules/zod/v4/locales/lt.js +1 -0
- package/node_modules/zod/v4/locales/mk.cjs +1 -0
- package/node_modules/zod/v4/locales/mk.js +1 -0
- package/node_modules/zod/v4/locales/ms.cjs +1 -0
- package/node_modules/zod/v4/locales/ms.js +1 -0
- package/node_modules/zod/v4/locales/ne.cjs +1 -0
- package/node_modules/zod/v4/locales/ne.js +1 -0
- package/node_modules/zod/v4/locales/nl.cjs +1 -0
- package/node_modules/zod/v4/locales/nl.js +1 -0
- package/node_modules/zod/v4/locales/nn.cjs +1 -0
- package/node_modules/zod/v4/locales/nn.js +1 -0
- package/node_modules/zod/v4/locales/no.cjs +1 -0
- package/node_modules/zod/v4/locales/no.js +1 -0
- package/node_modules/zod/v4/locales/ota.cjs +1 -0
- package/node_modules/zod/v4/locales/ota.js +1 -0
- package/node_modules/zod/v4/locales/pl.cjs +1 -0
- package/node_modules/zod/v4/locales/pl.js +1 -0
- package/node_modules/zod/v4/locales/ps.cjs +1 -0
- package/node_modules/zod/v4/locales/ps.js +1 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +1 -0
- package/node_modules/zod/v4/locales/pt-BR.js +1 -0
- package/node_modules/zod/v4/locales/pt.cjs +1 -0
- package/node_modules/zod/v4/locales/pt.js +1 -0
- package/node_modules/zod/v4/locales/ro.cjs +1 -0
- package/node_modules/zod/v4/locales/ro.js +1 -0
- package/node_modules/zod/v4/locales/ru.cjs +1 -0
- package/node_modules/zod/v4/locales/ru.js +1 -0
- package/node_modules/zod/v4/locales/sk.cjs +1 -0
- package/node_modules/zod/v4/locales/sk.js +1 -0
- package/node_modules/zod/v4/locales/sl.cjs +1 -0
- package/node_modules/zod/v4/locales/sl.js +1 -0
- package/node_modules/zod/v4/locales/sv.cjs +1 -0
- package/node_modules/zod/v4/locales/sv.js +1 -0
- package/node_modules/zod/v4/locales/ta.cjs +1 -0
- package/node_modules/zod/v4/locales/ta.js +1 -0
- package/node_modules/zod/v4/locales/tg.cjs +1 -0
- package/node_modules/zod/v4/locales/tg.js +1 -0
- package/node_modules/zod/v4/locales/th.cjs +1 -0
- package/node_modules/zod/v4/locales/th.js +1 -0
- package/node_modules/zod/v4/locales/tk.cjs +1 -0
- package/node_modules/zod/v4/locales/tk.js +1 -0
- package/node_modules/zod/v4/locales/tr.cjs +1 -0
- package/node_modules/zod/v4/locales/tr.js +1 -0
- package/node_modules/zod/v4/locales/uk.cjs +1 -0
- package/node_modules/zod/v4/locales/uk.js +1 -0
- package/node_modules/zod/v4/locales/ur.cjs +1 -0
- package/node_modules/zod/v4/locales/ur.js +1 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/locales/vi.cjs +1 -0
- package/node_modules/zod/v4/locales/vi.js +1 -0
- package/node_modules/zod/v4/locales/yo.cjs +1 -0
- package/node_modules/zod/v4/locales/yo.js +1 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-CN.js +1 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +1 -0
- package/node_modules/zod/v4/locales/zh-TW.js +1 -0
- package/node_modules/zod/v4/mini/checks.cjs +2 -1
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +11 -13
- package/node_modules/zod/v4/mini/schemas.d.cts +1 -4
- package/node_modules/zod/v4/mini/schemas.d.ts +1 -4
- package/node_modules/zod/v4/mini/schemas.js +9 -11
- package/package.json +2 -2
- package/slingshot/index.js +183 -182
- package/node_modules/@types/node/compatibility/disposable.d.ts +0 -14
- package/node_modules/@types/node/compatibility/index.d.ts +0 -9
- package/node_modules/@types/node/compatibility/indexable.d.ts +0 -20
- package/node_modules/@types/node/compatibility/iterators.d.ts +0 -20
- package/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/undici-types/filereader.d.ts +0 -54
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as core from "../core/index.js";
|
|
2
2
|
import { util } from "../core/index.js";
|
|
3
3
|
import * as processors from "../core/json-schema-processors.js";
|
|
4
|
+
import * as regexes from "../core/regexes.js";
|
|
4
5
|
import { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from "../core/to-json-schema.js";
|
|
5
6
|
import en from "../locales/en.js";
|
|
6
7
|
import * as checks from "./checks.js";
|
|
@@ -399,8 +400,8 @@ export function url(params) {
|
|
|
399
400
|
}
|
|
400
401
|
export function httpUrl(params) {
|
|
401
402
|
return core._url(ZodURL, {
|
|
402
|
-
protocol:
|
|
403
|
-
hostname:
|
|
403
|
+
protocol: regexes.httpProtocol,
|
|
404
|
+
hostname: regexes.domain,
|
|
404
405
|
...util.normalizeParams(params),
|
|
405
406
|
});
|
|
406
407
|
}
|
|
@@ -565,10 +566,13 @@ export function stringFormat(format, fnOrRegex, _params = {}) {
|
|
|
565
566
|
return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
566
567
|
}
|
|
567
568
|
export function hostname(_params) {
|
|
568
|
-
return core._stringFormat(ZodCustomStringFormat, "hostname",
|
|
569
|
+
return core._stringFormat(ZodCustomStringFormat, "hostname", regexes.hostname, _params);
|
|
569
570
|
}
|
|
570
571
|
export function hex(_params) {
|
|
571
|
-
return core._stringFormat(ZodCustomStringFormat, "hex",
|
|
572
|
+
return core._stringFormat(ZodCustomStringFormat, "hex", regexes.hex, _params);
|
|
573
|
+
}
|
|
574
|
+
export function currencyCode(_params) {
|
|
575
|
+
return core._stringFormat(ZodCustomStringFormat, "currency_code", regexes.currencyCode, _params);
|
|
572
576
|
}
|
|
573
577
|
export function hash(alg, params) {
|
|
574
578
|
const enc = params?.enc ?? "hex";
|
|
@@ -1455,14 +1459,6 @@ export const ZodCustom = /*@__PURE__*/ core.$constructor("ZodCustom", (inst, def
|
|
|
1455
1459
|
ZodType.init(inst, def);
|
|
1456
1460
|
inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);
|
|
1457
1461
|
});
|
|
1458
|
-
export const ZodProperties = /*@__PURE__*/ core.$constructor("ZodProperties", (inst, def) => {
|
|
1459
|
-
_ensureDefaultMemoizer();
|
|
1460
|
-
core.$ZodProperties.init(inst, def);
|
|
1461
|
-
ZodType.init(inst, def);
|
|
1462
|
-
});
|
|
1463
|
-
export function properties(shape, params) {
|
|
1464
|
-
return core._properties(ZodProperties, shape, params);
|
|
1465
|
-
}
|
|
1466
1462
|
// custom checks
|
|
1467
1463
|
export function check(fn) {
|
|
1468
1464
|
const ch = new core.$ZodCheck({
|
|
@@ -1490,7 +1486,7 @@ export const ZodInstanceOf = /*@__PURE__*/ core.$constructor("ZodInstanceOf", (i
|
|
|
1490
1486
|
}, {
|
|
1491
1487
|
properties(shape, params) {
|
|
1492
1488
|
// asserts in place, so the narrowed output type is truthful without a wrapper
|
|
1493
|
-
return this.check(
|
|
1489
|
+
return this.check(core._properties(shape, params));
|
|
1494
1490
|
},
|
|
1495
1491
|
});
|
|
1496
1492
|
function _instanceof(cls, params = {}) {
|
|
@@ -151,20 +151,18 @@ const checks = __importStar(require("./checks.cjs"));
|
|
|
151
151
|
const registries = __importStar(require("./registries.cjs"));
|
|
152
152
|
const schemas = __importStar(require("./schemas.cjs"));
|
|
153
153
|
const util = __importStar(require("./util.cjs"));
|
|
154
|
+
function snapshotChecks(def) {
|
|
155
|
+
if (def.checks)
|
|
156
|
+
def.checks = [...def.checks];
|
|
157
|
+
return def;
|
|
158
|
+
}
|
|
154
159
|
// @__NO_SIDE_EFFECTS__
|
|
155
160
|
function _string(Class, params) {
|
|
156
|
-
return new Class({
|
|
157
|
-
type: "string",
|
|
158
|
-
...util.normalizeParams(params),
|
|
159
|
-
});
|
|
161
|
+
return new Class(snapshotChecks({ type: "string", ...util.normalizeParams(params) }));
|
|
160
162
|
}
|
|
161
163
|
// @__NO_SIDE_EFFECTS__
|
|
162
164
|
function _coercedString(Class, params) {
|
|
163
|
-
return new Class({
|
|
164
|
-
type: "string",
|
|
165
|
-
coerce: true,
|
|
166
|
-
...util.normalizeParams(params),
|
|
167
|
-
});
|
|
165
|
+
return new Class(snapshotChecks({ type: "string", coerce: true, ...util.normalizeParams(params) }));
|
|
168
166
|
}
|
|
169
167
|
// @__NO_SIDE_EFFECTS__
|
|
170
168
|
function _email(Class, params) {
|
|
@@ -473,20 +471,11 @@ function _isoDuration(Class, params) {
|
|
|
473
471
|
}
|
|
474
472
|
// @__NO_SIDE_EFFECTS__
|
|
475
473
|
function _number(Class, params) {
|
|
476
|
-
return new Class({
|
|
477
|
-
type: "number",
|
|
478
|
-
checks: [],
|
|
479
|
-
...util.normalizeParams(params),
|
|
480
|
-
});
|
|
474
|
+
return new Class(snapshotChecks({ type: "number", checks: [], ...util.normalizeParams(params) }));
|
|
481
475
|
}
|
|
482
476
|
// @__NO_SIDE_EFFECTS__
|
|
483
477
|
function _coercedNumber(Class, params) {
|
|
484
|
-
return new Class({
|
|
485
|
-
type: "number",
|
|
486
|
-
coerce: true,
|
|
487
|
-
checks: [],
|
|
488
|
-
...util.normalizeParams(params),
|
|
489
|
-
});
|
|
478
|
+
return new Class(snapshotChecks({ type: "number", coerce: true, checks: [], ...util.normalizeParams(params) }));
|
|
490
479
|
}
|
|
491
480
|
// @__NO_SIDE_EFFECTS__
|
|
492
481
|
function _int(Class, params) {
|
|
@@ -831,9 +820,8 @@ function _property(property, schema, params) {
|
|
|
831
820
|
});
|
|
832
821
|
}
|
|
833
822
|
// @__NO_SIDE_EFFECTS__
|
|
834
|
-
function _properties(
|
|
835
|
-
return new
|
|
836
|
-
type: "properties",
|
|
823
|
+
function _properties(shape, params) {
|
|
824
|
+
return new checks.$ZodCheckProperties({
|
|
837
825
|
check: "properties",
|
|
838
826
|
shape,
|
|
839
827
|
...util.normalizeParams(params),
|
|
@@ -17,7 +17,9 @@ AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = P
|
|
|
17
17
|
export type StringFormatParams<T extends schemas.$ZodStringFormat = schemas.$ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
|
|
18
18
|
export type CheckStringFormatParams<T extends schemas.$ZodStringFormat = schemas.$ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
|
|
19
19
|
export type CheckTypeParams<T extends schemas.$ZodType & checks.$ZodCheck = schemas.$ZodType & checks.$ZodCheck, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
|
|
20
|
-
export type $ZodStringParams = TypeParams<schemas.$ZodString<string>, "coerce"
|
|
20
|
+
export type $ZodStringParams = TypeParams<schemas.$ZodString<string>, "coerce"> & {
|
|
21
|
+
checks?: readonly checks.$ZodCheck<string>[];
|
|
22
|
+
};
|
|
21
23
|
export declare function _string<T extends schemas.$ZodString>(Class: util.SchemaClass<T>, params?: string | $ZodStringParams): T;
|
|
22
24
|
export declare function _coercedString<T extends schemas.$ZodString>(Class: util.SchemaClass<T>, params?: string | $ZodStringParams): T;
|
|
23
25
|
export type $ZodStringFormatParams = CheckTypeParams<schemas.$ZodStringFormat, "format" | "coerce" | "when" | "pattern">;
|
|
@@ -131,7 +133,9 @@ export declare function _isoTime<T extends schemas.$ZodISOTime>(Class: util.Sche
|
|
|
131
133
|
export type $ZodISODurationParams = StringFormatParams<schemas.$ZodISODuration, "when">;
|
|
132
134
|
export type $ZodCheckISODurationParams = CheckStringFormatParams<schemas.$ZodISODuration, "when">;
|
|
133
135
|
export declare function _isoDuration<T extends schemas.$ZodISODuration>(Class: util.SchemaClass<T>, params?: string | $ZodISODurationParams | $ZodCheckISODurationParams): T;
|
|
134
|
-
export type $ZodNumberParams = TypeParams<schemas.$ZodNumber<number>, "coerce"
|
|
136
|
+
export type $ZodNumberParams = TypeParams<schemas.$ZodNumber<number>, "coerce"> & {
|
|
137
|
+
checks?: readonly checks.$ZodCheck<number>[];
|
|
138
|
+
};
|
|
135
139
|
export type $ZodNumberFormatParams = CheckTypeParams<schemas.$ZodNumberFormat, "format" | "coerce">;
|
|
136
140
|
export type $ZodCheckNumberFormatParams = CheckParams<checks.$ZodCheckNumberFormat, "format" | "when">;
|
|
137
141
|
export declare function _number<T extends schemas.$ZodNumber>(Class: util.SchemaClass<T>, params?: string | $ZodNumberParams): T;
|
|
@@ -216,8 +220,8 @@ export type $ZodCheckPropertyParams = CheckParams<checks.$ZodCheckProperty, "pro
|
|
|
216
220
|
export declare function _property<K extends string, T extends schemas.$ZodType>(property: K, schema: T, params?: string | $ZodCheckPropertyParams): checks.$ZodCheckProperty<{
|
|
217
221
|
[k in K]: util.Widen<core.input<T>>;
|
|
218
222
|
}>;
|
|
219
|
-
export type $
|
|
220
|
-
export declare function _properties<Shape extends schemas.$ZodShape>(
|
|
223
|
+
export type $ZodCheckPropertiesParams = CheckParams<checks.$ZodCheckProperties, "shape" | "when">;
|
|
224
|
+
export declare function _properties<Shape extends schemas.$ZodShape>(shape: Shape, params?: string | $ZodCheckPropertiesParams): checks.$ZodCheckProperties<Shape>;
|
|
221
225
|
export type $ZodCheckMimeTypeParams = CheckParams<checks.$ZodCheckMimeType, "mime" | "when">;
|
|
222
226
|
export declare function _mime(types: util.MimeTypes[], params?: string | $ZodCheckMimeTypeParams): checks.$ZodCheckMimeType;
|
|
223
227
|
export declare function _overwrite<T>(tx: (input: T) => T): checks.$ZodCheckOverwrite<T>;
|
|
@@ -17,7 +17,9 @@ AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = P
|
|
|
17
17
|
export type StringFormatParams<T extends schemas.$ZodStringFormat = schemas.$ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
|
|
18
18
|
export type CheckStringFormatParams<T extends schemas.$ZodStringFormat = schemas.$ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
|
|
19
19
|
export type CheckTypeParams<T extends schemas.$ZodType & checks.$ZodCheck = schemas.$ZodType & checks.$ZodCheck, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
|
|
20
|
-
export type $ZodStringParams = TypeParams<schemas.$ZodString<string>, "coerce"
|
|
20
|
+
export type $ZodStringParams = TypeParams<schemas.$ZodString<string>, "coerce"> & {
|
|
21
|
+
checks?: readonly checks.$ZodCheck<string>[];
|
|
22
|
+
};
|
|
21
23
|
export declare function _string<T extends schemas.$ZodString>(Class: util.SchemaClass<T>, params?: string | $ZodStringParams): T;
|
|
22
24
|
export declare function _coercedString<T extends schemas.$ZodString>(Class: util.SchemaClass<T>, params?: string | $ZodStringParams): T;
|
|
23
25
|
export type $ZodStringFormatParams = CheckTypeParams<schemas.$ZodStringFormat, "format" | "coerce" | "when" | "pattern">;
|
|
@@ -131,7 +133,9 @@ export declare function _isoTime<T extends schemas.$ZodISOTime>(Class: util.Sche
|
|
|
131
133
|
export type $ZodISODurationParams = StringFormatParams<schemas.$ZodISODuration, "when">;
|
|
132
134
|
export type $ZodCheckISODurationParams = CheckStringFormatParams<schemas.$ZodISODuration, "when">;
|
|
133
135
|
export declare function _isoDuration<T extends schemas.$ZodISODuration>(Class: util.SchemaClass<T>, params?: string | $ZodISODurationParams | $ZodCheckISODurationParams): T;
|
|
134
|
-
export type $ZodNumberParams = TypeParams<schemas.$ZodNumber<number>, "coerce"
|
|
136
|
+
export type $ZodNumberParams = TypeParams<schemas.$ZodNumber<number>, "coerce"> & {
|
|
137
|
+
checks?: readonly checks.$ZodCheck<number>[];
|
|
138
|
+
};
|
|
135
139
|
export type $ZodNumberFormatParams = CheckTypeParams<schemas.$ZodNumberFormat, "format" | "coerce">;
|
|
136
140
|
export type $ZodCheckNumberFormatParams = CheckParams<checks.$ZodCheckNumberFormat, "format" | "when">;
|
|
137
141
|
export declare function _number<T extends schemas.$ZodNumber>(Class: util.SchemaClass<T>, params?: string | $ZodNumberParams): T;
|
|
@@ -216,8 +220,8 @@ export type $ZodCheckPropertyParams = CheckParams<checks.$ZodCheckProperty, "pro
|
|
|
216
220
|
export declare function _property<K extends string, T extends schemas.$ZodType>(property: K, schema: T, params?: string | $ZodCheckPropertyParams): checks.$ZodCheckProperty<{
|
|
217
221
|
[k in K]: util.Widen<core.input<T>>;
|
|
218
222
|
}>;
|
|
219
|
-
export type $
|
|
220
|
-
export declare function _properties<Shape extends schemas.$ZodShape>(
|
|
223
|
+
export type $ZodCheckPropertiesParams = CheckParams<checks.$ZodCheckProperties, "shape" | "when">;
|
|
224
|
+
export declare function _properties<Shape extends schemas.$ZodShape>(shape: Shape, params?: string | $ZodCheckPropertiesParams): checks.$ZodCheckProperties<Shape>;
|
|
221
225
|
export type $ZodCheckMimeTypeParams = CheckParams<checks.$ZodCheckMimeType, "mime" | "when">;
|
|
222
226
|
export declare function _mime(types: util.MimeTypes[], params?: string | $ZodCheckMimeTypeParams): checks.$ZodCheckMimeType;
|
|
223
227
|
export declare function _overwrite<T>(tx: (input: T) => T): checks.$ZodCheckOverwrite<T>;
|
|
@@ -2,20 +2,18 @@ import * as checks from "./checks.js";
|
|
|
2
2
|
import * as registries from "./registries.js";
|
|
3
3
|
import * as schemas from "./schemas.js";
|
|
4
4
|
import * as util from "./util.js";
|
|
5
|
+
function snapshotChecks(def) {
|
|
6
|
+
if (def.checks)
|
|
7
|
+
def.checks = [...def.checks];
|
|
8
|
+
return def;
|
|
9
|
+
}
|
|
5
10
|
// @__NO_SIDE_EFFECTS__
|
|
6
11
|
export function _string(Class, params) {
|
|
7
|
-
return new Class({
|
|
8
|
-
type: "string",
|
|
9
|
-
...util.normalizeParams(params),
|
|
10
|
-
});
|
|
12
|
+
return new Class(snapshotChecks({ type: "string", ...util.normalizeParams(params) }));
|
|
11
13
|
}
|
|
12
14
|
// @__NO_SIDE_EFFECTS__
|
|
13
15
|
export function _coercedString(Class, params) {
|
|
14
|
-
return new Class({
|
|
15
|
-
type: "string",
|
|
16
|
-
coerce: true,
|
|
17
|
-
...util.normalizeParams(params),
|
|
18
|
-
});
|
|
16
|
+
return new Class(snapshotChecks({ type: "string", coerce: true, ...util.normalizeParams(params) }));
|
|
19
17
|
}
|
|
20
18
|
// @__NO_SIDE_EFFECTS__
|
|
21
19
|
export function _email(Class, params) {
|
|
@@ -324,20 +322,11 @@ export function _isoDuration(Class, params) {
|
|
|
324
322
|
}
|
|
325
323
|
// @__NO_SIDE_EFFECTS__
|
|
326
324
|
export function _number(Class, params) {
|
|
327
|
-
return new Class({
|
|
328
|
-
type: "number",
|
|
329
|
-
checks: [],
|
|
330
|
-
...util.normalizeParams(params),
|
|
331
|
-
});
|
|
325
|
+
return new Class(snapshotChecks({ type: "number", checks: [], ...util.normalizeParams(params) }));
|
|
332
326
|
}
|
|
333
327
|
// @__NO_SIDE_EFFECTS__
|
|
334
328
|
export function _coercedNumber(Class, params) {
|
|
335
|
-
return new Class({
|
|
336
|
-
type: "number",
|
|
337
|
-
coerce: true,
|
|
338
|
-
checks: [],
|
|
339
|
-
...util.normalizeParams(params),
|
|
340
|
-
});
|
|
329
|
+
return new Class(snapshotChecks({ type: "number", coerce: true, checks: [], ...util.normalizeParams(params) }));
|
|
341
330
|
}
|
|
342
331
|
// @__NO_SIDE_EFFECTS__
|
|
343
332
|
export function _int(Class, params) {
|
|
@@ -688,9 +677,8 @@ export function _property(property, schema, params) {
|
|
|
688
677
|
});
|
|
689
678
|
}
|
|
690
679
|
// @__NO_SIDE_EFFECTS__
|
|
691
|
-
export function _properties(
|
|
692
|
-
return new
|
|
693
|
-
type: "properties",
|
|
680
|
+
export function _properties(shape, params) {
|
|
681
|
+
return new checks.$ZodCheckProperties({
|
|
694
682
|
check: "properties",
|
|
695
683
|
shape,
|
|
696
684
|
...util.normalizeParams(params),
|
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
return result;
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.$ZodCheckOverwrite = exports.$ZodCheckMimeType = exports.$ZodCheckProperty = exports.$ZodCheckEndsWith = exports.$ZodCheckStartsWith = exports.$ZodCheckIncludes = exports.$ZodCheckUpperCase = exports.$ZodCheckLowerCase = exports.$ZodCheckRegex = exports.$ZodCheckStringFormat = exports.$ZodCheckLengthEquals = exports.$ZodCheckMinLength = exports.$ZodCheckMaxLength = exports.$ZodCheckSizeEquals = exports.$ZodCheckMinSize = exports.$ZodCheckMaxSize = exports.$ZodCheckBigIntFormat = exports.$ZodCheckNumberFormat = exports.$ZodCheckMultipleOf = exports.$ZodCheckGreaterThan = exports.$ZodCheckLessThan = exports.$ZodCheck = void 0;
|
|
27
|
+
exports.$ZodCheckOverwrite = exports.$ZodCheckMimeType = exports.$ZodCheckProperties = exports.$ZodCheckProperty = exports.$ZodCheckEndsWith = exports.$ZodCheckStartsWith = exports.$ZodCheckIncludes = exports.$ZodCheckUpperCase = exports.$ZodCheckLowerCase = exports.$ZodCheckRegex = exports.$ZodCheckStringFormat = exports.$ZodCheckLengthEquals = exports.$ZodCheckMinLength = exports.$ZodCheckMaxLength = exports.$ZodCheckSizeEquals = exports.$ZodCheckMinSize = exports.$ZodCheckMaxSize = exports.$ZodCheckBigIntFormat = exports.$ZodCheckNumberFormat = exports.$ZodCheckMultipleOf = exports.$ZodCheckGreaterThan = exports.$ZodCheckLessThan = exports.$ZodCheck = void 0;
|
|
28
28
|
const core = __importStar(require("./core.cjs"));
|
|
29
29
|
const regexes = __importStar(require("./regexes.cjs"));
|
|
30
30
|
const util = __importStar(require("./util.cjs"));
|
|
@@ -488,6 +488,37 @@ exports.$ZodCheckProperty = core.$constructor("$ZodCheckProperty", (inst, def) =
|
|
|
488
488
|
return;
|
|
489
489
|
};
|
|
490
490
|
});
|
|
491
|
+
exports.$ZodCheckProperties = core.$constructor("$ZodCheckProperties", (inst, def) => {
|
|
492
|
+
exports.$ZodCheck.init(inst, def);
|
|
493
|
+
util.hide(inst, Symbol.iterator, function* () {
|
|
494
|
+
yield inst;
|
|
495
|
+
});
|
|
496
|
+
// key and schema snapshotted together: reading one live and the other cached lets a later mutation of the caller's shape object pair a stale key with a missing schema
|
|
497
|
+
let entries;
|
|
498
|
+
inst._zod.check = (payload) => {
|
|
499
|
+
// the base schema already typed the value, so only a nullish one is rejected here: the properties read on a primitive too, matching z.property() on a string's length
|
|
500
|
+
if (payload.value == null) {
|
|
501
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
502
|
+
return undefined;
|
|
503
|
+
}
|
|
504
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
505
|
+
const input = payload.value;
|
|
506
|
+
let proms;
|
|
507
|
+
for (const [key, schema] of entries) {
|
|
508
|
+
const result = schema._zod.run({ value: input[key], issues: [] }, {});
|
|
509
|
+
if (result instanceof Promise) {
|
|
510
|
+
proms ?? (proms = []);
|
|
511
|
+
proms.push(result.then((result) => handleCheckPropertyResult(result, payload, key)));
|
|
512
|
+
}
|
|
513
|
+
else {
|
|
514
|
+
handleCheckPropertyResult(result, payload, key);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
if (proms)
|
|
518
|
+
return Promise.all(proms).then(() => undefined);
|
|
519
|
+
return undefined;
|
|
520
|
+
};
|
|
521
|
+
});
|
|
491
522
|
exports.$ZodCheckMimeType = core.$constructor("$ZodCheckMimeType", (inst, def) => {
|
|
492
523
|
exports.$ZodCheck.init(inst, def);
|
|
493
524
|
const mimeSet = new Set(def.mime);
|
|
@@ -250,6 +250,22 @@ export interface $ZodCheckProperty<T extends object = object> extends $ZodCheck<
|
|
|
250
250
|
_zod: $ZodCheckPropertyInternals<T>;
|
|
251
251
|
}
|
|
252
252
|
export declare const $ZodCheckProperty: core.$constructor<$ZodCheckProperty>;
|
|
253
|
+
export interface $ZodCheckPropertiesDef<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckDef {
|
|
254
|
+
check: "properties";
|
|
255
|
+
shape: Shape;
|
|
256
|
+
}
|
|
257
|
+
export type $ZodCheckPropertiesInput<Shape extends schemas.$ZodShape = schemas.$ZodShape> = {
|
|
258
|
+
-readonly [k in keyof Shape]: util.Widen<core.input<Shape[k]>>;
|
|
259
|
+
};
|
|
260
|
+
export interface $ZodCheckPropertiesInternals<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckInternals<$ZodCheckPropertiesInput<Shape>> {
|
|
261
|
+
def: $ZodCheckPropertiesDef<Shape>;
|
|
262
|
+
issc: errors.$ZodIssue;
|
|
263
|
+
}
|
|
264
|
+
export interface $ZodCheckProperties<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheck<$ZodCheckPropertiesInput<Shape>> {
|
|
265
|
+
_zod: $ZodCheckPropertiesInternals<Shape>;
|
|
266
|
+
[Symbol.iterator](): Iterator<this>;
|
|
267
|
+
}
|
|
268
|
+
export declare const $ZodCheckProperties: core.$constructor<$ZodCheckProperties>;
|
|
253
269
|
export interface $ZodCheckMimeTypeDef extends $ZodCheckDef {
|
|
254
270
|
check: "mime_type";
|
|
255
271
|
mime: util.MimeTypes[];
|
|
@@ -250,6 +250,22 @@ export interface $ZodCheckProperty<T extends object = object> extends $ZodCheck<
|
|
|
250
250
|
_zod: $ZodCheckPropertyInternals<T>;
|
|
251
251
|
}
|
|
252
252
|
export declare const $ZodCheckProperty: core.$constructor<$ZodCheckProperty>;
|
|
253
|
+
export interface $ZodCheckPropertiesDef<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckDef {
|
|
254
|
+
check: "properties";
|
|
255
|
+
shape: Shape;
|
|
256
|
+
}
|
|
257
|
+
export type $ZodCheckPropertiesInput<Shape extends schemas.$ZodShape = schemas.$ZodShape> = {
|
|
258
|
+
-readonly [k in keyof Shape]: util.Widen<core.input<Shape[k]>>;
|
|
259
|
+
};
|
|
260
|
+
export interface $ZodCheckPropertiesInternals<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheckInternals<$ZodCheckPropertiesInput<Shape>> {
|
|
261
|
+
def: $ZodCheckPropertiesDef<Shape>;
|
|
262
|
+
issc: errors.$ZodIssue;
|
|
263
|
+
}
|
|
264
|
+
export interface $ZodCheckProperties<Shape extends schemas.$ZodShape = schemas.$ZodShape> extends $ZodCheck<$ZodCheckPropertiesInput<Shape>> {
|
|
265
|
+
_zod: $ZodCheckPropertiesInternals<Shape>;
|
|
266
|
+
[Symbol.iterator](): Iterator<this>;
|
|
267
|
+
}
|
|
268
|
+
export declare const $ZodCheckProperties: core.$constructor<$ZodCheckProperties>;
|
|
253
269
|
export interface $ZodCheckMimeTypeDef extends $ZodCheckDef {
|
|
254
270
|
check: "mime_type";
|
|
255
271
|
mime: util.MimeTypes[];
|
|
@@ -462,6 +462,37 @@ export const $ZodCheckProperty = /*@__PURE__*/ core.$constructor("$ZodCheckPrope
|
|
|
462
462
|
return;
|
|
463
463
|
};
|
|
464
464
|
});
|
|
465
|
+
export const $ZodCheckProperties = /*@__PURE__*/ core.$constructor("$ZodCheckProperties", (inst, def) => {
|
|
466
|
+
$ZodCheck.init(inst, def);
|
|
467
|
+
util.hide(inst, Symbol.iterator, function* () {
|
|
468
|
+
yield inst;
|
|
469
|
+
});
|
|
470
|
+
// key and schema snapshotted together: reading one live and the other cached lets a later mutation of the caller's shape object pair a stale key with a missing schema
|
|
471
|
+
let entries;
|
|
472
|
+
inst._zod.check = (payload) => {
|
|
473
|
+
// the base schema already typed the value, so only a nullish one is rejected here: the properties read on a primitive too, matching z.property() on a string's length
|
|
474
|
+
if (payload.value == null) {
|
|
475
|
+
payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
|
|
476
|
+
return undefined;
|
|
477
|
+
}
|
|
478
|
+
entries ?? (entries = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
|
|
479
|
+
const input = payload.value;
|
|
480
|
+
let proms;
|
|
481
|
+
for (const [key, schema] of entries) {
|
|
482
|
+
const result = schema._zod.run({ value: input[key], issues: [] }, {});
|
|
483
|
+
if (result instanceof Promise) {
|
|
484
|
+
proms ?? (proms = []);
|
|
485
|
+
proms.push(result.then((result) => handleCheckPropertyResult(result, payload, key)));
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
handleCheckPropertyResult(result, payload, key);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
if (proms)
|
|
492
|
+
return Promise.all(proms).then(() => undefined);
|
|
493
|
+
return undefined;
|
|
494
|
+
};
|
|
495
|
+
});
|
|
465
496
|
export const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor("$ZodCheckMimeType", (inst, def) => {
|
|
466
497
|
$ZodCheck.init(inst, def);
|
|
467
498
|
const mimeSet = new Set(def.mime);
|
|
@@ -361,7 +361,7 @@ function generateChecks(doc, ctx, schema, accessor) {
|
|
|
361
361
|
generatePropertyCheck(doc, ctx, def, currentAccessor);
|
|
362
362
|
break;
|
|
363
363
|
case "properties":
|
|
364
|
-
generatePropertiesChecks(doc, ctx, def, currentAccessor
|
|
364
|
+
generatePropertiesChecks(doc, ctx, def, currentAccessor);
|
|
365
365
|
break;
|
|
366
366
|
case "overwrite": {
|
|
367
367
|
// Overwrite transforms the value - create new variable for transformed result
|
|
@@ -489,15 +489,13 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
|
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
// asserts each named property in place; children compile assert-only because z.properties never rebuilds its input
|
|
492
|
-
function generatePropertiesChecks(doc, ctx, def, accessor
|
|
493
|
-
// a custom `when` gates the assertion at runtime; inside a union a wrongly-run branch is absorbed as a branch failure rather than falling back, so refuse at codegen
|
|
492
|
+
function generatePropertiesChecks(doc, ctx, def, accessor) {
|
|
493
|
+
// a custom `when` gates the assertion at runtime; inside a union a wrongly-run branch is absorbed as a branch failure rather than falling back, so refuse at codegen
|
|
494
494
|
if (def.when) {
|
|
495
495
|
throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
|
|
496
496
|
}
|
|
497
|
-
// matches the runtime gate
|
|
498
|
-
doc.write(
|
|
499
|
-
? `if (${accessor} === null || (typeof ${accessor} !== "object" && typeof ${accessor} !== "function")) return INVALID;`
|
|
500
|
-
: `if (${accessor} == null) return INVALID;`);
|
|
497
|
+
// matches the runtime gate: the base schema already typed the value, so only a nullish one is rejected
|
|
498
|
+
doc.write(`if (${accessor} == null) return INVALID;`);
|
|
501
499
|
const shape = def.shape;
|
|
502
500
|
for (const key of Reflect.ownKeys(shape)) {
|
|
503
501
|
// a symbol has no source literal, so it is hoisted as a constant
|
|
@@ -610,8 +608,7 @@ const PATTERN_IS_COMPLETE = new Set([
|
|
|
610
608
|
"uuid",
|
|
611
609
|
"xid",
|
|
612
610
|
]);
|
|
613
|
-
|
|
614
|
-
function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
611
|
+
function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
|
|
615
612
|
// Some string formats do runtime validation beyond their advertised pattern. For cheap pure utility checks, hoist the runtime function and call it so the fast path stays correct without cloning the utility logic into codegen.
|
|
616
613
|
const fmt = def.format;
|
|
617
614
|
if (fmt === "base64") {
|
|
@@ -657,7 +654,7 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
657
654
|
formatDef.hostname !== undefined ||
|
|
658
655
|
formatDef.protocol !== undefined) {
|
|
659
656
|
// Same three predicates the runtime calls, in the same order, so there is no second URL implementation to drift. Which options exist is known now, so the calls the runtime makes conditionally are emitted conditionally instead.
|
|
660
|
-
const parseConst = addConstant(ctx, schemas_js_1.
|
|
657
|
+
const parseConst = addConstant(ctx, schemas_js_1.validateURL);
|
|
661
658
|
const defConst = addConstant(ctx, def);
|
|
662
659
|
const trimVar = newVar(ctx);
|
|
663
660
|
const urlVar = newVar(ctx);
|
|
@@ -672,6 +669,8 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
672
669
|
const protocolConst = addConstant(ctx, schemas_js_1.urlProtocolOk);
|
|
673
670
|
doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
|
|
674
671
|
}
|
|
672
|
+
if (!needsValue)
|
|
673
|
+
return null;
|
|
675
674
|
const outputVar = newVar(ctx);
|
|
676
675
|
const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, schemas_js_1.stripTabAndNewline)}(${trimVar})`;
|
|
677
676
|
doc.write(`const ${outputVar} = ${outputExpr};`);
|
|
@@ -736,7 +735,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
736
735
|
let typeAccessor;
|
|
737
736
|
switch (type) {
|
|
738
737
|
case "string":
|
|
739
|
-
typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
|
|
738
|
+
typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
|
|
740
739
|
break;
|
|
741
740
|
case "number":
|
|
742
741
|
typeAccessor = generateNumberCheck(doc, schema, accessor);
|
|
@@ -848,10 +847,6 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
848
847
|
case "custom":
|
|
849
848
|
typeAccessor = generateCustomCheck(doc, ctx, schema, accessor);
|
|
850
849
|
break;
|
|
851
|
-
case "properties":
|
|
852
|
-
generatePropertiesChecks(doc, ctx, schema._zod.def, accessor, true);
|
|
853
|
-
typeAccessor = accessor;
|
|
854
|
-
break;
|
|
855
850
|
case "transform":
|
|
856
851
|
typeAccessor = generateTransformCheck(doc, ctx, schema, accessor);
|
|
857
852
|
break;
|
|
@@ -869,13 +864,13 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
869
864
|
// Generate checks after the type-specific validation (may transform value)
|
|
870
865
|
return generateChecks(doc, ctx, schema, typeAccessor);
|
|
871
866
|
}
|
|
872
|
-
function generateStringCheck(doc, ctx, schema, accessor) {
|
|
867
|
+
function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
873
868
|
doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
|
|
874
869
|
// z.email() carries its format on the def, z.string().email() in def.checks; both route here so the format table has no second copy to drift from.
|
|
875
870
|
const def = schema._zod.def;
|
|
876
871
|
if (def.format === undefined)
|
|
877
872
|
return accessor;
|
|
878
|
-
return generateStringFormatCheck(doc, ctx, def, accessor);
|
|
873
|
+
return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
|
|
879
874
|
}
|
|
880
875
|
function generateNumberCheck(doc, schema, accessor) {
|
|
881
876
|
// Runtime z.number() rejects NaN and ±Infinity. Number.isFinite covers both.
|
|
@@ -2,7 +2,7 @@ import { $ZodAsyncError } from "./core.js";
|
|
|
2
2
|
import { Doc } from "./doc.js";
|
|
3
3
|
import { isBackEdge, isRecursiveSchema } from "./memoizer.js";
|
|
4
4
|
import * as regexes from "./regexes.js";
|
|
5
|
-
import { isValidBase64, isValidBase64URL, isValidCIDRv6, isValidCreditCard, isValidIBAN, isValidIPv6, isValidJWT, mergeValues,
|
|
5
|
+
import { isValidBase64, isValidBase64URL, isValidCIDRv6, isValidCreditCard, isValidIBAN, isValidIPv6, isValidJWT, mergeValues, stripTabAndNewline, urlHostnameOk, urlProtocolOk, validateURL, } from "./schemas.js";
|
|
6
6
|
import * as util from "./util.js";
|
|
7
7
|
/** @internal Sentinel the compiled fast path returns when validation fails. */
|
|
8
8
|
export const INVALID = Symbol.for("zod.compile.invalid");
|
|
@@ -330,7 +330,7 @@ function generateChecks(doc, ctx, schema, accessor) {
|
|
|
330
330
|
generatePropertyCheck(doc, ctx, def, currentAccessor);
|
|
331
331
|
break;
|
|
332
332
|
case "properties":
|
|
333
|
-
generatePropertiesChecks(doc, ctx, def, currentAccessor
|
|
333
|
+
generatePropertiesChecks(doc, ctx, def, currentAccessor);
|
|
334
334
|
break;
|
|
335
335
|
case "overwrite": {
|
|
336
336
|
// Overwrite transforms the value - create new variable for transformed result
|
|
@@ -458,15 +458,13 @@ function generateMimeTypeCheck(doc, ctx, def, accessor) {
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
// asserts each named property in place; children compile assert-only because z.properties never rebuilds its input
|
|
461
|
-
function generatePropertiesChecks(doc, ctx, def, accessor
|
|
462
|
-
// a custom `when` gates the assertion at runtime; inside a union a wrongly-run branch is absorbed as a branch failure rather than falling back, so refuse at codegen
|
|
461
|
+
function generatePropertiesChecks(doc, ctx, def, accessor) {
|
|
462
|
+
// a custom `when` gates the assertion at runtime; inside a union a wrongly-run branch is absorbed as a branch failure rather than falling back, so refuse at codegen
|
|
463
463
|
if (def.when) {
|
|
464
464
|
throw new ZodCompileUnsupportedError(`check with a custom "when" condition`);
|
|
465
465
|
}
|
|
466
|
-
// matches the runtime gate
|
|
467
|
-
doc.write(
|
|
468
|
-
? `if (${accessor} === null || (typeof ${accessor} !== "object" && typeof ${accessor} !== "function")) return INVALID;`
|
|
469
|
-
: `if (${accessor} == null) return INVALID;`);
|
|
466
|
+
// matches the runtime gate: the base schema already typed the value, so only a nullish one is rejected
|
|
467
|
+
doc.write(`if (${accessor} == null) return INVALID;`);
|
|
470
468
|
const shape = def.shape;
|
|
471
469
|
for (const key of Reflect.ownKeys(shape)) {
|
|
472
470
|
// a symbol has no source literal, so it is hoisted as a constant
|
|
@@ -579,8 +577,7 @@ const PATTERN_IS_COMPLETE = new Set([
|
|
|
579
577
|
"uuid",
|
|
580
578
|
"xid",
|
|
581
579
|
]);
|
|
582
|
-
|
|
583
|
-
function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
580
|
+
function generateStringFormatCheck(doc, ctx, def, accessor, needsValue = true) {
|
|
584
581
|
// Some string formats do runtime validation beyond their advertised pattern. For cheap pure utility checks, hoist the runtime function and call it so the fast path stays correct without cloning the utility logic into codegen.
|
|
585
582
|
const fmt = def.format;
|
|
586
583
|
if (fmt === "base64") {
|
|
@@ -626,7 +623,7 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
626
623
|
formatDef.hostname !== undefined ||
|
|
627
624
|
formatDef.protocol !== undefined) {
|
|
628
625
|
// Same three predicates the runtime calls, in the same order, so there is no second URL implementation to drift. Which options exist is known now, so the calls the runtime makes conditionally are emitted conditionally instead.
|
|
629
|
-
const parseConst = addConstant(ctx,
|
|
626
|
+
const parseConst = addConstant(ctx, validateURL);
|
|
630
627
|
const defConst = addConstant(ctx, def);
|
|
631
628
|
const trimVar = newVar(ctx);
|
|
632
629
|
const urlVar = newVar(ctx);
|
|
@@ -641,6 +638,8 @@ function generateStringFormatCheck(doc, ctx, def, accessor) {
|
|
|
641
638
|
const protocolConst = addConstant(ctx, urlProtocolOk);
|
|
642
639
|
doc.write(`if (!${protocolConst}(${urlVar}, ${defConst}.protocol)) return INVALID;`);
|
|
643
640
|
}
|
|
641
|
+
if (!needsValue)
|
|
642
|
+
return null;
|
|
644
643
|
const outputVar = newVar(ctx);
|
|
645
644
|
const outputExpr = formatDef.normalize ? `${urlVar}.href` : `${addConstant(ctx, stripTabAndNewline)}(${trimVar})`;
|
|
646
645
|
doc.write(`const ${outputVar} = ${outputExpr};`);
|
|
@@ -705,7 +704,7 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
705
704
|
let typeAccessor;
|
|
706
705
|
switch (type) {
|
|
707
706
|
case "string":
|
|
708
|
-
typeAccessor = generateStringCheck(doc, ctx, schema, accessor);
|
|
707
|
+
typeAccessor = generateStringCheck(doc, ctx, schema, accessor, buildsValue);
|
|
709
708
|
break;
|
|
710
709
|
case "number":
|
|
711
710
|
typeAccessor = generateNumberCheck(doc, schema, accessor);
|
|
@@ -817,10 +816,6 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
817
816
|
case "custom":
|
|
818
817
|
typeAccessor = generateCustomCheck(doc, ctx, schema, accessor);
|
|
819
818
|
break;
|
|
820
|
-
case "properties":
|
|
821
|
-
generatePropertiesChecks(doc, ctx, schema._zod.def, accessor, true);
|
|
822
|
-
typeAccessor = accessor;
|
|
823
|
-
break;
|
|
824
819
|
case "transform":
|
|
825
820
|
typeAccessor = generateTransformCheck(doc, ctx, schema, accessor);
|
|
826
821
|
break;
|
|
@@ -838,13 +833,13 @@ function generateCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
|
838
833
|
// Generate checks after the type-specific validation (may transform value)
|
|
839
834
|
return generateChecks(doc, ctx, schema, typeAccessor);
|
|
840
835
|
}
|
|
841
|
-
function generateStringCheck(doc, ctx, schema, accessor) {
|
|
836
|
+
function generateStringCheck(doc, ctx, schema, accessor, needsValue = true) {
|
|
842
837
|
doc.write(`if (typeof ${accessor} !== "string") return INVALID;`);
|
|
843
838
|
// z.email() carries its format on the def, z.string().email() in def.checks; both route here so the format table has no second copy to drift from.
|
|
844
839
|
const def = schema._zod.def;
|
|
845
840
|
if (def.format === undefined)
|
|
846
841
|
return accessor;
|
|
847
|
-
return generateStringFormatCheck(doc, ctx, def, accessor);
|
|
842
|
+
return generateStringFormatCheck(doc, ctx, def, accessor, needsValue);
|
|
848
843
|
}
|
|
849
844
|
function generateNumberCheck(doc, schema, accessor) {
|
|
850
845
|
// Runtime z.number() rejects NaN and ±Infinity. Number.isFinite covers both.
|