@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,15 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
declare module "node:util" {
|
|
2
|
+
export * as types from "node:util/types";
|
|
3
|
+
export type InspectStyle =
|
|
4
|
+
| "special"
|
|
5
|
+
| "number"
|
|
6
|
+
| "bigint"
|
|
7
|
+
| "boolean"
|
|
8
|
+
| "undefined"
|
|
9
|
+
| "null"
|
|
10
|
+
| "string"
|
|
11
|
+
| "symbol"
|
|
12
|
+
| "date"
|
|
13
|
+
| "name"
|
|
14
|
+
| "regexp"
|
|
15
|
+
| "module";
|
|
16
|
+
export interface InspectStyles extends Record<InspectStyle, InspectColor | ((value: string) => string)> {
|
|
17
|
+
regexp: {
|
|
18
|
+
(value: string): string;
|
|
19
|
+
colors: InspectColor[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export type InspectColorModifier =
|
|
23
|
+
| "reset"
|
|
24
|
+
| "bold"
|
|
25
|
+
| "dim"
|
|
26
|
+
| "italic"
|
|
27
|
+
| "underline"
|
|
28
|
+
| "blink"
|
|
29
|
+
| "inverse"
|
|
30
|
+
| "hidden"
|
|
31
|
+
| "strikethrough"
|
|
32
|
+
| "doubleunderline";
|
|
33
|
+
export type InspectColorForeground =
|
|
34
|
+
| "black"
|
|
35
|
+
| "red"
|
|
36
|
+
| "green"
|
|
37
|
+
| "yellow"
|
|
38
|
+
| "blue"
|
|
39
|
+
| "magenta"
|
|
40
|
+
| "cyan"
|
|
41
|
+
| "white"
|
|
42
|
+
| "gray"
|
|
43
|
+
| "redBright"
|
|
44
|
+
| "greenBright"
|
|
45
|
+
| "yellowBright"
|
|
46
|
+
| "blueBright"
|
|
47
|
+
| "magentaBright"
|
|
48
|
+
| "cyanBright"
|
|
49
|
+
| "whiteBright";
|
|
50
|
+
export type InspectColorBackground = `bg${Capitalize<InspectColorForeground>}`;
|
|
51
|
+
export type InspectColor = InspectColorModifier | InspectColorForeground | InspectColorBackground;
|
|
52
|
+
export interface InspectColors extends Record<InspectColor, [number, number]> {}
|
|
13
53
|
export interface InspectOptions {
|
|
14
54
|
/**
|
|
15
55
|
* If `true`, object's non-enumerable symbols and properties are included in the formatted result.
|
|
@@ -92,21 +132,12 @@ declare module "util" {
|
|
|
92
132
|
*/
|
|
93
133
|
numericSeparator?: boolean | undefined;
|
|
94
134
|
}
|
|
95
|
-
export
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
| "null"
|
|
102
|
-
| "string"
|
|
103
|
-
| "symbol"
|
|
104
|
-
| "date"
|
|
105
|
-
| "regexp"
|
|
106
|
-
| "module";
|
|
107
|
-
export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect
|
|
108
|
-
export interface InspectOptionsStylized extends InspectOptions {
|
|
109
|
-
stylize(text: string, styleType: Style): string;
|
|
135
|
+
export interface InspectContext extends Required<InspectOptions> {
|
|
136
|
+
stylize(text: string, styleType: InspectStyle): string;
|
|
137
|
+
}
|
|
138
|
+
import _inspect = inspect;
|
|
139
|
+
export interface Inspectable {
|
|
140
|
+
[inspect.custom](depth: number, options: InspectContext, inspect: typeof _inspect): any;
|
|
110
141
|
}
|
|
111
142
|
export interface CallSiteObject {
|
|
112
143
|
/**
|
|
@@ -243,7 +274,7 @@ declare module "util" {
|
|
|
243
274
|
* @since v10.0.0
|
|
244
275
|
*/
|
|
245
276
|
export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
|
|
246
|
-
interface GetCallSitesOptions {
|
|
277
|
+
export interface GetCallSitesOptions {
|
|
247
278
|
/**
|
|
248
279
|
* Reconstruct the original location in the stacktrace from the source-map.
|
|
249
280
|
* Enabled by default with the flag `--enable-source-maps`.
|
|
@@ -254,6 +285,9 @@ declare module "util" {
|
|
|
254
285
|
* Returns an array of call site objects containing the stack of
|
|
255
286
|
* the caller function.
|
|
256
287
|
*
|
|
288
|
+
* Unlike accessing an `error.stack`, the result returned from this API is not
|
|
289
|
+
* interfered with `Error.prepareStackTrace`.
|
|
290
|
+
*
|
|
257
291
|
* ```js
|
|
258
292
|
* import { getCallSites } from 'node:util';
|
|
259
293
|
*
|
|
@@ -266,7 +300,7 @@ declare module "util" {
|
|
|
266
300
|
* console.log(`Function Name: ${callSite.functionName}`);
|
|
267
301
|
* console.log(`Script Name: ${callSite.scriptName}`);
|
|
268
302
|
* console.log(`Line Number: ${callSite.lineNumber}`);
|
|
269
|
-
* console.log(`Column Number: ${callSite.
|
|
303
|
+
* console.log(`Column Number: ${callSite.columnNumber}`);
|
|
270
304
|
* });
|
|
271
305
|
* // CallSite 1:
|
|
272
306
|
* // Function Name: exampleFunction
|
|
@@ -293,8 +327,7 @@ declare module "util" {
|
|
|
293
327
|
*
|
|
294
328
|
* It is possible to reconstruct the original locations by setting the option `sourceMap` to `true`.
|
|
295
329
|
* If the source map is not available, the original location will be the same as the current location.
|
|
296
|
-
* When the `--enable-source-maps` flag is enabled,
|
|
297
|
-
* `sourceMap` will be true by default.
|
|
330
|
+
* When the `--enable-source-maps` flag is enabled, `sourceMap` will be true by default.
|
|
298
331
|
*
|
|
299
332
|
* ```ts
|
|
300
333
|
* import { getCallSites } from 'node:util';
|
|
@@ -340,7 +373,7 @@ declare module "util" {
|
|
|
340
373
|
export function getSystemErrorName(err: number): string;
|
|
341
374
|
/**
|
|
342
375
|
* Enable or disable printing a stack trace on `SIGINT`. The API is only available on the main thread.
|
|
343
|
-
* @since
|
|
376
|
+
* @since 24.6.0
|
|
344
377
|
*/
|
|
345
378
|
export function setTraceSigInt(enable: boolean): void;
|
|
346
379
|
/**
|
|
@@ -372,19 +405,6 @@ declare module "util" {
|
|
|
372
405
|
* @since v22.12.0
|
|
373
406
|
*/
|
|
374
407
|
export function getSystemErrorMessage(err: number): string;
|
|
375
|
-
/**
|
|
376
|
-
* The `util.log()` method prints the given `string` to `stdout` with an included
|
|
377
|
-
* timestamp.
|
|
378
|
-
*
|
|
379
|
-
* ```js
|
|
380
|
-
* import util from 'node:util';
|
|
381
|
-
*
|
|
382
|
-
* util.log('Timestamped message.');
|
|
383
|
-
* ```
|
|
384
|
-
* @since v0.3.0
|
|
385
|
-
* @deprecated Since v6.0.0 - Use a third party module instead.
|
|
386
|
-
*/
|
|
387
|
-
export function log(string: string): void;
|
|
388
408
|
/**
|
|
389
409
|
* Returns the `string` after replacing any surrogate code points
|
|
390
410
|
* (or equivalently, any unpaired surrogate code units) with the
|
|
@@ -622,19 +642,11 @@ declare module "util" {
|
|
|
622
642
|
export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
|
623
643
|
export function inspect(object: any, options?: InspectOptions): string;
|
|
624
644
|
export namespace inspect {
|
|
625
|
-
|
|
626
|
-
let
|
|
627
|
-
|
|
628
|
-
};
|
|
645
|
+
const custom: unique symbol;
|
|
646
|
+
let colors: InspectColors;
|
|
647
|
+
let styles: InspectStyles;
|
|
629
648
|
let defaultOptions: InspectOptions;
|
|
630
|
-
/**
|
|
631
|
-
* Allows changing inspect settings from the repl.
|
|
632
|
-
*/
|
|
633
649
|
let replDefaults: InspectOptions;
|
|
634
|
-
/**
|
|
635
|
-
* That can be used to declare custom inspect functions.
|
|
636
|
-
*/
|
|
637
|
-
const custom: unique symbol;
|
|
638
650
|
}
|
|
639
651
|
/**
|
|
640
652
|
* Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray).
|
|
@@ -655,71 +667,6 @@ declare module "util" {
|
|
|
655
667
|
* @deprecated Since v4.0.0 - Use `isArray` instead.
|
|
656
668
|
*/
|
|
657
669
|
export function isArray(object: unknown): object is unknown[];
|
|
658
|
-
/**
|
|
659
|
-
* Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`.
|
|
660
|
-
*
|
|
661
|
-
* ```js
|
|
662
|
-
* import util from 'node:util';
|
|
663
|
-
*
|
|
664
|
-
* util.isRegExp(/some regexp/);
|
|
665
|
-
* // Returns: true
|
|
666
|
-
* util.isRegExp(new RegExp('another regexp'));
|
|
667
|
-
* // Returns: true
|
|
668
|
-
* util.isRegExp({});
|
|
669
|
-
* // Returns: false
|
|
670
|
-
* ```
|
|
671
|
-
* @since v0.6.0
|
|
672
|
-
* @deprecated Since v4.0.0 - Deprecated
|
|
673
|
-
*/
|
|
674
|
-
export function isRegExp(object: unknown): object is RegExp;
|
|
675
|
-
/**
|
|
676
|
-
* Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`.
|
|
677
|
-
*
|
|
678
|
-
* ```js
|
|
679
|
-
* import util from 'node:util';
|
|
680
|
-
*
|
|
681
|
-
* util.isDate(new Date());
|
|
682
|
-
* // Returns: true
|
|
683
|
-
* util.isDate(Date());
|
|
684
|
-
* // false (without 'new' returns a String)
|
|
685
|
-
* util.isDate({});
|
|
686
|
-
* // Returns: false
|
|
687
|
-
* ```
|
|
688
|
-
* @since v0.6.0
|
|
689
|
-
* @deprecated Since v4.0.0 - Use {@link types.isDate} instead.
|
|
690
|
-
*/
|
|
691
|
-
export function isDate(object: unknown): object is Date;
|
|
692
|
-
/**
|
|
693
|
-
* Returns `true` if the given `object` is an `Error`. Otherwise, returns `false`.
|
|
694
|
-
*
|
|
695
|
-
* ```js
|
|
696
|
-
* import util from 'node:util';
|
|
697
|
-
*
|
|
698
|
-
* util.isError(new Error());
|
|
699
|
-
* // Returns: true
|
|
700
|
-
* util.isError(new TypeError());
|
|
701
|
-
* // Returns: true
|
|
702
|
-
* util.isError({ name: 'Error', message: 'an error occurred' });
|
|
703
|
-
* // Returns: false
|
|
704
|
-
* ```
|
|
705
|
-
*
|
|
706
|
-
* This method relies on `Object.prototype.toString()` behavior. It is
|
|
707
|
-
* possible to obtain an incorrect result when the `object` argument manipulates `@@toStringTag`.
|
|
708
|
-
*
|
|
709
|
-
* ```js
|
|
710
|
-
* import util from 'node:util';
|
|
711
|
-
* const obj = { name: 'Error', message: 'an error occurred' };
|
|
712
|
-
*
|
|
713
|
-
* util.isError(obj);
|
|
714
|
-
* // Returns: false
|
|
715
|
-
* obj[Symbol.toStringTag] = 'Error';
|
|
716
|
-
* util.isError(obj);
|
|
717
|
-
* // Returns: true
|
|
718
|
-
* ```
|
|
719
|
-
* @since v0.6.0
|
|
720
|
-
* @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead.
|
|
721
|
-
*/
|
|
722
|
-
export function isError(object: unknown): object is Error;
|
|
723
670
|
/**
|
|
724
671
|
* Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and
|
|
725
672
|
* `extends` keywords to get language level inheritance support. Also note
|
|
@@ -782,6 +729,28 @@ declare module "util" {
|
|
|
782
729
|
* @legacy Use ES2015 class syntax and `extends` keyword instead.
|
|
783
730
|
*/
|
|
784
731
|
export function inherits(constructor: unknown, superConstructor: unknown): void;
|
|
732
|
+
/**
|
|
733
|
+
* The `util.convertProcessSignalToExitCode()` method converts a signal name to its
|
|
734
|
+
* corresponding POSIX exit code. Following the POSIX standard, the exit code
|
|
735
|
+
* for a process terminated by a signal is calculated as `128 + signal number`.
|
|
736
|
+
*
|
|
737
|
+
* If `signal` is not a valid signal name, then an error will be thrown. See
|
|
738
|
+
* [`signal(7)`](https://man7.org/linux/man-pages/man7/signal.7.html) for a list of valid signals.
|
|
739
|
+
*
|
|
740
|
+
* ```js
|
|
741
|
+
* import { convertProcessSignalToExitCode } from 'node:util';
|
|
742
|
+
*
|
|
743
|
+
* console.log(convertProcessSignalToExitCode('SIGTERM')); // 143 (128 + 15)
|
|
744
|
+
* console.log(convertProcessSignalToExitCode('SIGKILL')); // 137 (128 + 9)
|
|
745
|
+
* ```
|
|
746
|
+
*
|
|
747
|
+
* This is particularly useful when working with processes to determine
|
|
748
|
+
* the exit code based on the signal that terminated the process.
|
|
749
|
+
* @since v25.4.0
|
|
750
|
+
* @param signal A signal name (e.g. `'SIGTERM'`)
|
|
751
|
+
* @returns The exit code corresponding to `signal`
|
|
752
|
+
*/
|
|
753
|
+
export function convertProcessSignalToExitCode(signal: NodeJS.Signals): number;
|
|
785
754
|
export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void;
|
|
786
755
|
export interface DebugLogger extends DebugLoggerFunction {
|
|
787
756
|
/**
|
|
@@ -836,7 +805,7 @@ declare module "util" {
|
|
|
836
805
|
*
|
|
837
806
|
* ```js
|
|
838
807
|
* import { debuglog } from 'node:util';
|
|
839
|
-
* const log = debuglog('foo');
|
|
808
|
+
* const log = debuglog('foo-bar');
|
|
840
809
|
*
|
|
841
810
|
* log('hi there, it\'s foo-bar [%d]', 2333);
|
|
842
811
|
* ```
|
|
@@ -870,217 +839,15 @@ declare module "util" {
|
|
|
870
839
|
*/
|
|
871
840
|
export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
|
|
872
841
|
export { debuglog as debug };
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
* // Returns: false
|
|
883
|
-
* util.isBoolean(false);
|
|
884
|
-
* // Returns: true
|
|
885
|
-
* ```
|
|
886
|
-
* @since v0.11.5
|
|
887
|
-
* @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead.
|
|
888
|
-
*/
|
|
889
|
-
export function isBoolean(object: unknown): object is boolean;
|
|
890
|
-
/**
|
|
891
|
-
* Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`.
|
|
892
|
-
*
|
|
893
|
-
* ```js
|
|
894
|
-
* import util from 'node:util';
|
|
895
|
-
*
|
|
896
|
-
* util.isBuffer({ length: 0 });
|
|
897
|
-
* // Returns: false
|
|
898
|
-
* util.isBuffer([]);
|
|
899
|
-
* // Returns: false
|
|
900
|
-
* util.isBuffer(Buffer.from('hello world'));
|
|
901
|
-
* // Returns: true
|
|
902
|
-
* ```
|
|
903
|
-
* @since v0.11.5
|
|
904
|
-
* @deprecated Since v4.0.0 - Use `isBuffer` instead.
|
|
905
|
-
*/
|
|
906
|
-
export function isBuffer(object: unknown): object is Buffer;
|
|
907
|
-
/**
|
|
908
|
-
* Returns `true` if the given `object` is a `Function`. Otherwise, returns `false`.
|
|
909
|
-
*
|
|
910
|
-
* ```js
|
|
911
|
-
* import util from 'node:util';
|
|
912
|
-
*
|
|
913
|
-
* function Foo() {}
|
|
914
|
-
* const Bar = () => {};
|
|
915
|
-
*
|
|
916
|
-
* util.isFunction({});
|
|
917
|
-
* // Returns: false
|
|
918
|
-
* util.isFunction(Foo);
|
|
919
|
-
* // Returns: true
|
|
920
|
-
* util.isFunction(Bar);
|
|
921
|
-
* // Returns: true
|
|
922
|
-
* ```
|
|
923
|
-
* @since v0.11.5
|
|
924
|
-
* @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead.
|
|
925
|
-
*/
|
|
926
|
-
export function isFunction(object: unknown): boolean;
|
|
927
|
-
/**
|
|
928
|
-
* Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`.
|
|
929
|
-
*
|
|
930
|
-
* ```js
|
|
931
|
-
* import util from 'node:util';
|
|
932
|
-
*
|
|
933
|
-
* util.isNull(0);
|
|
934
|
-
* // Returns: false
|
|
935
|
-
* util.isNull(undefined);
|
|
936
|
-
* // Returns: false
|
|
937
|
-
* util.isNull(null);
|
|
938
|
-
* // Returns: true
|
|
939
|
-
* ```
|
|
940
|
-
* @since v0.11.5
|
|
941
|
-
* @deprecated Since v4.0.0 - Use `value === null` instead.
|
|
942
|
-
*/
|
|
943
|
-
export function isNull(object: unknown): object is null;
|
|
944
|
-
/**
|
|
945
|
-
* Returns `true` if the given `object` is `null` or `undefined`. Otherwise,
|
|
946
|
-
* returns `false`.
|
|
947
|
-
*
|
|
948
|
-
* ```js
|
|
949
|
-
* import util from 'node:util';
|
|
950
|
-
*
|
|
951
|
-
* util.isNullOrUndefined(0);
|
|
952
|
-
* // Returns: false
|
|
953
|
-
* util.isNullOrUndefined(undefined);
|
|
954
|
-
* // Returns: true
|
|
955
|
-
* util.isNullOrUndefined(null);
|
|
956
|
-
* // Returns: true
|
|
957
|
-
* ```
|
|
958
|
-
* @since v0.11.5
|
|
959
|
-
* @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead.
|
|
960
|
-
*/
|
|
961
|
-
export function isNullOrUndefined(object: unknown): object is null | undefined;
|
|
962
|
-
/**
|
|
963
|
-
* Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`.
|
|
964
|
-
*
|
|
965
|
-
* ```js
|
|
966
|
-
* import util from 'node:util';
|
|
967
|
-
*
|
|
968
|
-
* util.isNumber(false);
|
|
969
|
-
* // Returns: false
|
|
970
|
-
* util.isNumber(Infinity);
|
|
971
|
-
* // Returns: true
|
|
972
|
-
* util.isNumber(0);
|
|
973
|
-
* // Returns: true
|
|
974
|
-
* util.isNumber(NaN);
|
|
975
|
-
* // Returns: true
|
|
976
|
-
* ```
|
|
977
|
-
* @since v0.11.5
|
|
978
|
-
* @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead.
|
|
979
|
-
*/
|
|
980
|
-
export function isNumber(object: unknown): object is number;
|
|
981
|
-
/**
|
|
982
|
-
* Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript).
|
|
983
|
-
* Otherwise, returns `false`.
|
|
984
|
-
*
|
|
985
|
-
* ```js
|
|
986
|
-
* import util from 'node:util';
|
|
987
|
-
*
|
|
988
|
-
* util.isObject(5);
|
|
989
|
-
* // Returns: false
|
|
990
|
-
* util.isObject(null);
|
|
991
|
-
* // Returns: false
|
|
992
|
-
* util.isObject({});
|
|
993
|
-
* // Returns: true
|
|
994
|
-
* util.isObject(() => {});
|
|
995
|
-
* // Returns: false
|
|
996
|
-
* ```
|
|
997
|
-
* @since v0.11.5
|
|
998
|
-
* @deprecated Since v4.0.0 - Use `value !== null && typeof value === 'object'` instead.
|
|
999
|
-
*/
|
|
1000
|
-
export function isObject(object: unknown): boolean;
|
|
1001
|
-
/**
|
|
1002
|
-
* Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`.
|
|
1003
|
-
*
|
|
1004
|
-
* ```js
|
|
1005
|
-
* import util from 'node:util';
|
|
1006
|
-
*
|
|
1007
|
-
* util.isPrimitive(5);
|
|
1008
|
-
* // Returns: true
|
|
1009
|
-
* util.isPrimitive('foo');
|
|
1010
|
-
* // Returns: true
|
|
1011
|
-
* util.isPrimitive(false);
|
|
1012
|
-
* // Returns: true
|
|
1013
|
-
* util.isPrimitive(null);
|
|
1014
|
-
* // Returns: true
|
|
1015
|
-
* util.isPrimitive(undefined);
|
|
1016
|
-
* // Returns: true
|
|
1017
|
-
* util.isPrimitive({});
|
|
1018
|
-
* // Returns: false
|
|
1019
|
-
* util.isPrimitive(() => {});
|
|
1020
|
-
* // Returns: false
|
|
1021
|
-
* util.isPrimitive(/^$/);
|
|
1022
|
-
* // Returns: false
|
|
1023
|
-
* util.isPrimitive(new Date());
|
|
1024
|
-
* // Returns: false
|
|
1025
|
-
* ```
|
|
1026
|
-
* @since v0.11.5
|
|
1027
|
-
* @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead.
|
|
1028
|
-
*/
|
|
1029
|
-
export function isPrimitive(object: unknown): boolean;
|
|
1030
|
-
/**
|
|
1031
|
-
* Returns `true` if the given `object` is a `string`. Otherwise, returns `false`.
|
|
1032
|
-
*
|
|
1033
|
-
* ```js
|
|
1034
|
-
* import util from 'node:util';
|
|
1035
|
-
*
|
|
1036
|
-
* util.isString('');
|
|
1037
|
-
* // Returns: true
|
|
1038
|
-
* util.isString('foo');
|
|
1039
|
-
* // Returns: true
|
|
1040
|
-
* util.isString(String('foo'));
|
|
1041
|
-
* // Returns: true
|
|
1042
|
-
* util.isString(5);
|
|
1043
|
-
* // Returns: false
|
|
1044
|
-
* ```
|
|
1045
|
-
* @since v0.11.5
|
|
1046
|
-
* @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead.
|
|
1047
|
-
*/
|
|
1048
|
-
export function isString(object: unknown): object is string;
|
|
1049
|
-
/**
|
|
1050
|
-
* Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`.
|
|
1051
|
-
*
|
|
1052
|
-
* ```js
|
|
1053
|
-
* import util from 'node:util';
|
|
1054
|
-
*
|
|
1055
|
-
* util.isSymbol(5);
|
|
1056
|
-
* // Returns: false
|
|
1057
|
-
* util.isSymbol('foo');
|
|
1058
|
-
* // Returns: false
|
|
1059
|
-
* util.isSymbol(Symbol('foo'));
|
|
1060
|
-
* // Returns: true
|
|
1061
|
-
* ```
|
|
1062
|
-
* @since v0.11.5
|
|
1063
|
-
* @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead.
|
|
1064
|
-
*/
|
|
1065
|
-
export function isSymbol(object: unknown): object is symbol;
|
|
1066
|
-
/**
|
|
1067
|
-
* Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`.
|
|
1068
|
-
*
|
|
1069
|
-
* ```js
|
|
1070
|
-
* import util from 'node:util';
|
|
1071
|
-
*
|
|
1072
|
-
* const foo = undefined;
|
|
1073
|
-
* util.isUndefined(5);
|
|
1074
|
-
* // Returns: false
|
|
1075
|
-
* util.isUndefined(foo);
|
|
1076
|
-
* // Returns: true
|
|
1077
|
-
* util.isUndefined(null);
|
|
1078
|
-
* // Returns: false
|
|
1079
|
-
* ```
|
|
1080
|
-
* @since v0.11.5
|
|
1081
|
-
* @deprecated Since v4.0.0 - Use `value === undefined` instead.
|
|
1082
|
-
*/
|
|
1083
|
-
export function isUndefined(object: unknown): object is undefined;
|
|
842
|
+
export interface DeprecateOptions {
|
|
843
|
+
/**
|
|
844
|
+
* When false do not change the prototype of object
|
|
845
|
+
* while emitting the deprecation warning.
|
|
846
|
+
* @since v25.2.0
|
|
847
|
+
* @default true
|
|
848
|
+
*/
|
|
849
|
+
modifyPrototype?: boolean | undefined;
|
|
850
|
+
}
|
|
1084
851
|
/**
|
|
1085
852
|
* The `util.deprecate()` method wraps `fn` (which may be a function or class) in
|
|
1086
853
|
* such a way that it is marked as deprecated.
|
|
@@ -1141,7 +908,16 @@ declare module "util" {
|
|
|
1141
908
|
* @param code A deprecation code. See the `list of deprecated APIs` for a list of codes.
|
|
1142
909
|
* @return The deprecated function wrapped to emit a warning.
|
|
1143
910
|
*/
|
|
1144
|
-
export function deprecate<T extends Function>(fn: T, msg: string, code?: string): T;
|
|
911
|
+
export function deprecate<T extends Function>(fn: T, msg: string, code?: string, options?: DeprecateOptions): T;
|
|
912
|
+
export interface IsDeepStrictEqualOptions {
|
|
913
|
+
/**
|
|
914
|
+
* If `true`, prototype and constructor
|
|
915
|
+
* comparison is skipped during deep strict equality check.
|
|
916
|
+
* @since v24.9.0
|
|
917
|
+
* @default false
|
|
918
|
+
*/
|
|
919
|
+
skipPrototype?: boolean | undefined;
|
|
920
|
+
}
|
|
1145
921
|
/**
|
|
1146
922
|
* Returns `true` if there is deep strict equality between `val1` and `val2`.
|
|
1147
923
|
* Otherwise, returns `false`.
|
|
@@ -1150,7 +926,7 @@ declare module "util" {
|
|
|
1150
926
|
* equality.
|
|
1151
927
|
* @since v9.0.0
|
|
1152
928
|
*/
|
|
1153
|
-
export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean;
|
|
929
|
+
export function isDeepStrictEqual(val1: unknown, val2: unknown, options?: IsDeepStrictEqualOptions): boolean;
|
|
1154
930
|
/**
|
|
1155
931
|
* Returns `str` with any ANSI escape codes removed.
|
|
1156
932
|
*
|
|
@@ -1198,6 +974,8 @@ declare module "util" {
|
|
|
1198
974
|
* `reason`.
|
|
1199
975
|
*
|
|
1200
976
|
* ```js
|
|
977
|
+
* import util from 'node:util';
|
|
978
|
+
*
|
|
1201
979
|
* function fn() {
|
|
1202
980
|
* return Promise.reject(null);
|
|
1203
981
|
* }
|
|
@@ -1325,7 +1103,7 @@ declare module "util" {
|
|
|
1325
1103
|
* ```
|
|
1326
1104
|
*
|
|
1327
1105
|
* If there is an `original[util.promisify.custom]` property present, `promisify`
|
|
1328
|
-
* will return its value, see [Custom promisified functions](https://nodejs.org/docs/latest-
|
|
1106
|
+
* will return its value, see [Custom promisified functions](https://nodejs.org/docs/latest-v26.x/api/util.html#custom-promisified-functions).
|
|
1329
1107
|
*
|
|
1330
1108
|
* `promisify()` assumes that `original` is a function taking a callback as its
|
|
1331
1109
|
* final argument in all cases. If `original` is not a function, `promisify()`
|
|
@@ -1416,61 +1194,6 @@ declare module "util" {
|
|
|
1416
1194
|
* @since v20.12.0
|
|
1417
1195
|
*/
|
|
1418
1196
|
export function parseEnv(content: string): NodeJS.Dict<string>;
|
|
1419
|
-
// https://nodejs.org/docs/latest/api/util.html#foreground-colors
|
|
1420
|
-
type ForegroundColors =
|
|
1421
|
-
| "black"
|
|
1422
|
-
| "blackBright"
|
|
1423
|
-
| "blue"
|
|
1424
|
-
| "blueBright"
|
|
1425
|
-
| "cyan"
|
|
1426
|
-
| "cyanBright"
|
|
1427
|
-
| "gray"
|
|
1428
|
-
| "green"
|
|
1429
|
-
| "greenBright"
|
|
1430
|
-
| "grey"
|
|
1431
|
-
| "magenta"
|
|
1432
|
-
| "magentaBright"
|
|
1433
|
-
| "red"
|
|
1434
|
-
| "redBright"
|
|
1435
|
-
| "white"
|
|
1436
|
-
| "whiteBright"
|
|
1437
|
-
| "yellow"
|
|
1438
|
-
| "yellowBright";
|
|
1439
|
-
// https://nodejs.org/docs/latest/api/util.html#background-colors
|
|
1440
|
-
type BackgroundColors =
|
|
1441
|
-
| "bgBlack"
|
|
1442
|
-
| "bgBlackBright"
|
|
1443
|
-
| "bgBlue"
|
|
1444
|
-
| "bgBlueBright"
|
|
1445
|
-
| "bgCyan"
|
|
1446
|
-
| "bgCyanBright"
|
|
1447
|
-
| "bgGray"
|
|
1448
|
-
| "bgGreen"
|
|
1449
|
-
| "bgGreenBright"
|
|
1450
|
-
| "bgGrey"
|
|
1451
|
-
| "bgMagenta"
|
|
1452
|
-
| "bgMagentaBright"
|
|
1453
|
-
| "bgRed"
|
|
1454
|
-
| "bgRedBright"
|
|
1455
|
-
| "bgWhite"
|
|
1456
|
-
| "bgWhiteBright"
|
|
1457
|
-
| "bgYellow"
|
|
1458
|
-
| "bgYellowBright";
|
|
1459
|
-
// https://nodejs.org/docs/latest/api/util.html#modifiers
|
|
1460
|
-
type Modifiers =
|
|
1461
|
-
| "blink"
|
|
1462
|
-
| "bold"
|
|
1463
|
-
| "dim"
|
|
1464
|
-
| "doubleunderline"
|
|
1465
|
-
| "framed"
|
|
1466
|
-
| "hidden"
|
|
1467
|
-
| "inverse"
|
|
1468
|
-
| "italic"
|
|
1469
|
-
| "none"
|
|
1470
|
-
| "overlined"
|
|
1471
|
-
| "reset"
|
|
1472
|
-
| "strikethrough"
|
|
1473
|
-
| "underline";
|
|
1474
1197
|
export interface StyleTextOptions {
|
|
1475
1198
|
/**
|
|
1476
1199
|
* When true, `stream` is checked to see if it can handle colors.
|
|
@@ -1525,142 +1248,31 @@ declare module "util" {
|
|
|
1525
1248
|
*
|
|
1526
1249
|
* The special format value `none` applies no additional styling to the text.
|
|
1527
1250
|
*
|
|
1528
|
-
*
|
|
1529
|
-
*
|
|
1251
|
+
* In addition to predefined color names, `util.styleText()` supports hex color
|
|
1252
|
+
* strings using ANSI TrueColor (24-bit) escape sequences. Hex colors can be
|
|
1253
|
+
* specified in either 3-digit (`#RGB`) or 6-digit (`#RRGGBB`) format:
|
|
1254
|
+
*
|
|
1255
|
+
* ```js
|
|
1256
|
+
* import { styleText } from 'node:util';
|
|
1257
|
+
*
|
|
1258
|
+
* // 6-digit hex color
|
|
1259
|
+
* console.log(styleText('#ff5733', 'Orange text'));
|
|
1260
|
+
*
|
|
1261
|
+
* // 3-digit hex color (shorthand)
|
|
1262
|
+
* console.log(styleText('#f00', 'Red text'));
|
|
1263
|
+
* ```
|
|
1264
|
+
*
|
|
1265
|
+
* The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v26.x/api/util.html#modifiers).
|
|
1266
|
+
* @param format A text format or an Array of text formats defined in `util.inspect.colors`, or a hex color in `#RGB`
|
|
1267
|
+
* or `#RRGGBB` form.
|
|
1530
1268
|
* @param text The text to to be formatted.
|
|
1531
1269
|
* @since v20.12.0
|
|
1532
1270
|
*/
|
|
1533
1271
|
export function styleText(
|
|
1534
|
-
format:
|
|
1535
|
-
| ForegroundColors
|
|
1536
|
-
| BackgroundColors
|
|
1537
|
-
| Modifiers
|
|
1538
|
-
| Array<ForegroundColors | BackgroundColors | Modifiers>,
|
|
1272
|
+
format: InspectColor | readonly InspectColor[] | `#${string}`,
|
|
1539
1273
|
text: string,
|
|
1540
1274
|
options?: StyleTextOptions,
|
|
1541
1275
|
): string;
|
|
1542
|
-
/**
|
|
1543
|
-
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API.
|
|
1544
|
-
*
|
|
1545
|
-
* ```js
|
|
1546
|
-
* const decoder = new TextDecoder();
|
|
1547
|
-
* const u8arr = new Uint8Array([72, 101, 108, 108, 111]);
|
|
1548
|
-
* console.log(decoder.decode(u8arr)); // Hello
|
|
1549
|
-
* ```
|
|
1550
|
-
* @since v8.3.0
|
|
1551
|
-
*/
|
|
1552
|
-
export class TextDecoder {
|
|
1553
|
-
/**
|
|
1554
|
-
* The encoding supported by the `TextDecoder` instance.
|
|
1555
|
-
*/
|
|
1556
|
-
readonly encoding: string;
|
|
1557
|
-
/**
|
|
1558
|
-
* The value will be `true` if decoding errors result in a `TypeError` being
|
|
1559
|
-
* thrown.
|
|
1560
|
-
*/
|
|
1561
|
-
readonly fatal: boolean;
|
|
1562
|
-
/**
|
|
1563
|
-
* The value will be `true` if the decoding result will include the byte order
|
|
1564
|
-
* mark.
|
|
1565
|
-
*/
|
|
1566
|
-
readonly ignoreBOM: boolean;
|
|
1567
|
-
constructor(
|
|
1568
|
-
encoding?: string,
|
|
1569
|
-
options?: {
|
|
1570
|
-
fatal?: boolean | undefined;
|
|
1571
|
-
ignoreBOM?: boolean | undefined;
|
|
1572
|
-
},
|
|
1573
|
-
);
|
|
1574
|
-
/**
|
|
1575
|
-
* Decodes the `input` and returns a string. If `options.stream` is `true`, any
|
|
1576
|
-
* incomplete byte sequences occurring at the end of the `input` are buffered
|
|
1577
|
-
* internally and emitted after the next call to `textDecoder.decode()`.
|
|
1578
|
-
*
|
|
1579
|
-
* If `textDecoder.fatal` is `true`, decoding errors that occur will result in a `TypeError` being thrown.
|
|
1580
|
-
* @param input An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data.
|
|
1581
|
-
*/
|
|
1582
|
-
decode(
|
|
1583
|
-
input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
|
|
1584
|
-
options?: {
|
|
1585
|
-
stream?: boolean | undefined;
|
|
1586
|
-
},
|
|
1587
|
-
): string;
|
|
1588
|
-
}
|
|
1589
|
-
export interface EncodeIntoResult {
|
|
1590
|
-
/**
|
|
1591
|
-
* The read Unicode code units of input.
|
|
1592
|
-
*/
|
|
1593
|
-
read: number;
|
|
1594
|
-
/**
|
|
1595
|
-
* The written UTF-8 bytes of output.
|
|
1596
|
-
*/
|
|
1597
|
-
written: number;
|
|
1598
|
-
}
|
|
1599
|
-
export { types };
|
|
1600
|
-
|
|
1601
|
-
//// TextEncoder/Decoder
|
|
1602
|
-
/**
|
|
1603
|
-
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All
|
|
1604
|
-
* instances of `TextEncoder` only support UTF-8 encoding.
|
|
1605
|
-
*
|
|
1606
|
-
* ```js
|
|
1607
|
-
* const encoder = new TextEncoder();
|
|
1608
|
-
* const uint8array = encoder.encode('this is some data');
|
|
1609
|
-
* ```
|
|
1610
|
-
*
|
|
1611
|
-
* The `TextEncoder` class is also available on the global object.
|
|
1612
|
-
* @since v8.3.0
|
|
1613
|
-
*/
|
|
1614
|
-
export class TextEncoder {
|
|
1615
|
-
/**
|
|
1616
|
-
* The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`.
|
|
1617
|
-
*/
|
|
1618
|
-
readonly encoding: string;
|
|
1619
|
-
/**
|
|
1620
|
-
* UTF-8 encodes the `input` string and returns a `Uint8Array` containing the
|
|
1621
|
-
* encoded bytes.
|
|
1622
|
-
* @param [input='an empty string'] The text to encode.
|
|
1623
|
-
*/
|
|
1624
|
-
encode(input?: string): NodeJS.NonSharedUint8Array;
|
|
1625
|
-
/**
|
|
1626
|
-
* UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object
|
|
1627
|
-
* containing the read Unicode code units and written UTF-8 bytes.
|
|
1628
|
-
*
|
|
1629
|
-
* ```js
|
|
1630
|
-
* const encoder = new TextEncoder();
|
|
1631
|
-
* const src = 'this is some data';
|
|
1632
|
-
* const dest = new Uint8Array(10);
|
|
1633
|
-
* const { read, written } = encoder.encodeInto(src, dest);
|
|
1634
|
-
* ```
|
|
1635
|
-
* @param src The text to encode.
|
|
1636
|
-
* @param dest The array to hold the encode result.
|
|
1637
|
-
*/
|
|
1638
|
-
encodeInto(src: string, dest: Uint8Array): EncodeIntoResult;
|
|
1639
|
-
}
|
|
1640
|
-
import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util";
|
|
1641
|
-
global {
|
|
1642
|
-
/**
|
|
1643
|
-
* `TextDecoder` class is a global reference for `import { TextDecoder } from 'node:util'`
|
|
1644
|
-
* https://nodejs.org/api/globals.html#textdecoder
|
|
1645
|
-
* @since v11.0.0
|
|
1646
|
-
*/
|
|
1647
|
-
var TextDecoder: typeof globalThis extends {
|
|
1648
|
-
onmessage: any;
|
|
1649
|
-
TextDecoder: infer TextDecoder;
|
|
1650
|
-
} ? TextDecoder
|
|
1651
|
-
: typeof _TextDecoder;
|
|
1652
|
-
/**
|
|
1653
|
-
* `TextEncoder` class is a global reference for `import { TextEncoder } from 'node:util'`
|
|
1654
|
-
* https://nodejs.org/api/globals.html#textencoder
|
|
1655
|
-
* @since v11.0.0
|
|
1656
|
-
*/
|
|
1657
|
-
var TextEncoder: typeof globalThis extends {
|
|
1658
|
-
onmessage: any;
|
|
1659
|
-
TextEncoder: infer TextEncoder;
|
|
1660
|
-
} ? TextEncoder
|
|
1661
|
-
: typeof _TextEncoder;
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1664
1276
|
//// parseArgs
|
|
1665
1277
|
/**
|
|
1666
1278
|
* Provides a higher level API for command-line argument parsing than interacting
|
|
@@ -1691,12 +1303,10 @@ declare module "util" {
|
|
|
1691
1303
|
* @return The parsed command line arguments:
|
|
1692
1304
|
*/
|
|
1693
1305
|
export function parseArgs<T extends ParseArgsConfig>(config?: T): ParsedResults<T>;
|
|
1694
|
-
|
|
1695
1306
|
/**
|
|
1696
1307
|
* Type of argument used in {@link parseArgs}.
|
|
1697
1308
|
*/
|
|
1698
1309
|
export type ParseArgsOptionsType = "boolean" | "string";
|
|
1699
|
-
|
|
1700
1310
|
export interface ParseArgsOptionDescriptor {
|
|
1701
1311
|
/**
|
|
1702
1312
|
* Type of argument.
|
|
@@ -1771,23 +1381,19 @@ declare module "util" {
|
|
|
1771
1381
|
type IfDefaultsTrue<T, IfTrue, IfFalse> = T extends true ? IfTrue
|
|
1772
1382
|
: T extends false ? IfFalse
|
|
1773
1383
|
: IfTrue;
|
|
1774
|
-
|
|
1775
1384
|
// we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false`
|
|
1776
1385
|
type IfDefaultsFalse<T, IfTrue, IfFalse> = T extends false ? IfFalse
|
|
1777
1386
|
: T extends true ? IfTrue
|
|
1778
1387
|
: IfFalse;
|
|
1779
|
-
|
|
1780
1388
|
type ExtractOptionValue<T extends ParseArgsConfig, O extends ParseArgsOptionDescriptor> = IfDefaultsTrue<
|
|
1781
1389
|
T["strict"],
|
|
1782
1390
|
O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean,
|
|
1783
1391
|
string | boolean
|
|
1784
1392
|
>;
|
|
1785
|
-
|
|
1786
1393
|
type ApplyOptionalModifiers<O extends ParseArgsOptionsConfig, V extends Record<keyof O, unknown>> = (
|
|
1787
1394
|
& { -readonly [LongOption in keyof O]?: V[LongOption] }
|
|
1788
1395
|
& { [LongOption in keyof O as O[LongOption]["default"] extends {} ? LongOption : never]: V[LongOption] }
|
|
1789
1396
|
) extends infer P ? { [K in keyof P]: P[K] } : never; // resolve intersection to object
|
|
1790
|
-
|
|
1791
1397
|
type ParsedValues<T extends ParseArgsConfig> =
|
|
1792
1398
|
& IfDefaultsTrue<T["strict"], unknown, { [longOption: string]: undefined | string | boolean }>
|
|
1793
1399
|
& (T["options"] extends ParseArgsOptionsConfig ? ApplyOptionalModifiers<
|
|
@@ -1801,13 +1407,11 @@ declare module "util" {
|
|
|
1801
1407
|
}
|
|
1802
1408
|
>
|
|
1803
1409
|
: {});
|
|
1804
|
-
|
|
1805
1410
|
type ParsedPositionals<T extends ParseArgsConfig> = IfDefaultsTrue<
|
|
1806
1411
|
T["strict"],
|
|
1807
1412
|
IfDefaultsFalse<T["allowPositionals"], string[], []>,
|
|
1808
1413
|
IfDefaultsTrue<T["allowPositionals"], string[], []>
|
|
1809
1414
|
>;
|
|
1810
|
-
|
|
1811
1415
|
type PreciseTokenForOptions<
|
|
1812
1416
|
K extends string,
|
|
1813
1417
|
O extends ParseArgsOptionDescriptor,
|
|
@@ -1828,7 +1432,6 @@ declare module "util" {
|
|
|
1828
1432
|
inlineValue: undefined;
|
|
1829
1433
|
}
|
|
1830
1434
|
: OptionToken & { name: K };
|
|
1831
|
-
|
|
1832
1435
|
type TokenForOptions<
|
|
1833
1436
|
T extends ParseArgsConfig,
|
|
1834
1437
|
K extends keyof T["options"] = keyof T["options"],
|
|
@@ -1836,19 +1439,15 @@ declare module "util" {
|
|
|
1836
1439
|
? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions<K & string, T["options"][K]>
|
|
1837
1440
|
: OptionToken
|
|
1838
1441
|
: never;
|
|
1839
|
-
|
|
1840
1442
|
type ParsedOptionToken<T extends ParseArgsConfig> = IfDefaultsTrue<T["strict"], TokenForOptions<T>, OptionToken>;
|
|
1841
|
-
|
|
1842
1443
|
type ParsedPositionalToken<T extends ParseArgsConfig> = IfDefaultsTrue<
|
|
1843
1444
|
T["strict"],
|
|
1844
1445
|
IfDefaultsFalse<T["allowPositionals"], { kind: "positional"; index: number; value: string }, never>,
|
|
1845
1446
|
IfDefaultsTrue<T["allowPositionals"], { kind: "positional"; index: number; value: string }, never>
|
|
1846
1447
|
>;
|
|
1847
|
-
|
|
1848
1448
|
type ParsedTokens<T extends ParseArgsConfig> = Array<
|
|
1849
1449
|
ParsedOptionToken<T> | ParsedPositionalToken<T> | { kind: "option-terminator"; index: number }
|
|
1850
1450
|
>;
|
|
1851
|
-
|
|
1852
1451
|
type PreciseParsedResults<T extends ParseArgsConfig> = IfDefaultsFalse<
|
|
1853
1452
|
T["tokens"],
|
|
1854
1453
|
{
|
|
@@ -1861,7 +1460,6 @@ declare module "util" {
|
|
|
1861
1460
|
positionals: ParsedPositionals<T>;
|
|
1862
1461
|
}
|
|
1863
1462
|
>;
|
|
1864
|
-
|
|
1865
1463
|
type OptionToken =
|
|
1866
1464
|
| { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean }
|
|
1867
1465
|
| {
|
|
@@ -1872,12 +1470,10 @@ declare module "util" {
|
|
|
1872
1470
|
value: undefined;
|
|
1873
1471
|
inlineValue: undefined;
|
|
1874
1472
|
};
|
|
1875
|
-
|
|
1876
1473
|
type Token =
|
|
1877
1474
|
| OptionToken
|
|
1878
1475
|
| { kind: "positional"; index: number; value: string }
|
|
1879
1476
|
| { kind: "option-terminator"; index: number };
|
|
1880
|
-
|
|
1881
1477
|
// If ParseArgsConfig extends T, then the user passed config constructed elsewhere.
|
|
1882
1478
|
// So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above.
|
|
1883
1479
|
type ParsedResults<T extends ParseArgsConfig> = ParseArgsConfig extends T ? {
|
|
@@ -1888,7 +1484,6 @@ declare module "util" {
|
|
|
1888
1484
|
tokens?: Token[];
|
|
1889
1485
|
}
|
|
1890
1486
|
: PreciseParsedResults<T>;
|
|
1891
|
-
|
|
1892
1487
|
/**
|
|
1893
1488
|
* An implementation of [the MIMEType class](https://bmeck.github.io/node-proposal-mime-api/).
|
|
1894
1489
|
*
|
|
@@ -1910,7 +1505,6 @@ declare module "util" {
|
|
|
1910
1505
|
* @param input The input MIME to parse.
|
|
1911
1506
|
*/
|
|
1912
1507
|
constructor(input: string | { toString: () => string });
|
|
1913
|
-
|
|
1914
1508
|
/**
|
|
1915
1509
|
* Gets and sets the type portion of the MIME.
|
|
1916
1510
|
*
|
|
@@ -2041,566 +1635,43 @@ declare module "util" {
|
|
|
2041
1635
|
*/
|
|
2042
1636
|
[Symbol.iterator](): NodeJS.Iterator<[name: string, value: string]>;
|
|
2043
1637
|
}
|
|
1638
|
+
// #region web types
|
|
1639
|
+
export interface TextDecodeOptions {
|
|
1640
|
+
stream?: boolean;
|
|
1641
|
+
}
|
|
1642
|
+
export interface TextDecoderCommon {
|
|
1643
|
+
readonly encoding: string;
|
|
1644
|
+
readonly fatal: boolean;
|
|
1645
|
+
readonly ignoreBOM: boolean;
|
|
1646
|
+
}
|
|
1647
|
+
export interface TextDecoderOptions {
|
|
1648
|
+
fatal?: boolean;
|
|
1649
|
+
ignoreBOM?: boolean;
|
|
1650
|
+
}
|
|
1651
|
+
export interface TextEncoderCommon {
|
|
1652
|
+
readonly encoding: string;
|
|
1653
|
+
}
|
|
1654
|
+
export interface TextEncoderEncodeIntoResult {
|
|
1655
|
+
read: number;
|
|
1656
|
+
written: number;
|
|
1657
|
+
}
|
|
1658
|
+
export interface TextDecoder extends TextDecoderCommon {
|
|
1659
|
+
decode(input?: NodeJS.AllowSharedBufferSource, options?: TextDecodeOptions): string;
|
|
1660
|
+
}
|
|
1661
|
+
export var TextDecoder: {
|
|
1662
|
+
prototype: TextDecoder;
|
|
1663
|
+
new(label?: string, options?: TextDecoderOptions): TextDecoder;
|
|
1664
|
+
};
|
|
1665
|
+
export interface TextEncoder extends TextEncoderCommon {
|
|
1666
|
+
encode(input?: string): NodeJS.NonSharedUint8Array;
|
|
1667
|
+
encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
|
|
1668
|
+
}
|
|
1669
|
+
export var TextEncoder: {
|
|
1670
|
+
prototype: TextEncoder;
|
|
1671
|
+
new(): TextEncoder;
|
|
1672
|
+
};
|
|
1673
|
+
// #endregion
|
|
2044
1674
|
}
|
|
2045
|
-
declare module "util
|
|
2046
|
-
|
|
2047
|
-
/**
|
|
2048
|
-
* Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or
|
|
2049
|
-
* [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
|
|
2050
|
-
*
|
|
2051
|
-
* See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`.
|
|
2052
|
-
*
|
|
2053
|
-
* ```js
|
|
2054
|
-
* util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true
|
|
2055
|
-
* util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true
|
|
2056
|
-
* ```
|
|
2057
|
-
* @since v10.0.0
|
|
2058
|
-
*/
|
|
2059
|
-
function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike;
|
|
2060
|
-
/**
|
|
2061
|
-
* Returns `true` if the value is an `arguments` object.
|
|
2062
|
-
*
|
|
2063
|
-
* ```js
|
|
2064
|
-
* function foo() {
|
|
2065
|
-
* util.types.isArgumentsObject(arguments); // Returns true
|
|
2066
|
-
* }
|
|
2067
|
-
* ```
|
|
2068
|
-
* @since v10.0.0
|
|
2069
|
-
*/
|
|
2070
|
-
function isArgumentsObject(object: unknown): object is IArguments;
|
|
2071
|
-
/**
|
|
2072
|
-
* Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance.
|
|
2073
|
-
* This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is
|
|
2074
|
-
* desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
|
|
2075
|
-
*
|
|
2076
|
-
* ```js
|
|
2077
|
-
* util.types.isArrayBuffer(new ArrayBuffer()); // Returns true
|
|
2078
|
-
* util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false
|
|
2079
|
-
* ```
|
|
2080
|
-
* @since v10.0.0
|
|
2081
|
-
*/
|
|
2082
|
-
function isArrayBuffer(object: unknown): object is ArrayBuffer;
|
|
2083
|
-
/**
|
|
2084
|
-
* Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed
|
|
2085
|
-
* array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to
|
|
2086
|
-
* [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
|
|
2087
|
-
*
|
|
2088
|
-
* ```js
|
|
2089
|
-
* util.types.isArrayBufferView(new Int8Array()); // true
|
|
2090
|
-
* util.types.isArrayBufferView(Buffer.from('hello world')); // true
|
|
2091
|
-
* util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true
|
|
2092
|
-
* util.types.isArrayBufferView(new ArrayBuffer()); // false
|
|
2093
|
-
* ```
|
|
2094
|
-
* @since v10.0.0
|
|
2095
|
-
*/
|
|
2096
|
-
function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView;
|
|
2097
|
-
/**
|
|
2098
|
-
* Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function).
|
|
2099
|
-
* This only reports back what the JavaScript engine is seeing;
|
|
2100
|
-
* in particular, the return value may not match the original source code if
|
|
2101
|
-
* a transpilation tool was used.
|
|
2102
|
-
*
|
|
2103
|
-
* ```js
|
|
2104
|
-
* util.types.isAsyncFunction(function foo() {}); // Returns false
|
|
2105
|
-
* util.types.isAsyncFunction(async function foo() {}); // Returns true
|
|
2106
|
-
* ```
|
|
2107
|
-
* @since v10.0.0
|
|
2108
|
-
*/
|
|
2109
|
-
function isAsyncFunction(object: unknown): boolean;
|
|
2110
|
-
/**
|
|
2111
|
-
* Returns `true` if the value is a `BigInt64Array` instance.
|
|
2112
|
-
*
|
|
2113
|
-
* ```js
|
|
2114
|
-
* util.types.isBigInt64Array(new BigInt64Array()); // Returns true
|
|
2115
|
-
* util.types.isBigInt64Array(new BigUint64Array()); // Returns false
|
|
2116
|
-
* ```
|
|
2117
|
-
* @since v10.0.0
|
|
2118
|
-
*/
|
|
2119
|
-
function isBigInt64Array(value: unknown): value is BigInt64Array;
|
|
2120
|
-
/**
|
|
2121
|
-
* Returns `true` if the value is a BigInt object, e.g. created
|
|
2122
|
-
* by `Object(BigInt(123))`.
|
|
2123
|
-
*
|
|
2124
|
-
* ```js
|
|
2125
|
-
* util.types.isBigIntObject(Object(BigInt(123))); // Returns true
|
|
2126
|
-
* util.types.isBigIntObject(BigInt(123)); // Returns false
|
|
2127
|
-
* util.types.isBigIntObject(123); // Returns false
|
|
2128
|
-
* ```
|
|
2129
|
-
* @since v10.4.0
|
|
2130
|
-
*/
|
|
2131
|
-
function isBigIntObject(object: unknown): object is BigInt;
|
|
2132
|
-
/**
|
|
2133
|
-
* Returns `true` if the value is a `BigUint64Array` instance.
|
|
2134
|
-
*
|
|
2135
|
-
* ```js
|
|
2136
|
-
* util.types.isBigUint64Array(new BigInt64Array()); // Returns false
|
|
2137
|
-
* util.types.isBigUint64Array(new BigUint64Array()); // Returns true
|
|
2138
|
-
* ```
|
|
2139
|
-
* @since v10.0.0
|
|
2140
|
-
*/
|
|
2141
|
-
function isBigUint64Array(value: unknown): value is BigUint64Array;
|
|
2142
|
-
/**
|
|
2143
|
-
* Returns `true` if the value is a boolean object, e.g. created
|
|
2144
|
-
* by `new Boolean()`.
|
|
2145
|
-
*
|
|
2146
|
-
* ```js
|
|
2147
|
-
* util.types.isBooleanObject(false); // Returns false
|
|
2148
|
-
* util.types.isBooleanObject(true); // Returns false
|
|
2149
|
-
* util.types.isBooleanObject(new Boolean(false)); // Returns true
|
|
2150
|
-
* util.types.isBooleanObject(new Boolean(true)); // Returns true
|
|
2151
|
-
* util.types.isBooleanObject(Boolean(false)); // Returns false
|
|
2152
|
-
* util.types.isBooleanObject(Boolean(true)); // Returns false
|
|
2153
|
-
* ```
|
|
2154
|
-
* @since v10.0.0
|
|
2155
|
-
*/
|
|
2156
|
-
function isBooleanObject(object: unknown): object is Boolean;
|
|
2157
|
-
/**
|
|
2158
|
-
* Returns `true` if the value is any boxed primitive object, e.g. created
|
|
2159
|
-
* by `new Boolean()`, `new String()` or `Object(Symbol())`.
|
|
2160
|
-
*
|
|
2161
|
-
* For example:
|
|
2162
|
-
*
|
|
2163
|
-
* ```js
|
|
2164
|
-
* util.types.isBoxedPrimitive(false); // Returns false
|
|
2165
|
-
* util.types.isBoxedPrimitive(new Boolean(false)); // Returns true
|
|
2166
|
-
* util.types.isBoxedPrimitive(Symbol('foo')); // Returns false
|
|
2167
|
-
* util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true
|
|
2168
|
-
* util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true
|
|
2169
|
-
* ```
|
|
2170
|
-
* @since v10.11.0
|
|
2171
|
-
*/
|
|
2172
|
-
function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol;
|
|
2173
|
-
/**
|
|
2174
|
-
* Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance.
|
|
2175
|
-
*
|
|
2176
|
-
* ```js
|
|
2177
|
-
* const ab = new ArrayBuffer(20);
|
|
2178
|
-
* util.types.isDataView(new DataView(ab)); // Returns true
|
|
2179
|
-
* util.types.isDataView(new Float64Array()); // Returns false
|
|
2180
|
-
* ```
|
|
2181
|
-
*
|
|
2182
|
-
* See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
|
|
2183
|
-
* @since v10.0.0
|
|
2184
|
-
*/
|
|
2185
|
-
function isDataView(object: unknown): object is DataView;
|
|
2186
|
-
/**
|
|
2187
|
-
* Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
|
|
2188
|
-
*
|
|
2189
|
-
* ```js
|
|
2190
|
-
* util.types.isDate(new Date()); // Returns true
|
|
2191
|
-
* ```
|
|
2192
|
-
* @since v10.0.0
|
|
2193
|
-
*/
|
|
2194
|
-
function isDate(object: unknown): object is Date;
|
|
2195
|
-
/**
|
|
2196
|
-
* Returns `true` if the value is a native `External` value.
|
|
2197
|
-
*
|
|
2198
|
-
* A native `External` value is a special type of object that contains a
|
|
2199
|
-
* raw C++ pointer (`void*`) for access from native code, and has no other
|
|
2200
|
-
* properties. Such objects are created either by Node.js internals or native
|
|
2201
|
-
* addons. In JavaScript, they are
|
|
2202
|
-
* [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a
|
|
2203
|
-
* `null` prototype.
|
|
2204
|
-
*
|
|
2205
|
-
* ```c
|
|
2206
|
-
* #include <js_native_api.h>
|
|
2207
|
-
* #include <stdlib.h>
|
|
2208
|
-
* napi_value result;
|
|
2209
|
-
* static napi_value MyNapi(napi_env env, napi_callback_info info) {
|
|
2210
|
-
* int* raw = (int*) malloc(1024);
|
|
2211
|
-
* napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result);
|
|
2212
|
-
* if (status != napi_ok) {
|
|
2213
|
-
* napi_throw_error(env, NULL, "napi_create_external failed");
|
|
2214
|
-
* return NULL;
|
|
2215
|
-
* }
|
|
2216
|
-
* return result;
|
|
2217
|
-
* }
|
|
2218
|
-
* ...
|
|
2219
|
-
* DECLARE_NAPI_PROPERTY("myNapi", MyNapi)
|
|
2220
|
-
* ...
|
|
2221
|
-
* ```
|
|
2222
|
-
*
|
|
2223
|
-
* ```js
|
|
2224
|
-
* import native from 'napi_addon.node';
|
|
2225
|
-
* import { types } from 'node:util';
|
|
2226
|
-
*
|
|
2227
|
-
* const data = native.myNapi();
|
|
2228
|
-
* types.isExternal(data); // returns true
|
|
2229
|
-
* types.isExternal(0); // returns false
|
|
2230
|
-
* types.isExternal(new String('foo')); // returns false
|
|
2231
|
-
* ```
|
|
2232
|
-
*
|
|
2233
|
-
* For further information on `napi_create_external`, refer to
|
|
2234
|
-
* [`napi_create_external()`](https://nodejs.org/docs/latest-v22.x/api/n-api.html#napi_create_external).
|
|
2235
|
-
* @since v10.0.0
|
|
2236
|
-
*/
|
|
2237
|
-
function isExternal(object: unknown): boolean;
|
|
2238
|
-
/**
|
|
2239
|
-
* Returns `true` if the value is a built-in `Float16Array` instance.
|
|
2240
|
-
*
|
|
2241
|
-
* ```js
|
|
2242
|
-
* util.types.isFloat16Array(new ArrayBuffer()); // Returns false
|
|
2243
|
-
* util.types.isFloat16Array(new Float16Array()); // Returns true
|
|
2244
|
-
* util.types.isFloat16Array(new Float32Array()); // Returns false
|
|
2245
|
-
* ```
|
|
2246
|
-
* @since v22.16.0
|
|
2247
|
-
*/
|
|
2248
|
-
// This does NOT return a type predicate in v22.x.
|
|
2249
|
-
// The Float16Array feature does not yet exist in this version of Node.js.
|
|
2250
|
-
function isFloat16Array(object: unknown): boolean;
|
|
2251
|
-
/**
|
|
2252
|
-
* Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance.
|
|
2253
|
-
*
|
|
2254
|
-
* ```js
|
|
2255
|
-
* util.types.isFloat32Array(new ArrayBuffer()); // Returns false
|
|
2256
|
-
* util.types.isFloat32Array(new Float32Array()); // Returns true
|
|
2257
|
-
* util.types.isFloat32Array(new Float64Array()); // Returns false
|
|
2258
|
-
* ```
|
|
2259
|
-
* @since v10.0.0
|
|
2260
|
-
*/
|
|
2261
|
-
function isFloat32Array(object: unknown): object is Float32Array;
|
|
2262
|
-
/**
|
|
2263
|
-
* Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance.
|
|
2264
|
-
*
|
|
2265
|
-
* ```js
|
|
2266
|
-
* util.types.isFloat64Array(new ArrayBuffer()); // Returns false
|
|
2267
|
-
* util.types.isFloat64Array(new Uint8Array()); // Returns false
|
|
2268
|
-
* util.types.isFloat64Array(new Float64Array()); // Returns true
|
|
2269
|
-
* ```
|
|
2270
|
-
* @since v10.0.0
|
|
2271
|
-
*/
|
|
2272
|
-
function isFloat64Array(object: unknown): object is Float64Array;
|
|
2273
|
-
/**
|
|
2274
|
-
* Returns `true` if the value is a generator function.
|
|
2275
|
-
* This only reports back what the JavaScript engine is seeing;
|
|
2276
|
-
* in particular, the return value may not match the original source code if
|
|
2277
|
-
* a transpilation tool was used.
|
|
2278
|
-
*
|
|
2279
|
-
* ```js
|
|
2280
|
-
* util.types.isGeneratorFunction(function foo() {}); // Returns false
|
|
2281
|
-
* util.types.isGeneratorFunction(function* foo() {}); // Returns true
|
|
2282
|
-
* ```
|
|
2283
|
-
* @since v10.0.0
|
|
2284
|
-
*/
|
|
2285
|
-
function isGeneratorFunction(object: unknown): object is GeneratorFunction;
|
|
2286
|
-
/**
|
|
2287
|
-
* Returns `true` if the value is a generator object as returned from a
|
|
2288
|
-
* built-in generator function.
|
|
2289
|
-
* This only reports back what the JavaScript engine is seeing;
|
|
2290
|
-
* in particular, the return value may not match the original source code if
|
|
2291
|
-
* a transpilation tool was used.
|
|
2292
|
-
*
|
|
2293
|
-
* ```js
|
|
2294
|
-
* function* foo() {}
|
|
2295
|
-
* const generator = foo();
|
|
2296
|
-
* util.types.isGeneratorObject(generator); // Returns true
|
|
2297
|
-
* ```
|
|
2298
|
-
* @since v10.0.0
|
|
2299
|
-
*/
|
|
2300
|
-
function isGeneratorObject(object: unknown): object is Generator;
|
|
2301
|
-
/**
|
|
2302
|
-
* Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance.
|
|
2303
|
-
*
|
|
2304
|
-
* ```js
|
|
2305
|
-
* util.types.isInt8Array(new ArrayBuffer()); // Returns false
|
|
2306
|
-
* util.types.isInt8Array(new Int8Array()); // Returns true
|
|
2307
|
-
* util.types.isInt8Array(new Float64Array()); // Returns false
|
|
2308
|
-
* ```
|
|
2309
|
-
* @since v10.0.0
|
|
2310
|
-
*/
|
|
2311
|
-
function isInt8Array(object: unknown): object is Int8Array;
|
|
2312
|
-
/**
|
|
2313
|
-
* Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance.
|
|
2314
|
-
*
|
|
2315
|
-
* ```js
|
|
2316
|
-
* util.types.isInt16Array(new ArrayBuffer()); // Returns false
|
|
2317
|
-
* util.types.isInt16Array(new Int16Array()); // Returns true
|
|
2318
|
-
* util.types.isInt16Array(new Float64Array()); // Returns false
|
|
2319
|
-
* ```
|
|
2320
|
-
* @since v10.0.0
|
|
2321
|
-
*/
|
|
2322
|
-
function isInt16Array(object: unknown): object is Int16Array;
|
|
2323
|
-
/**
|
|
2324
|
-
* Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance.
|
|
2325
|
-
*
|
|
2326
|
-
* ```js
|
|
2327
|
-
* util.types.isInt32Array(new ArrayBuffer()); // Returns false
|
|
2328
|
-
* util.types.isInt32Array(new Int32Array()); // Returns true
|
|
2329
|
-
* util.types.isInt32Array(new Float64Array()); // Returns false
|
|
2330
|
-
* ```
|
|
2331
|
-
* @since v10.0.0
|
|
2332
|
-
*/
|
|
2333
|
-
function isInt32Array(object: unknown): object is Int32Array;
|
|
2334
|
-
/**
|
|
2335
|
-
* Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
|
|
2336
|
-
*
|
|
2337
|
-
* ```js
|
|
2338
|
-
* util.types.isMap(new Map()); // Returns true
|
|
2339
|
-
* ```
|
|
2340
|
-
* @since v10.0.0
|
|
2341
|
-
*/
|
|
2342
|
-
function isMap<T>(
|
|
2343
|
-
object: T | {},
|
|
2344
|
-
): object is T extends ReadonlyMap<any, any> ? (unknown extends T ? never : ReadonlyMap<any, any>)
|
|
2345
|
-
: Map<unknown, unknown>;
|
|
2346
|
-
/**
|
|
2347
|
-
* Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
|
|
2348
|
-
*
|
|
2349
|
-
* ```js
|
|
2350
|
-
* const map = new Map();
|
|
2351
|
-
* util.types.isMapIterator(map.keys()); // Returns true
|
|
2352
|
-
* util.types.isMapIterator(map.values()); // Returns true
|
|
2353
|
-
* util.types.isMapIterator(map.entries()); // Returns true
|
|
2354
|
-
* util.types.isMapIterator(map[Symbol.iterator]()); // Returns true
|
|
2355
|
-
* ```
|
|
2356
|
-
* @since v10.0.0
|
|
2357
|
-
*/
|
|
2358
|
-
function isMapIterator(object: unknown): boolean;
|
|
2359
|
-
/**
|
|
2360
|
-
* Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects).
|
|
2361
|
-
*
|
|
2362
|
-
* ```js
|
|
2363
|
-
* import * as ns from './a.js';
|
|
2364
|
-
*
|
|
2365
|
-
* util.types.isModuleNamespaceObject(ns); // Returns true
|
|
2366
|
-
* ```
|
|
2367
|
-
* @since v10.0.0
|
|
2368
|
-
*/
|
|
2369
|
-
function isModuleNamespaceObject(value: unknown): boolean;
|
|
2370
|
-
/**
|
|
2371
|
-
* Returns `true` if the value was returned by the constructor of a
|
|
2372
|
-
* [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects).
|
|
2373
|
-
*
|
|
2374
|
-
* ```js
|
|
2375
|
-
* console.log(util.types.isNativeError(new Error())); // true
|
|
2376
|
-
* console.log(util.types.isNativeError(new TypeError())); // true
|
|
2377
|
-
* console.log(util.types.isNativeError(new RangeError())); // true
|
|
2378
|
-
* ```
|
|
2379
|
-
*
|
|
2380
|
-
* Subclasses of the native error types are also native errors:
|
|
2381
|
-
*
|
|
2382
|
-
* ```js
|
|
2383
|
-
* class MyError extends Error {}
|
|
2384
|
-
* console.log(util.types.isNativeError(new MyError())); // true
|
|
2385
|
-
* ```
|
|
2386
|
-
*
|
|
2387
|
-
* A value being `instanceof` a native error class is not equivalent to `isNativeError()`
|
|
2388
|
-
* returning `true` for that value. `isNativeError()` returns `true` for errors
|
|
2389
|
-
* which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false`
|
|
2390
|
-
* for these errors:
|
|
2391
|
-
*
|
|
2392
|
-
* ```js
|
|
2393
|
-
* import { createContext, runInContext } from 'node:vm';
|
|
2394
|
-
* import { types } from 'node:util';
|
|
2395
|
-
*
|
|
2396
|
-
* const context = createContext({});
|
|
2397
|
-
* const myError = runInContext('new Error()', context);
|
|
2398
|
-
* console.log(types.isNativeError(myError)); // true
|
|
2399
|
-
* console.log(myError instanceof Error); // false
|
|
2400
|
-
* ```
|
|
2401
|
-
*
|
|
2402
|
-
* Conversely, `isNativeError()` returns `false` for all objects which were not
|
|
2403
|
-
* returned by the constructor of a native error. That includes values
|
|
2404
|
-
* which are `instanceof` native errors:
|
|
2405
|
-
*
|
|
2406
|
-
* ```js
|
|
2407
|
-
* const myError = { __proto__: Error.prototype };
|
|
2408
|
-
* console.log(util.types.isNativeError(myError)); // false
|
|
2409
|
-
* console.log(myError instanceof Error); // true
|
|
2410
|
-
* ```
|
|
2411
|
-
* @since v10.0.0
|
|
2412
|
-
*/
|
|
2413
|
-
function isNativeError(object: unknown): object is Error;
|
|
2414
|
-
/**
|
|
2415
|
-
* Returns `true` if the value is a number object, e.g. created
|
|
2416
|
-
* by `new Number()`.
|
|
2417
|
-
*
|
|
2418
|
-
* ```js
|
|
2419
|
-
* util.types.isNumberObject(0); // Returns false
|
|
2420
|
-
* util.types.isNumberObject(new Number(0)); // Returns true
|
|
2421
|
-
* ```
|
|
2422
|
-
* @since v10.0.0
|
|
2423
|
-
*/
|
|
2424
|
-
function isNumberObject(object: unknown): object is Number;
|
|
2425
|
-
/**
|
|
2426
|
-
* Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
|
|
2427
|
-
*
|
|
2428
|
-
* ```js
|
|
2429
|
-
* util.types.isPromise(Promise.resolve(42)); // Returns true
|
|
2430
|
-
* ```
|
|
2431
|
-
* @since v10.0.0
|
|
2432
|
-
*/
|
|
2433
|
-
function isPromise(object: unknown): object is Promise<unknown>;
|
|
2434
|
-
/**
|
|
2435
|
-
* Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance.
|
|
2436
|
-
*
|
|
2437
|
-
* ```js
|
|
2438
|
-
* const target = {};
|
|
2439
|
-
* const proxy = new Proxy(target, {});
|
|
2440
|
-
* util.types.isProxy(target); // Returns false
|
|
2441
|
-
* util.types.isProxy(proxy); // Returns true
|
|
2442
|
-
* ```
|
|
2443
|
-
* @since v10.0.0
|
|
2444
|
-
*/
|
|
2445
|
-
function isProxy(object: unknown): boolean;
|
|
2446
|
-
/**
|
|
2447
|
-
* Returns `true` if the value is a regular expression object.
|
|
2448
|
-
*
|
|
2449
|
-
* ```js
|
|
2450
|
-
* util.types.isRegExp(/abc/); // Returns true
|
|
2451
|
-
* util.types.isRegExp(new RegExp('abc')); // Returns true
|
|
2452
|
-
* ```
|
|
2453
|
-
* @since v10.0.0
|
|
2454
|
-
*/
|
|
2455
|
-
function isRegExp(object: unknown): object is RegExp;
|
|
2456
|
-
/**
|
|
2457
|
-
* Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
|
|
2458
|
-
*
|
|
2459
|
-
* ```js
|
|
2460
|
-
* util.types.isSet(new Set()); // Returns true
|
|
2461
|
-
* ```
|
|
2462
|
-
* @since v10.0.0
|
|
2463
|
-
*/
|
|
2464
|
-
function isSet<T>(
|
|
2465
|
-
object: T | {},
|
|
2466
|
-
): object is T extends ReadonlySet<any> ? (unknown extends T ? never : ReadonlySet<any>) : Set<unknown>;
|
|
2467
|
-
/**
|
|
2468
|
-
* Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
|
|
2469
|
-
*
|
|
2470
|
-
* ```js
|
|
2471
|
-
* const set = new Set();
|
|
2472
|
-
* util.types.isSetIterator(set.keys()); // Returns true
|
|
2473
|
-
* util.types.isSetIterator(set.values()); // Returns true
|
|
2474
|
-
* util.types.isSetIterator(set.entries()); // Returns true
|
|
2475
|
-
* util.types.isSetIterator(set[Symbol.iterator]()); // Returns true
|
|
2476
|
-
* ```
|
|
2477
|
-
* @since v10.0.0
|
|
2478
|
-
*/
|
|
2479
|
-
function isSetIterator(object: unknown): boolean;
|
|
2480
|
-
/**
|
|
2481
|
-
* Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
|
|
2482
|
-
* This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is
|
|
2483
|
-
* desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
|
|
2484
|
-
*
|
|
2485
|
-
* ```js
|
|
2486
|
-
* util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false
|
|
2487
|
-
* util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true
|
|
2488
|
-
* ```
|
|
2489
|
-
* @since v10.0.0
|
|
2490
|
-
*/
|
|
2491
|
-
function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer;
|
|
2492
|
-
/**
|
|
2493
|
-
* Returns `true` if the value is a string object, e.g. created
|
|
2494
|
-
* by `new String()`.
|
|
2495
|
-
*
|
|
2496
|
-
* ```js
|
|
2497
|
-
* util.types.isStringObject('foo'); // Returns false
|
|
2498
|
-
* util.types.isStringObject(new String('foo')); // Returns true
|
|
2499
|
-
* ```
|
|
2500
|
-
* @since v10.0.0
|
|
2501
|
-
*/
|
|
2502
|
-
function isStringObject(object: unknown): object is String;
|
|
2503
|
-
/**
|
|
2504
|
-
* Returns `true` if the value is a symbol object, created
|
|
2505
|
-
* by calling `Object()` on a `Symbol` primitive.
|
|
2506
|
-
*
|
|
2507
|
-
* ```js
|
|
2508
|
-
* const symbol = Symbol('foo');
|
|
2509
|
-
* util.types.isSymbolObject(symbol); // Returns false
|
|
2510
|
-
* util.types.isSymbolObject(Object(symbol)); // Returns true
|
|
2511
|
-
* ```
|
|
2512
|
-
* @since v10.0.0
|
|
2513
|
-
*/
|
|
2514
|
-
function isSymbolObject(object: unknown): object is Symbol;
|
|
2515
|
-
/**
|
|
2516
|
-
* Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance.
|
|
2517
|
-
*
|
|
2518
|
-
* ```js
|
|
2519
|
-
* util.types.isTypedArray(new ArrayBuffer()); // Returns false
|
|
2520
|
-
* util.types.isTypedArray(new Uint8Array()); // Returns true
|
|
2521
|
-
* util.types.isTypedArray(new Float64Array()); // Returns true
|
|
2522
|
-
* ```
|
|
2523
|
-
*
|
|
2524
|
-
* See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
|
|
2525
|
-
* @since v10.0.0
|
|
2526
|
-
*/
|
|
2527
|
-
function isTypedArray(object: unknown): object is NodeJS.TypedArray;
|
|
2528
|
-
/**
|
|
2529
|
-
* Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance.
|
|
2530
|
-
*
|
|
2531
|
-
* ```js
|
|
2532
|
-
* util.types.isUint8Array(new ArrayBuffer()); // Returns false
|
|
2533
|
-
* util.types.isUint8Array(new Uint8Array()); // Returns true
|
|
2534
|
-
* util.types.isUint8Array(new Float64Array()); // Returns false
|
|
2535
|
-
* ```
|
|
2536
|
-
* @since v10.0.0
|
|
2537
|
-
*/
|
|
2538
|
-
function isUint8Array(object: unknown): object is Uint8Array;
|
|
2539
|
-
/**
|
|
2540
|
-
* Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance.
|
|
2541
|
-
*
|
|
2542
|
-
* ```js
|
|
2543
|
-
* util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false
|
|
2544
|
-
* util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true
|
|
2545
|
-
* util.types.isUint8ClampedArray(new Float64Array()); // Returns false
|
|
2546
|
-
* ```
|
|
2547
|
-
* @since v10.0.0
|
|
2548
|
-
*/
|
|
2549
|
-
function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray;
|
|
2550
|
-
/**
|
|
2551
|
-
* Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance.
|
|
2552
|
-
*
|
|
2553
|
-
* ```js
|
|
2554
|
-
* util.types.isUint16Array(new ArrayBuffer()); // Returns false
|
|
2555
|
-
* util.types.isUint16Array(new Uint16Array()); // Returns true
|
|
2556
|
-
* util.types.isUint16Array(new Float64Array()); // Returns false
|
|
2557
|
-
* ```
|
|
2558
|
-
* @since v10.0.0
|
|
2559
|
-
*/
|
|
2560
|
-
function isUint16Array(object: unknown): object is Uint16Array;
|
|
2561
|
-
/**
|
|
2562
|
-
* Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance.
|
|
2563
|
-
*
|
|
2564
|
-
* ```js
|
|
2565
|
-
* util.types.isUint32Array(new ArrayBuffer()); // Returns false
|
|
2566
|
-
* util.types.isUint32Array(new Uint32Array()); // Returns true
|
|
2567
|
-
* util.types.isUint32Array(new Float64Array()); // Returns false
|
|
2568
|
-
* ```
|
|
2569
|
-
* @since v10.0.0
|
|
2570
|
-
*/
|
|
2571
|
-
function isUint32Array(object: unknown): object is Uint32Array;
|
|
2572
|
-
/**
|
|
2573
|
-
* Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance.
|
|
2574
|
-
*
|
|
2575
|
-
* ```js
|
|
2576
|
-
* util.types.isWeakMap(new WeakMap()); // Returns true
|
|
2577
|
-
* ```
|
|
2578
|
-
* @since v10.0.0
|
|
2579
|
-
*/
|
|
2580
|
-
function isWeakMap(object: unknown): object is WeakMap<object, unknown>;
|
|
2581
|
-
/**
|
|
2582
|
-
* Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance.
|
|
2583
|
-
*
|
|
2584
|
-
* ```js
|
|
2585
|
-
* util.types.isWeakSet(new WeakSet()); // Returns true
|
|
2586
|
-
* ```
|
|
2587
|
-
* @since v10.0.0
|
|
2588
|
-
*/
|
|
2589
|
-
function isWeakSet(object: unknown): object is WeakSet<object>;
|
|
2590
|
-
/**
|
|
2591
|
-
* Returns `true` if `value` is a `KeyObject`, `false` otherwise.
|
|
2592
|
-
* @since v16.2.0
|
|
2593
|
-
*/
|
|
2594
|
-
function isKeyObject(object: unknown): object is KeyObject;
|
|
2595
|
-
/**
|
|
2596
|
-
* Returns `true` if `value` is a `CryptoKey`, `false` otherwise.
|
|
2597
|
-
* @since v16.2.0
|
|
2598
|
-
*/
|
|
2599
|
-
function isCryptoKey(object: unknown): object is webcrypto.CryptoKey;
|
|
2600
|
-
}
|
|
2601
|
-
declare module "node:util" {
|
|
2602
|
-
export * from "util";
|
|
2603
|
-
}
|
|
2604
|
-
declare module "node:util/types" {
|
|
2605
|
-
export * from "util/types";
|
|
1675
|
+
declare module "util" {
|
|
1676
|
+
export * from "node:util";
|
|
2606
1677
|
}
|