node-red-contrib-tak-registration 0.14.1 → 0.16.0
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/README.md +1 -1
- package/node_modules/@types/geojson/README.md +1 -1
- package/node_modules/@types/geojson/index.d.ts +36 -2
- package/node_modules/@types/geojson/package.json +2 -2
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert.d.ts +14 -0
- package/node_modules/@types/node/async_hooks.d.ts +64 -2
- package/node_modules/@types/node/buffer.buffer.d.ts +117 -39
- package/node_modules/@types/node/buffer.d.ts +6 -13
- package/node_modules/@types/node/cluster.d.ts +1 -1
- package/node_modules/@types/node/constants.d.ts +14 -12
- package/node_modules/@types/node/crypto.d.ts +44 -10
- package/node_modules/@types/node/dgram.d.ts +10 -7
- package/node_modules/@types/node/diagnostics_channel.d.ts +20 -1
- package/node_modules/@types/node/fs/promises.d.ts +23 -26
- package/node_modules/@types/node/fs.d.ts +166 -125
- package/node_modules/@types/node/globals.d.ts +141 -338
- package/node_modules/@types/node/http.d.ts +25 -3
- package/node_modules/@types/node/http2.d.ts +3 -4
- package/node_modules/@types/node/https.d.ts +3 -1
- package/node_modules/@types/node/inspector.d.ts +36 -0
- package/node_modules/@types/node/module.d.ts +599 -236
- package/node_modules/@types/node/net.d.ts +44 -13
- package/node_modules/@types/node/package.json +9 -4
- package/node_modules/@types/node/perf_hooks.d.ts +5 -0
- package/node_modules/@types/node/process.d.ts +69 -2
- package/node_modules/@types/node/querystring.d.ts +2 -3
- package/node_modules/@types/node/readline.d.ts +6 -1
- package/node_modules/@types/node/sea.d.ts +1 -1
- package/node_modules/@types/node/sqlite.d.ts +291 -17
- package/node_modules/@types/node/stream/consumers.d.ts +32 -6
- package/node_modules/@types/node/stream/web.d.ts +9 -4
- package/node_modules/@types/node/stream.d.ts +936 -1000
- package/node_modules/@types/node/test.d.ts +169 -137
- package/node_modules/@types/node/timers/promises.d.ts +24 -13
- package/node_modules/@types/node/timers.d.ts +159 -112
- package/node_modules/@types/node/tls.d.ts +34 -1
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +110 -35
- package/node_modules/@types/node/util.d.ts +323 -110
- package/node_modules/@types/node/v8.d.ts +81 -0
- package/node_modules/@types/node/vm.d.ts +21 -6
- package/node_modules/@types/node/worker_threads.d.ts +1 -0
- package/node_modules/@types/node/zlib.d.ts +167 -36
- package/node_modules/axios/CHANGELOG.md +165 -0
- package/node_modules/axios/README.md +55 -33
- package/node_modules/axios/dist/axios.js +85 -43
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +92 -47
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +92 -47
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +123 -51
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +17 -5
- package/node_modules/axios/index.d.ts +6 -3
- package/node_modules/axios/lib/adapters/fetch.js +2 -2
- package/node_modules/axios/lib/adapters/http.js +1 -1
- package/node_modules/axios/lib/core/Axios.js +13 -4
- package/node_modules/axios/lib/core/AxiosHeaders.js +15 -3
- package/node_modules/axios/lib/core/buildFullPath.js +3 -2
- package/node_modules/axios/lib/core/mergeConfig.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/formDataToStream.js +4 -3
- package/node_modules/axios/lib/helpers/resolveConfig.js +1 -1
- package/node_modules/axios/lib/helpers/throttle.js +1 -1
- package/node_modules/axios/lib/helpers/toFormData.js +4 -0
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +4 -3
- package/node_modules/axios/lib/platform/node/index.js +26 -0
- package/node_modules/axios/lib/utils.js +48 -28
- package/node_modules/axios/package.json +14 -5
- package/node_modules/bignumber.js/CHANGELOG.md +82 -1
- package/node_modules/bignumber.js/LICENCE.md +1 -1
- package/node_modules/bignumber.js/README.md +6 -4
- package/node_modules/bignumber.js/bignumber.d.mts +6 -0
- package/node_modules/bignumber.js/bignumber.d.ts +3 -1829
- package/node_modules/bignumber.js/bignumber.js +3 -3
- package/node_modules/bignumber.js/bignumber.mjs +3 -3
- package/node_modules/bignumber.js/package.json +17 -7
- package/node_modules/bignumber.js/types.d.ts +1821 -0
- package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/node_modules/dunder-proto/.eslintrc +5 -0
- package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/node_modules/dunder-proto/.nycrc +13 -0
- package/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/node_modules/dunder-proto/LICENSE +21 -0
- package/node_modules/dunder-proto/README.md +54 -0
- package/node_modules/dunder-proto/get.d.ts +5 -0
- package/node_modules/dunder-proto/get.js +30 -0
- package/node_modules/dunder-proto/package.json +76 -0
- package/node_modules/dunder-proto/set.d.ts +5 -0
- package/node_modules/dunder-proto/set.js +35 -0
- package/node_modules/dunder-proto/test/get.js +34 -0
- package/node_modules/dunder-proto/test/index.js +4 -0
- package/node_modules/dunder-proto/test/set.js +50 -0
- package/node_modules/dunder-proto/tsconfig.json +9 -0
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/node_modules/es-define-property/LICENSE +21 -0
- package/node_modules/es-define-property/README.md +49 -0
- package/node_modules/es-define-property/index.d.ts +3 -0
- package/node_modules/es-define-property/index.js +14 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/test/index.js +56 -0
- package/node_modules/es-define-property/tsconfig.json +10 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/CHANGELOG.md +40 -0
- package/node_modules/es-errors/LICENSE +21 -0
- package/node_modules/es-errors/README.md +55 -0
- package/node_modules/es-errors/eval.d.ts +3 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.d.ts +3 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.d.ts +3 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.d.ts +3 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.d.ts +3 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/test/index.js +19 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.d.ts +3 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.d.ts +3 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/es-object-atoms/.eslintrc +16 -0
- package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/node_modules/es-object-atoms/CHANGELOG.md +37 -0
- package/node_modules/es-object-atoms/LICENSE +21 -0
- package/node_modules/es-object-atoms/README.md +63 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/node_modules/es-object-atoms/ToObject.js +10 -0
- package/node_modules/es-object-atoms/index.d.ts +3 -0
- package/node_modules/es-object-atoms/index.js +4 -0
- package/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/node_modules/es-object-atoms/isObject.js +6 -0
- package/node_modules/es-object-atoms/package.json +80 -0
- package/node_modules/es-object-atoms/test/index.js +38 -0
- package/node_modules/es-object-atoms/tsconfig.json +6 -0
- package/node_modules/es-set-tostringtag/.eslintrc +13 -0
- package/node_modules/es-set-tostringtag/.nycrc +9 -0
- package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
- package/node_modules/es-set-tostringtag/LICENSE +21 -0
- package/node_modules/es-set-tostringtag/README.md +53 -0
- package/node_modules/es-set-tostringtag/index.d.ts +10 -0
- package/node_modules/es-set-tostringtag/index.js +35 -0
- package/node_modules/es-set-tostringtag/package.json +78 -0
- package/node_modules/es-set-tostringtag/test/index.js +85 -0
- package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
- package/node_modules/fast-xml-parser/CHANGELOG.md +70 -0
- package/node_modules/fast-xml-parser/README.md +37 -51
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +458 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- package/node_modules/fast-xml-parser/package.json +36 -19
- package/node_modules/fast-xml-parser/src/cli/cli.js +16 -12
- package/node_modules/fast-xml-parser/src/cli/man.js +6 -1
- package/node_modules/fast-xml-parser/src/cli/read.js +30 -79
- package/node_modules/fast-xml-parser/src/fxp.d.ts +33 -6
- package/node_modules/fast-xml-parser/src/fxp.js +11 -8
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +2 -4
- package/node_modules/fast-xml-parser/src/util.js +14 -18
- package/node_modules/fast-xml-parser/src/{v5 → v6}/CharsSymbol.js +1 -1
- package/node_modules/fast-xml-parser/src/{v5 → v6}/EntitiesParser.js +3 -6
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OptionsBuilder.js +3 -6
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/BaseOutputBuilder.js +1 -3
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsArrBuilder.js +3 -3
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsMinArrBuilder.js +3 -5
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsObjBuilder.js +3 -5
- package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/ParserOptionsBuilder.js +6 -11
- package/node_modules/fast-xml-parser/src/{v5 → v6}/TagPath.js +1 -1
- package/node_modules/fast-xml-parser/src/{v5 → v6}/TagPathMatcher.js +3 -5
- package/node_modules/fast-xml-parser/src/{v5 → v6}/XMLParser.js +3 -5
- package/node_modules/fast-xml-parser/src/{v5 → v6}/Xml2JsParser.js +8 -10
- package/node_modules/fast-xml-parser/src/{v5 → v6}/XmlPartReader.js +4 -10
- package/node_modules/fast-xml-parser/src/{v5 → v6}/XmlSpecialTagsReader.js +5 -12
- package/node_modules/fast-xml-parser/src/{v5 → v6}/inputSource/BufferSource.js +1 -3
- package/node_modules/fast-xml-parser/src/{v5 → v6}/inputSource/StringSource.js +1 -3
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/EntitiesParser.js +3 -5
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/booleanParser.js +1 -2
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/booleanParserExt.js +1 -2
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/currency.js +1 -3
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/join.js +1 -2
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/number.js +2 -4
- package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/trim.js +1 -3
- package/node_modules/fast-xml-parser/src/validator.js +5 -5
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +5 -4
- package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +1 -2
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +287 -71
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +3 -5
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +23 -23
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +21 -8
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +8 -2
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +22 -7
- package/node_modules/form-data/CHANGELOG.md +601 -0
- package/node_modules/form-data/{Readme.md → README.md} +34 -37
- package/node_modules/form-data/lib/browser.js +3 -1
- package/node_modules/form-data/lib/form_data.js +140 -147
- package/node_modules/form-data/lib/populate.js +5 -5
- package/node_modules/form-data/package.json +34 -23
- package/node_modules/function-bind/.eslintrc +21 -0
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/LICENSE +20 -0
- package/node_modules/function-bind/README.md +46 -0
- package/node_modules/function-bind/implementation.js +84 -0
- package/node_modules/function-bind/index.js +5 -0
- package/node_modules/function-bind/package.json +87 -0
- package/node_modules/function-bind/test/.eslintrc +9 -0
- package/node_modules/function-bind/test/index.js +252 -0
- package/node_modules/get-intrinsic/.eslintrc +42 -0
- package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/node_modules/get-intrinsic/.nycrc +9 -0
- package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/node_modules/get-intrinsic/LICENSE +21 -0
- package/node_modules/get-intrinsic/README.md +71 -0
- package/node_modules/get-intrinsic/index.js +378 -0
- package/node_modules/get-intrinsic/package.json +97 -0
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/node_modules/get-proto/.eslintrc +10 -0
- package/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/node_modules/get-proto/.nycrc +9 -0
- package/node_modules/get-proto/CHANGELOG.md +21 -0
- package/node_modules/get-proto/LICENSE +21 -0
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/node_modules/get-proto/README.md +50 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/node_modules/get-proto/index.d.ts +5 -0
- package/node_modules/get-proto/index.js +27 -0
- package/node_modules/get-proto/package.json +81 -0
- package/node_modules/get-proto/test/index.js +68 -0
- package/node_modules/get-proto/tsconfig.json +9 -0
- package/node_modules/gopd/.eslintrc +16 -0
- package/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/node_modules/gopd/CHANGELOG.md +45 -0
- package/node_modules/gopd/LICENSE +21 -0
- package/node_modules/gopd/README.md +40 -0
- package/node_modules/gopd/gOPD.d.ts +1 -0
- package/node_modules/gopd/gOPD.js +4 -0
- package/node_modules/gopd/index.d.ts +5 -0
- package/node_modules/gopd/index.js +15 -0
- package/node_modules/gopd/package.json +77 -0
- package/node_modules/gopd/test/index.js +36 -0
- package/node_modules/gopd/tsconfig.json +9 -0
- package/node_modules/has-symbols/.eslintrc +11 -0
- package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/node_modules/has-symbols/.nycrc +9 -0
- package/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/node_modules/has-symbols/LICENSE +21 -0
- package/node_modules/has-symbols/README.md +46 -0
- package/node_modules/has-symbols/index.d.ts +3 -0
- package/node_modules/has-symbols/index.js +14 -0
- package/node_modules/has-symbols/package.json +111 -0
- package/node_modules/has-symbols/shams.d.ts +3 -0
- package/node_modules/has-symbols/shams.js +45 -0
- package/node_modules/has-symbols/test/index.js +22 -0
- package/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/node_modules/has-symbols/test/tests.js +58 -0
- package/node_modules/has-symbols/tsconfig.json +10 -0
- package/node_modules/has-tostringtag/.eslintrc +5 -0
- package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/node_modules/has-tostringtag/.nycrc +13 -0
- package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
- package/node_modules/has-tostringtag/LICENSE +21 -0
- package/node_modules/has-tostringtag/README.md +46 -0
- package/node_modules/has-tostringtag/index.d.ts +3 -0
- package/node_modules/has-tostringtag/index.js +8 -0
- package/node_modules/has-tostringtag/package.json +108 -0
- package/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/node_modules/has-tostringtag/shams.js +8 -0
- package/node_modules/has-tostringtag/test/index.js +21 -0
- package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
- package/node_modules/has-tostringtag/test/tests.js +15 -0
- package/node_modules/has-tostringtag/tsconfig.json +49 -0
- package/node_modules/hasown/.eslintrc +5 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +40 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +92 -0
- package/node_modules/hasown/tsconfig.json +6 -0
- package/node_modules/long/README.md +93 -87
- package/node_modules/long/index.d.ts +2 -2
- package/node_modules/long/index.js +360 -246
- package/node_modules/long/package.json +12 -4
- package/node_modules/long/types.d.ts +474 -0
- package/node_modules/long/umd/index.d.ts +2 -456
- package/node_modules/long/umd/index.js +1585 -1395
- package/node_modules/long/umd/types.d.ts +474 -0
- package/node_modules/math-intrinsics/.eslintrc +16 -0
- package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/node_modules/math-intrinsics/LICENSE +21 -0
- package/node_modules/math-intrinsics/README.md +50 -0
- package/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/node_modules/math-intrinsics/abs.js +4 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/node_modules/math-intrinsics/floor.js +4 -0
- package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/node_modules/math-intrinsics/isFinite.js +12 -0
- package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/isInteger.js +16 -0
- package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/node_modules/math-intrinsics/isNaN.js +6 -0
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/node_modules/math-intrinsics/max.d.ts +1 -0
- package/node_modules/math-intrinsics/max.js +4 -0
- package/node_modules/math-intrinsics/min.d.ts +1 -0
- package/node_modules/math-intrinsics/min.js +4 -0
- package/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/node_modules/math-intrinsics/mod.js +9 -0
- package/node_modules/math-intrinsics/package.json +86 -0
- package/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/node_modules/math-intrinsics/pow.js +4 -0
- package/node_modules/math-intrinsics/round.d.ts +1 -0
- package/node_modules/math-intrinsics/round.js +4 -0
- package/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/node_modules/math-intrinsics/sign.js +11 -0
- package/node_modules/math-intrinsics/test/index.js +192 -0
- package/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/node_modules/protobufjs/dist/light/protobuf.js +532 -80
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.js +672 -144
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/ext/descriptor/index.js +179 -69
- package/node_modules/protobufjs/google/protobuf/descriptor.json +659 -16
- package/node_modules/protobufjs/google/protobuf/descriptor.proto +254 -6
- package/node_modules/protobufjs/index.d.ts +71 -13
- package/node_modules/protobufjs/package.json +4 -2
- package/node_modules/protobufjs/src/decoder.js +8 -10
- package/node_modules/protobufjs/src/encoder.js +1 -1
- package/node_modules/protobufjs/src/enum.js +25 -0
- package/node_modules/protobufjs/src/field.js +104 -28
- package/node_modules/protobufjs/src/namespace.js +126 -13
- package/node_modules/protobufjs/src/object.js +139 -4
- package/node_modules/protobufjs/src/oneof.js +19 -0
- package/node_modules/protobufjs/src/parse.js +139 -63
- package/node_modules/protobufjs/src/root.js +51 -15
- package/node_modules/protobufjs/src/service.js +23 -1
- package/node_modules/protobufjs/src/type.js +29 -4
- package/node_modules/protobufjs/src/util.js +4 -1
- package/node_modules/strnum/.github/SECURITY.md +5 -0
- package/node_modules/strnum/CHANGELOG.md +33 -0
- package/node_modules/strnum/README.md +14 -3
- package/node_modules/strnum/algo.stflow +84 -0
- package/node_modules/strnum/package.json +9 -2
- package/node_modules/strnum/strnum.js +72 -67
- package/node_modules/strnum/strnum.test.js +29 -6
- package/node_modules/strnum/test.js +9 -0
- package/node_modules/undici-types/dispatcher.d.ts +1 -0
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/readable.d.ts +5 -0
- package/node_modules/undici-types/webidl.d.ts +6 -0
- package/node_modules/uuid/README.md +12 -12
- package/node_modules/uuid/dist/cjs/types.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v1.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v1.js +1 -1
- package/node_modules/uuid/dist/cjs/v3.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v35.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v4.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v5.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v6.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v7.d.ts +1 -1
- package/node_modules/uuid/dist/cjs/v7.js +1 -1
- package/node_modules/uuid/dist/cjs-browser/types.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v1.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v1.js +1 -1
- package/node_modules/uuid/dist/cjs-browser/v3.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v35.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v4.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v5.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v6.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v7.d.ts +1 -1
- package/node_modules/uuid/dist/cjs-browser/v7.js +1 -1
- package/node_modules/uuid/dist/esm/types.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v1.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v1.js +1 -1
- package/node_modules/uuid/dist/esm/v3.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v35.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v4.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v5.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v6.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v7.d.ts +1 -1
- package/node_modules/uuid/dist/esm/v7.js +1 -1
- package/node_modules/uuid/dist/esm-browser/types.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v1.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v1.js +1 -1
- package/node_modules/uuid/dist/esm-browser/v3.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v35.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v4.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v5.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v6.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v7.d.ts +1 -1
- package/node_modules/uuid/dist/esm-browser/v7.js +1 -1
- package/node_modules/uuid/package.json +1 -1
- package/package.json +7 -7
- package/tak-registration.html +4 -4
- package/tak-registration.js +19 -10
- package/node_modules/axios/SECURITY.md +0 -6
- /package/node_modules/fast-xml-parser/src/{v5 → v6}/Report.js +0 -0
|
@@ -108,16 +108,22 @@ declare module "util" {
|
|
|
108
108
|
export interface InspectOptionsStylized extends InspectOptions {
|
|
109
109
|
stylize(text: string, styleType: Style): string;
|
|
110
110
|
}
|
|
111
|
-
export interface
|
|
111
|
+
export interface CallSiteObject {
|
|
112
112
|
/**
|
|
113
|
-
* Returns the name of the function associated with this
|
|
113
|
+
* Returns the name of the function associated with this call site.
|
|
114
114
|
*/
|
|
115
115
|
functionName: string;
|
|
116
116
|
/**
|
|
117
117
|
* Returns the name of the resource that contains the script for the
|
|
118
|
-
* function for this
|
|
118
|
+
* function for this call site.
|
|
119
119
|
*/
|
|
120
120
|
scriptName: string;
|
|
121
|
+
/**
|
|
122
|
+
* Returns the unique id of the script, as in Chrome DevTools protocol
|
|
123
|
+
* [`Runtime.ScriptId`](https://chromedevtools.github.io/devtools-protocol/1-3/Runtime/#type-ScriptId).
|
|
124
|
+
* @since v22.14.0
|
|
125
|
+
*/
|
|
126
|
+
scriptId: string;
|
|
121
127
|
/**
|
|
122
128
|
* Returns the number, 1-based, of the line for the associate function call.
|
|
123
129
|
*/
|
|
@@ -125,8 +131,60 @@ declare module "util" {
|
|
|
125
131
|
/**
|
|
126
132
|
* Returns the 1-based column offset on the line for the associated function call.
|
|
127
133
|
*/
|
|
128
|
-
|
|
134
|
+
columnNumber: number;
|
|
129
135
|
}
|
|
136
|
+
export type DiffEntry = [operation: -1 | 0 | 1, value: string];
|
|
137
|
+
/**
|
|
138
|
+
* `util.diff()` compares two string or array values and returns an array of difference entries.
|
|
139
|
+
* It uses the Myers diff algorithm to compute minimal differences, which is the same algorithm
|
|
140
|
+
* used internally by assertion error messages.
|
|
141
|
+
*
|
|
142
|
+
* If the values are equal, an empty array is returned.
|
|
143
|
+
*
|
|
144
|
+
* ```js
|
|
145
|
+
* const { diff } = require('node:util');
|
|
146
|
+
*
|
|
147
|
+
* // Comparing strings
|
|
148
|
+
* const actualString = '12345678';
|
|
149
|
+
* const expectedString = '12!!5!7!';
|
|
150
|
+
* console.log(diff(actualString, expectedString));
|
|
151
|
+
* // [
|
|
152
|
+
* // [0, '1'],
|
|
153
|
+
* // [0, '2'],
|
|
154
|
+
* // [1, '3'],
|
|
155
|
+
* // [1, '4'],
|
|
156
|
+
* // [-1, '!'],
|
|
157
|
+
* // [-1, '!'],
|
|
158
|
+
* // [0, '5'],
|
|
159
|
+
* // [1, '6'],
|
|
160
|
+
* // [-1, '!'],
|
|
161
|
+
* // [0, '7'],
|
|
162
|
+
* // [1, '8'],
|
|
163
|
+
* // [-1, '!'],
|
|
164
|
+
* // ]
|
|
165
|
+
* // Comparing arrays
|
|
166
|
+
* const actualArray = ['1', '2', '3'];
|
|
167
|
+
* const expectedArray = ['1', '3', '4'];
|
|
168
|
+
* console.log(diff(actualArray, expectedArray));
|
|
169
|
+
* // [
|
|
170
|
+
* // [0, '1'],
|
|
171
|
+
* // [1, '2'],
|
|
172
|
+
* // [0, '3'],
|
|
173
|
+
* // [-1, '4'],
|
|
174
|
+
* // ]
|
|
175
|
+
* // Equal values return empty array
|
|
176
|
+
* console.log(diff('same', 'same'));
|
|
177
|
+
* // []
|
|
178
|
+
* ```
|
|
179
|
+
* @since v22.15.0
|
|
180
|
+
* @experimental
|
|
181
|
+
* @param actual The first value to compare
|
|
182
|
+
* @param expected The second value to compare
|
|
183
|
+
* @returns An array of difference entries. Each entry is an array with two elements:
|
|
184
|
+
* * Index 0: `number` Operation code: `-1` for delete, `0` for no-op/unchanged, `1` for insert
|
|
185
|
+
* * Index 1: `string` The value associated with the operation
|
|
186
|
+
*/
|
|
187
|
+
export function diff(actual: string | readonly string[], expected: string | readonly string[]): DiffEntry[];
|
|
130
188
|
/**
|
|
131
189
|
* The `util.format()` method returns a formatted string using the first argument
|
|
132
190
|
* as a `printf`-like format string which can contain zero or more format
|
|
@@ -185,15 +243,22 @@ declare module "util" {
|
|
|
185
243
|
* @since v10.0.0
|
|
186
244
|
*/
|
|
187
245
|
export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
|
|
246
|
+
interface GetCallSitesOptions {
|
|
247
|
+
/**
|
|
248
|
+
* Reconstruct the original location in the stacktrace from the source-map.
|
|
249
|
+
* Enabled by default with the flag `--enable-source-maps`.
|
|
250
|
+
*/
|
|
251
|
+
sourceMap?: boolean | undefined;
|
|
252
|
+
}
|
|
188
253
|
/**
|
|
189
|
-
* Returns an array of
|
|
254
|
+
* Returns an array of call site objects containing the stack of
|
|
190
255
|
* the caller function.
|
|
191
256
|
*
|
|
192
257
|
* ```js
|
|
193
|
-
*
|
|
258
|
+
* import { getCallSites } from 'node:util';
|
|
194
259
|
*
|
|
195
260
|
* function exampleFunction() {
|
|
196
|
-
* const callSites =
|
|
261
|
+
* const callSites = getCallSites();
|
|
197
262
|
*
|
|
198
263
|
* console.log('Call Sites:');
|
|
199
264
|
* callSites.forEach((callSite, index) => {
|
|
@@ -225,12 +290,40 @@ declare module "util" {
|
|
|
225
290
|
*
|
|
226
291
|
* anotherFunction();
|
|
227
292
|
* ```
|
|
228
|
-
*
|
|
293
|
+
*
|
|
294
|
+
* It is possible to reconstruct the original locations by setting the option `sourceMap` to `true`.
|
|
295
|
+
* 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, for example when using `--experimental-transform-types`,
|
|
297
|
+
* `sourceMap` will be true by default.
|
|
298
|
+
*
|
|
299
|
+
* ```ts
|
|
300
|
+
* import { getCallSites } from 'node:util';
|
|
301
|
+
*
|
|
302
|
+
* interface Foo {
|
|
303
|
+
* foo: string;
|
|
304
|
+
* }
|
|
305
|
+
*
|
|
306
|
+
* const callSites = getCallSites({ sourceMap: true });
|
|
307
|
+
*
|
|
308
|
+
* // With sourceMap:
|
|
309
|
+
* // Function Name: ''
|
|
310
|
+
* // Script Name: example.js
|
|
311
|
+
* // Line Number: 7
|
|
312
|
+
* // Column Number: 26
|
|
313
|
+
*
|
|
314
|
+
* // Without sourceMap:
|
|
315
|
+
* // Function Name: ''
|
|
316
|
+
* // Script Name: example.js
|
|
317
|
+
* // Line Number: 2
|
|
318
|
+
* // Column Number: 26
|
|
319
|
+
* ```
|
|
320
|
+
* @param frameCount Number of frames to capture as call site objects.
|
|
229
321
|
* **Default:** `10`. Allowable range is between 1 and 200.
|
|
230
|
-
* @return An array of
|
|
322
|
+
* @return An array of call site objects
|
|
231
323
|
* @since v22.9.0
|
|
232
324
|
*/
|
|
233
|
-
export function
|
|
325
|
+
export function getCallSites(frameCount?: number, options?: GetCallSitesOptions): CallSiteObject[];
|
|
326
|
+
export function getCallSites(options: GetCallSitesOptions): CallSiteObject[];
|
|
234
327
|
/**
|
|
235
328
|
* Returns the string name for a numeric error code that comes from a Node.js API.
|
|
236
329
|
* The mapping between error codes and error names is platform-dependent.
|
|
@@ -260,6 +353,20 @@ declare module "util" {
|
|
|
260
353
|
* @since v16.0.0, v14.17.0
|
|
261
354
|
*/
|
|
262
355
|
export function getSystemErrorMap(): Map<number, [string, string]>;
|
|
356
|
+
/**
|
|
357
|
+
* Returns the string message for a numeric error code that comes from a Node.js
|
|
358
|
+
* API.
|
|
359
|
+
* The mapping between error codes and string messages is platform-dependent.
|
|
360
|
+
*
|
|
361
|
+
* ```js
|
|
362
|
+
* fs.access('file/that/does/not/exist', (err) => {
|
|
363
|
+
* const message = util.getSystemErrorMessage(err.errno);
|
|
364
|
+
* console.error(message); // no such file or directory
|
|
365
|
+
* });
|
|
366
|
+
* ```
|
|
367
|
+
* @since v22.12.0
|
|
368
|
+
*/
|
|
369
|
+
export function getSystemErrorMessage(err: number): string;
|
|
263
370
|
/**
|
|
264
371
|
* The `util.log()` method prints the given `string` to `stdout` with an included
|
|
265
372
|
* timestamp.
|
|
@@ -284,7 +391,6 @@ declare module "util" {
|
|
|
284
391
|
* Creates and returns an `AbortController` instance whose `AbortSignal` is marked
|
|
285
392
|
* as transferable and can be used with `structuredClone()` or `postMessage()`.
|
|
286
393
|
* @since v18.11.0
|
|
287
|
-
* @experimental
|
|
288
394
|
* @returns A transferable AbortController
|
|
289
395
|
*/
|
|
290
396
|
export function transferableAbortController(): AbortController;
|
|
@@ -297,40 +403,49 @@ declare module "util" {
|
|
|
297
403
|
* channel.port2.postMessage(signal, [signal]);
|
|
298
404
|
* ```
|
|
299
405
|
* @since v18.11.0
|
|
300
|
-
* @experimental
|
|
301
406
|
* @param signal The AbortSignal
|
|
302
407
|
* @returns The same AbortSignal
|
|
303
408
|
*/
|
|
304
409
|
export function transferableAbortSignal(signal: AbortSignal): AbortSignal;
|
|
305
410
|
/**
|
|
306
|
-
* Listens to abort event on the provided `signal` and
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
411
|
+
* Listens to abort event on the provided `signal` and returns a promise that resolves when the `signal` is aborted.
|
|
412
|
+
* If `resource` is provided, it weakly references the operation's associated object,
|
|
413
|
+
* so if `resource` is garbage collected before the `signal` aborts,
|
|
414
|
+
* then returned promise shall remain pending.
|
|
415
|
+
* This prevents memory leaks in long-running or non-cancelable operations.
|
|
310
416
|
*
|
|
311
417
|
* ```js
|
|
312
418
|
* import { aborted } from 'node:util';
|
|
313
419
|
*
|
|
420
|
+
* // Obtain an object with an abortable signal, like a custom resource or operation.
|
|
314
421
|
* const dependent = obtainSomethingAbortable();
|
|
315
422
|
*
|
|
423
|
+
* // Pass `dependent` as the resource, indicating the promise should only resolve
|
|
424
|
+
* // if `dependent` is still in memory when the signal is aborted.
|
|
316
425
|
* aborted(dependent.signal, dependent).then(() => {
|
|
317
|
-
* //
|
|
426
|
+
* // This code runs when `dependent` is aborted.
|
|
427
|
+
* console.log('Dependent resource was aborted.');
|
|
318
428
|
* });
|
|
319
429
|
*
|
|
430
|
+
* // Simulate an event that triggers the abort.
|
|
320
431
|
* dependent.on('event', () => {
|
|
321
|
-
* dependent.abort();
|
|
432
|
+
* dependent.abort(); // This will cause the `aborted` promise to resolve.
|
|
322
433
|
* });
|
|
323
434
|
* ```
|
|
324
435
|
* @since v19.7.0
|
|
325
436
|
* @experimental
|
|
326
|
-
* @param resource Any non-null
|
|
437
|
+
* @param resource Any non-null object tied to the abortable operation and held weakly.
|
|
438
|
+
* If `resource` is garbage collected before the `signal` aborts, the promise remains pending,
|
|
439
|
+
* allowing Node.js to stop tracking it.
|
|
440
|
+
* This helps prevent memory leaks in long-running or non-cancelable operations.
|
|
327
441
|
*/
|
|
328
442
|
export function aborted(signal: AbortSignal, resource: any): Promise<void>;
|
|
329
443
|
/**
|
|
330
444
|
* The `util.inspect()` method returns a string representation of `object` that is
|
|
331
445
|
* intended for debugging. The output of `util.inspect` may change at any time
|
|
332
446
|
* and should not be depended upon programmatically. Additional `options` may be
|
|
333
|
-
* passed that alter the result.
|
|
447
|
+
* passed that alter the result.
|
|
448
|
+
* `util.inspect()` will use the constructor's name and/or `@@toStringTag` to make
|
|
334
449
|
* an identifiable tag for an inspected value.
|
|
335
450
|
*
|
|
336
451
|
* ```js
|
|
@@ -378,7 +493,7 @@ declare module "util" {
|
|
|
378
493
|
* The following example highlights the effect of the `compact` option:
|
|
379
494
|
*
|
|
380
495
|
* ```js
|
|
381
|
-
* import
|
|
496
|
+
* import { inspect } from 'node:util';
|
|
382
497
|
*
|
|
383
498
|
* const o = {
|
|
384
499
|
* a: [1, 2, [[
|
|
@@ -388,7 +503,7 @@ declare module "util" {
|
|
|
388
503
|
* 'foo']], 4],
|
|
389
504
|
* b: new Map([['za', 1], ['zb', 'test']]),
|
|
390
505
|
* };
|
|
391
|
-
* console.log(
|
|
506
|
+
* console.log(inspect(o, { compact: true, depth: 5, breakLength: 80 }));
|
|
392
507
|
*
|
|
393
508
|
* // { a:
|
|
394
509
|
* // [ 1,
|
|
@@ -400,7 +515,7 @@ declare module "util" {
|
|
|
400
515
|
* // b: Map(2) { 'za' => 1, 'zb' => 'test' } }
|
|
401
516
|
*
|
|
402
517
|
* // Setting `compact` to false or an integer creates more reader friendly output.
|
|
403
|
-
* console.log(
|
|
518
|
+
* console.log(inspect(o, { compact: false, depth: 5, breakLength: 80 }));
|
|
404
519
|
*
|
|
405
520
|
* // {
|
|
406
521
|
* // a: [
|
|
@@ -427,11 +542,10 @@ declare module "util" {
|
|
|
427
542
|
* // single line.
|
|
428
543
|
* ```
|
|
429
544
|
*
|
|
430
|
-
* The `showHidden` option allows
|
|
431
|
-
* [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be
|
|
545
|
+
* The `showHidden` option allows `WeakMap` and `WeakSet` entries to be
|
|
432
546
|
* inspected. If there are more entries than `maxArrayLength`, there is no
|
|
433
|
-
* guarantee which entries are displayed. That means retrieving the same
|
|
434
|
-
* result in different output. Furthermore, entries
|
|
547
|
+
* guarantee which entries are displayed. That means retrieving the same
|
|
548
|
+
* `WeakSet` entries twice may result in different output. Furthermore, entries
|
|
435
549
|
* with no remaining strong references may be garbage collected at any time.
|
|
436
550
|
*
|
|
437
551
|
* ```js
|
|
@@ -479,10 +593,10 @@ declare module "util" {
|
|
|
479
593
|
* ```js
|
|
480
594
|
* import { inspect } from 'node:util';
|
|
481
595
|
*
|
|
482
|
-
* const thousand =
|
|
483
|
-
* const million =
|
|
484
|
-
* const bigNumber =
|
|
485
|
-
* const bigDecimal =
|
|
596
|
+
* const thousand = 1000;
|
|
597
|
+
* const million = 1000000;
|
|
598
|
+
* const bigNumber = 123456789n;
|
|
599
|
+
* const bigDecimal = 1234.12345;
|
|
486
600
|
*
|
|
487
601
|
* console.log(inspect(thousand, { numericSeparator: true }));
|
|
488
602
|
* // 1_000
|
|
@@ -603,19 +717,23 @@ declare module "util" {
|
|
|
603
717
|
*/
|
|
604
718
|
export function isError(object: unknown): object is Error;
|
|
605
719
|
/**
|
|
606
|
-
* Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and
|
|
720
|
+
* Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and
|
|
721
|
+
* `extends` keywords to get language level inheritance support. Also note
|
|
607
722
|
* that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179).
|
|
608
723
|
*
|
|
609
|
-
* Inherit the prototype methods from one
|
|
610
|
-
*
|
|
724
|
+
* Inherit the prototype methods from one
|
|
725
|
+
* [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The
|
|
726
|
+
* prototype of `constructor` will be set to a new object created from
|
|
727
|
+
* `superConstructor`.
|
|
611
728
|
*
|
|
612
|
-
* This mainly adds some input validation on top of
|
|
729
|
+
* This mainly adds some input validation on top of
|
|
730
|
+
* `Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`.
|
|
613
731
|
* As an additional convenience, `superConstructor` will be accessible
|
|
614
732
|
* through the `constructor.super_` property.
|
|
615
733
|
*
|
|
616
734
|
* ```js
|
|
617
|
-
*
|
|
618
|
-
*
|
|
735
|
+
* const util = require('node:util');
|
|
736
|
+
* const EventEmitter = require('node:events');
|
|
619
737
|
*
|
|
620
738
|
* function MyStream() {
|
|
621
739
|
* EventEmitter.call(this);
|
|
@@ -662,18 +780,42 @@ declare module "util" {
|
|
|
662
780
|
export function inherits(constructor: unknown, superConstructor: unknown): void;
|
|
663
781
|
export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void;
|
|
664
782
|
export interface DebugLogger extends DebugLoggerFunction {
|
|
783
|
+
/**
|
|
784
|
+
* The `util.debuglog().enabled` getter is used to create a test that can be used
|
|
785
|
+
* in conditionals based on the existence of the `NODE_DEBUG` environment variable.
|
|
786
|
+
* If the `section` name appears within the value of that environment variable,
|
|
787
|
+
* then the returned value will be `true`. If not, then the returned value will be
|
|
788
|
+
* `false`.
|
|
789
|
+
*
|
|
790
|
+
* ```js
|
|
791
|
+
* import { debuglog } from 'node:util';
|
|
792
|
+
* const enabled = debuglog('foo').enabled;
|
|
793
|
+
* if (enabled) {
|
|
794
|
+
* console.log('hello from foo [%d]', 123);
|
|
795
|
+
* }
|
|
796
|
+
* ```
|
|
797
|
+
*
|
|
798
|
+
* If this program is run with `NODE_DEBUG=foo` in the environment, then it will
|
|
799
|
+
* output something like:
|
|
800
|
+
*
|
|
801
|
+
* ```console
|
|
802
|
+
* hello from foo [123]
|
|
803
|
+
* ```
|
|
804
|
+
*/
|
|
665
805
|
enabled: boolean;
|
|
666
806
|
}
|
|
667
807
|
/**
|
|
668
808
|
* The `util.debuglog()` method is used to create a function that conditionally
|
|
669
|
-
* writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`
|
|
670
|
-
* environment variable
|
|
809
|
+
* writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`
|
|
810
|
+
* environment variable. If the `section` name appears within the value of that
|
|
811
|
+
* environment variable, then the returned function operates similar to
|
|
812
|
+
* `console.error()`. If not, then the returned function is a no-op.
|
|
671
813
|
*
|
|
672
814
|
* ```js
|
|
673
|
-
* import
|
|
674
|
-
* const
|
|
815
|
+
* import { debuglog } from 'node:util';
|
|
816
|
+
* const log = debuglog('foo');
|
|
675
817
|
*
|
|
676
|
-
*
|
|
818
|
+
* log('hello from foo [%d]', 123);
|
|
677
819
|
* ```
|
|
678
820
|
*
|
|
679
821
|
* If this program is run with `NODE_DEBUG=foo` in the environment, then
|
|
@@ -689,10 +831,10 @@ declare module "util" {
|
|
|
689
831
|
* The `section` supports wildcard also:
|
|
690
832
|
*
|
|
691
833
|
* ```js
|
|
692
|
-
* import
|
|
693
|
-
* const
|
|
834
|
+
* import { debuglog } from 'node:util';
|
|
835
|
+
* const log = debuglog('foo');
|
|
694
836
|
*
|
|
695
|
-
*
|
|
837
|
+
* log('hi there, it\'s foo-bar [%d]', 2333);
|
|
696
838
|
* ```
|
|
697
839
|
*
|
|
698
840
|
* if it is run with `NODE_DEBUG=foo*` in the environment, then it will output
|
|
@@ -702,18 +844,19 @@ declare module "util" {
|
|
|
702
844
|
* FOO-BAR 3257: hi there, it's foo-bar [2333]
|
|
703
845
|
* ```
|
|
704
846
|
*
|
|
705
|
-
* Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`
|
|
847
|
+
* Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`
|
|
848
|
+
* environment variable: `NODE_DEBUG=fs,net,tls`.
|
|
706
849
|
*
|
|
707
850
|
* The optional `callback` argument can be used to replace the logging function
|
|
708
851
|
* with a different function that doesn't have any initialization or
|
|
709
852
|
* unnecessary wrapping.
|
|
710
853
|
*
|
|
711
854
|
* ```js
|
|
712
|
-
* import
|
|
713
|
-
* let
|
|
855
|
+
* import { debuglog } from 'node:util';
|
|
856
|
+
* let log = debuglog('internals', (debug) => {
|
|
714
857
|
* // Replace with a logging function that optimizes out
|
|
715
858
|
* // testing if the section is enabled
|
|
716
|
-
*
|
|
859
|
+
* log = debug;
|
|
717
860
|
* });
|
|
718
861
|
* ```
|
|
719
862
|
* @since v0.11.3
|
|
@@ -722,7 +865,7 @@ declare module "util" {
|
|
|
722
865
|
* @return The logging function
|
|
723
866
|
*/
|
|
724
867
|
export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
|
|
725
|
-
export
|
|
868
|
+
export { debuglog as debug };
|
|
726
869
|
/**
|
|
727
870
|
* Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`.
|
|
728
871
|
*
|
|
@@ -939,14 +1082,15 @@ declare module "util" {
|
|
|
939
1082
|
* such a way that it is marked as deprecated.
|
|
940
1083
|
*
|
|
941
1084
|
* ```js
|
|
942
|
-
* import
|
|
1085
|
+
* import { deprecate } from 'node:util';
|
|
943
1086
|
*
|
|
944
|
-
*
|
|
1087
|
+
* export const obsoleteFunction = deprecate(() => {
|
|
945
1088
|
* // Do something here.
|
|
946
1089
|
* }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.');
|
|
947
1090
|
* ```
|
|
948
1091
|
*
|
|
949
|
-
* When called, `util.deprecate()` will return a function that will emit a
|
|
1092
|
+
* When called, `util.deprecate()` will return a function that will emit a
|
|
1093
|
+
* `DeprecationWarning` using the `'warning'` event. The warning will
|
|
950
1094
|
* be emitted and printed to `stderr` the first time the returned function is
|
|
951
1095
|
* called. After the warning is emitted, the wrapped function is called without
|
|
952
1096
|
* emitting a warning.
|
|
@@ -955,16 +1099,24 @@ declare module "util" {
|
|
|
955
1099
|
* the warning will be emitted only once for that `code`.
|
|
956
1100
|
*
|
|
957
1101
|
* ```js
|
|
958
|
-
* import
|
|
1102
|
+
* import { deprecate } from 'node:util';
|
|
959
1103
|
*
|
|
960
|
-
* const fn1 =
|
|
961
|
-
*
|
|
1104
|
+
* const fn1 = deprecate(
|
|
1105
|
+
* () => 'a value',
|
|
1106
|
+
* 'deprecation message',
|
|
1107
|
+
* 'DEP0001',
|
|
1108
|
+
* );
|
|
1109
|
+
* const fn2 = deprecate(
|
|
1110
|
+
* () => 'a different value',
|
|
1111
|
+
* 'other dep message',
|
|
1112
|
+
* 'DEP0001',
|
|
1113
|
+
* );
|
|
962
1114
|
* fn1(); // Emits a deprecation warning with code DEP0001
|
|
963
1115
|
* fn2(); // Does not emit a deprecation warning because it has the same code
|
|
964
1116
|
* ```
|
|
965
1117
|
*
|
|
966
1118
|
* If either the `--no-deprecation` or `--no-warnings` command-line flags are
|
|
967
|
-
* used, or if the `process.noDeprecation` property is set to `true`_prior_ to
|
|
1119
|
+
* used, or if the `process.noDeprecation` property is set to `true` _prior_ to
|
|
968
1120
|
* the first deprecation warning, the `util.deprecate()` method does nothing.
|
|
969
1121
|
*
|
|
970
1122
|
* If the `--trace-deprecation` or `--trace-warnings` command-line flags are set,
|
|
@@ -972,10 +1124,13 @@ declare module "util" {
|
|
|
972
1124
|
* stack trace are printed to `stderr` the first time the deprecated function is
|
|
973
1125
|
* called.
|
|
974
1126
|
*
|
|
975
|
-
* If the `--throw-deprecation` command-line flag is set, or the
|
|
1127
|
+
* If the `--throw-deprecation` command-line flag is set, or the
|
|
1128
|
+
* `process.throwDeprecation` property is set to `true`, then an exception will be
|
|
976
1129
|
* thrown when the deprecated function is called.
|
|
977
1130
|
*
|
|
978
|
-
* The `--throw-deprecation` command-line flag and `process.throwDeprecation`
|
|
1131
|
+
* The `--throw-deprecation` command-line flag and `process.throwDeprecation`
|
|
1132
|
+
* property take precedence over `--trace-deprecation` and
|
|
1133
|
+
* `process.traceDeprecation`.
|
|
979
1134
|
* @since v0.8.0
|
|
980
1135
|
* @param fn The function that is being deprecated.
|
|
981
1136
|
* @param msg A warning message to display when the deprecated function is invoked.
|
|
@@ -1006,15 +1161,16 @@ declare module "util" {
|
|
|
1006
1161
|
* Takes an `async` function (or a function that returns a `Promise`) and returns a
|
|
1007
1162
|
* function following the error-first callback style, i.e. taking
|
|
1008
1163
|
* an `(err, value) => ...` callback as the last argument. In the callback, the
|
|
1009
|
-
* first argument will be the rejection reason (or `null` if the `Promise`
|
|
1164
|
+
* first argument will be the rejection reason (or `null` if the `Promise`
|
|
1165
|
+
* resolved), and the second argument will be the resolved value.
|
|
1010
1166
|
*
|
|
1011
1167
|
* ```js
|
|
1012
|
-
* import
|
|
1168
|
+
* import { callbackify } from 'node:util';
|
|
1013
1169
|
*
|
|
1014
1170
|
* async function fn() {
|
|
1015
1171
|
* return 'hello world';
|
|
1016
1172
|
* }
|
|
1017
|
-
* const callbackFunction =
|
|
1173
|
+
* const callbackFunction = callbackify(fn);
|
|
1018
1174
|
*
|
|
1019
1175
|
* callbackFunction((err, ret) => {
|
|
1020
1176
|
* if (err) throw err;
|
|
@@ -1029,11 +1185,13 @@ declare module "util" {
|
|
|
1029
1185
|
* ```
|
|
1030
1186
|
*
|
|
1031
1187
|
* The callback is executed asynchronously, and will have a limited stack trace.
|
|
1032
|
-
* If the callback throws, the process will emit an `'uncaughtException'`
|
|
1188
|
+
* If the callback throws, the process will emit an `'uncaughtException'`
|
|
1189
|
+
* event, and if not handled will exit.
|
|
1033
1190
|
*
|
|
1034
1191
|
* Since `null` has a special meaning as the first argument to a callback, if a
|
|
1035
1192
|
* wrapped function rejects a `Promise` with a falsy value as a reason, the value
|
|
1036
|
-
* is wrapped in an `Error` with the original value stored in a field named
|
|
1193
|
+
* is wrapped in an `Error` with the original value stored in a field named
|
|
1194
|
+
* `reason`.
|
|
1037
1195
|
*
|
|
1038
1196
|
* ```js
|
|
1039
1197
|
* function fn() {
|
|
@@ -1044,7 +1202,7 @@ declare module "util" {
|
|
|
1044
1202
|
* callbackFunction((err, ret) => {
|
|
1045
1203
|
* // When the Promise was rejected with `null` it is wrapped with an Error and
|
|
1046
1204
|
* // the original value is stored in `reason`.
|
|
1047
|
-
* err
|
|
1205
|
+
* err && Object.hasOwn(err, 'reason') && err.reason === null; // true
|
|
1048
1206
|
* });
|
|
1049
1207
|
* ```
|
|
1050
1208
|
* @since v8.2.0
|
|
@@ -1135,11 +1293,11 @@ declare module "util" {
|
|
|
1135
1293
|
* that returns promises.
|
|
1136
1294
|
*
|
|
1137
1295
|
* ```js
|
|
1138
|
-
* import
|
|
1139
|
-
* import
|
|
1296
|
+
* import { promisify } from 'node:util';
|
|
1297
|
+
* import { stat } from 'node:fs';
|
|
1140
1298
|
*
|
|
1141
|
-
* const
|
|
1142
|
-
*
|
|
1299
|
+
* const promisifiedStat = promisify(stat);
|
|
1300
|
+
* promisifiedStat('.').then((stats) => {
|
|
1143
1301
|
* // Do something with `stats`
|
|
1144
1302
|
* }).catch((error) => {
|
|
1145
1303
|
* // Handle the error.
|
|
@@ -1149,23 +1307,25 @@ declare module "util" {
|
|
|
1149
1307
|
* Or, equivalently using `async function`s:
|
|
1150
1308
|
*
|
|
1151
1309
|
* ```js
|
|
1152
|
-
* import
|
|
1153
|
-
* import
|
|
1310
|
+
* import { promisify } from 'node:util';
|
|
1311
|
+
* import { stat } from 'node:fs';
|
|
1154
1312
|
*
|
|
1155
|
-
* const
|
|
1313
|
+
* const promisifiedStat = promisify(stat);
|
|
1156
1314
|
*
|
|
1157
1315
|
* async function callStat() {
|
|
1158
|
-
* const stats = await
|
|
1316
|
+
* const stats = await promisifiedStat('.');
|
|
1159
1317
|
* console.log(`This directory is owned by ${stats.uid}`);
|
|
1160
1318
|
* }
|
|
1161
1319
|
*
|
|
1162
1320
|
* callStat();
|
|
1163
1321
|
* ```
|
|
1164
1322
|
*
|
|
1165
|
-
* If there is an `original[util.promisify.custom]` property present, `promisify`
|
|
1323
|
+
* If there is an `original[util.promisify.custom]` property present, `promisify`
|
|
1324
|
+
* will return its value, see [Custom promisified functions](https://nodejs.org/docs/latest-v22.x/api/util.html#custom-promisified-functions).
|
|
1166
1325
|
*
|
|
1167
1326
|
* `promisify()` assumes that `original` is a function taking a callback as its
|
|
1168
|
-
* final argument in all cases. If `original` is not a function, `promisify()`
|
|
1327
|
+
* final argument in all cases. If `original` is not a function, `promisify()`
|
|
1328
|
+
* will throw an error. If `original` is a function but its last argument is not
|
|
1169
1329
|
* an error-first callback, it will still be passed an error-first
|
|
1170
1330
|
* callback as its last argument.
|
|
1171
1331
|
*
|
|
@@ -1173,7 +1333,7 @@ declare module "util" {
|
|
|
1173
1333
|
* work as expected unless handled specially:
|
|
1174
1334
|
*
|
|
1175
1335
|
* ```js
|
|
1176
|
-
* import
|
|
1336
|
+
* import { promisify } from 'node:util';
|
|
1177
1337
|
*
|
|
1178
1338
|
* class Foo {
|
|
1179
1339
|
* constructor() {
|
|
@@ -1187,8 +1347,8 @@ declare module "util" {
|
|
|
1187
1347
|
*
|
|
1188
1348
|
* const foo = new Foo();
|
|
1189
1349
|
*
|
|
1190
|
-
* const naiveBar =
|
|
1191
|
-
* // TypeError: Cannot read
|
|
1350
|
+
* const naiveBar = promisify(foo.bar);
|
|
1351
|
+
* // TypeError: Cannot read properties of undefined (reading 'a')
|
|
1192
1352
|
* // naiveBar().then(a => console.log(a));
|
|
1193
1353
|
*
|
|
1194
1354
|
* naiveBar.call(foo).then((a) => console.log(a)); // '42'
|
|
@@ -1306,18 +1466,42 @@ declare module "util" {
|
|
|
1306
1466
|
| "reset"
|
|
1307
1467
|
| "strikethrough"
|
|
1308
1468
|
| "underline";
|
|
1469
|
+
export interface StyleTextOptions {
|
|
1470
|
+
/**
|
|
1471
|
+
* When true, `stream` is checked to see if it can handle colors.
|
|
1472
|
+
* @default true
|
|
1473
|
+
*/
|
|
1474
|
+
validateStream?: boolean | undefined;
|
|
1475
|
+
/**
|
|
1476
|
+
* A stream that will be validated if it can be colored.
|
|
1477
|
+
* @default process.stdout
|
|
1478
|
+
*/
|
|
1479
|
+
stream?: NodeJS.WritableStream | undefined;
|
|
1480
|
+
}
|
|
1309
1481
|
/**
|
|
1310
|
-
*
|
|
1311
|
-
*
|
|
1312
|
-
*
|
|
1482
|
+
* This function returns a formatted text considering the `format` passed
|
|
1483
|
+
* for printing in a terminal. It is aware of the terminal's capabilities
|
|
1484
|
+
* and acts according to the configuration set via `NO_COLORS`,
|
|
1485
|
+
* `NODE_DISABLE_COLORS` and `FORCE_COLOR` environment variables.
|
|
1313
1486
|
*
|
|
1314
1487
|
* ```js
|
|
1315
1488
|
* import { styleText } from 'node:util';
|
|
1316
|
-
*
|
|
1317
|
-
*
|
|
1489
|
+
* import { stderr } from 'node:process';
|
|
1490
|
+
*
|
|
1491
|
+
* const successMessage = styleText('green', 'Success!');
|
|
1492
|
+
* console.log(successMessage);
|
|
1493
|
+
*
|
|
1494
|
+
* const errorMessage = styleText(
|
|
1495
|
+
* 'red',
|
|
1496
|
+
* 'Error! Error!',
|
|
1497
|
+
* // Validate if process.stderr has TTY
|
|
1498
|
+
* { stream: stderr },
|
|
1499
|
+
* );
|
|
1500
|
+
* console.error(errorMessage);
|
|
1318
1501
|
* ```
|
|
1319
1502
|
*
|
|
1320
|
-
* `util.inspect.colors` also provides text formats such as `italic`, and
|
|
1503
|
+
* `util.inspect.colors` also provides text formats such as `italic`, and
|
|
1504
|
+
* `underline` and you can combine both:
|
|
1321
1505
|
*
|
|
1322
1506
|
* ```js
|
|
1323
1507
|
* console.log(
|
|
@@ -1325,8 +1509,8 @@ declare module "util" {
|
|
|
1325
1509
|
* );
|
|
1326
1510
|
* ```
|
|
1327
1511
|
*
|
|
1328
|
-
* When passing an array of formats, the order of the format applied
|
|
1329
|
-
* might overwrite the previous one.
|
|
1512
|
+
* When passing an array of formats, the order of the format applied
|
|
1513
|
+
* is left to right so the following style might overwrite the previous one.
|
|
1330
1514
|
*
|
|
1331
1515
|
* ```js
|
|
1332
1516
|
* console.log(
|
|
@@ -1346,6 +1530,7 @@ declare module "util" {
|
|
|
1346
1530
|
| Modifiers
|
|
1347
1531
|
| Array<ForegroundColors | BackgroundColors | Modifiers>,
|
|
1348
1532
|
text: string,
|
|
1533
|
+
options?: StyleTextOptions,
|
|
1349
1534
|
): string;
|
|
1350
1535
|
/**
|
|
1351
1536
|
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API.
|
|
@@ -1499,11 +1684,17 @@ declare module "util" {
|
|
|
1499
1684
|
* @return The parsed command line arguments:
|
|
1500
1685
|
*/
|
|
1501
1686
|
export function parseArgs<T extends ParseArgsConfig>(config?: T): ParsedResults<T>;
|
|
1502
|
-
|
|
1687
|
+
|
|
1688
|
+
/**
|
|
1689
|
+
* Type of argument used in {@link parseArgs}.
|
|
1690
|
+
*/
|
|
1691
|
+
export type ParseArgsOptionsType = "boolean" | "string";
|
|
1692
|
+
|
|
1693
|
+
export interface ParseArgsOptionDescriptor {
|
|
1503
1694
|
/**
|
|
1504
1695
|
* Type of argument.
|
|
1505
1696
|
*/
|
|
1506
|
-
type:
|
|
1697
|
+
type: ParseArgsOptionsType;
|
|
1507
1698
|
/**
|
|
1508
1699
|
* Whether this option can be provided multiple times.
|
|
1509
1700
|
* If `true`, all values will be collected in an array.
|
|
@@ -1516,15 +1707,16 @@ declare module "util" {
|
|
|
1516
1707
|
*/
|
|
1517
1708
|
short?: string | undefined;
|
|
1518
1709
|
/**
|
|
1519
|
-
* The default
|
|
1520
|
-
*
|
|
1521
|
-
*
|
|
1710
|
+
* The default value to
|
|
1711
|
+
* be used if (and only if) the option does not appear in the arguments to be
|
|
1712
|
+
* parsed. It must be of the same type as the `type` property. When `multiple`
|
|
1713
|
+
* is `true`, it must be an array.
|
|
1522
1714
|
* @since v18.11.0
|
|
1523
1715
|
*/
|
|
1524
1716
|
default?: string | boolean | string[] | boolean[] | undefined;
|
|
1525
1717
|
}
|
|
1526
|
-
interface ParseArgsOptionsConfig {
|
|
1527
|
-
[longOption: string]:
|
|
1718
|
+
export interface ParseArgsOptionsConfig {
|
|
1719
|
+
[longOption: string]: ParseArgsOptionDescriptor;
|
|
1528
1720
|
}
|
|
1529
1721
|
export interface ParseArgsConfig {
|
|
1530
1722
|
/**
|
|
@@ -1576,7 +1768,7 @@ declare module "util" {
|
|
|
1576
1768
|
: T extends true ? IfTrue
|
|
1577
1769
|
: IfFalse;
|
|
1578
1770
|
|
|
1579
|
-
type ExtractOptionValue<T extends ParseArgsConfig, O extends
|
|
1771
|
+
type ExtractOptionValue<T extends ParseArgsConfig, O extends ParseArgsOptionDescriptor> = IfDefaultsTrue<
|
|
1580
1772
|
T["strict"],
|
|
1581
1773
|
O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean,
|
|
1582
1774
|
string | boolean
|
|
@@ -1609,7 +1801,7 @@ declare module "util" {
|
|
|
1609
1801
|
|
|
1610
1802
|
type PreciseTokenForOptions<
|
|
1611
1803
|
K extends string,
|
|
1612
|
-
O extends
|
|
1804
|
+
O extends ParseArgsOptionDescriptor,
|
|
1613
1805
|
> = O["type"] extends "string" ? {
|
|
1614
1806
|
kind: "option";
|
|
1615
1807
|
index: number;
|
|
@@ -1699,7 +1891,6 @@ declare module "util" {
|
|
|
1699
1891
|
* components. When parsed, a `MIMEType` object is returned containing
|
|
1700
1892
|
* properties for each of these components.
|
|
1701
1893
|
* @since v19.1.0, v18.13.0
|
|
1702
|
-
* @experimental
|
|
1703
1894
|
*/
|
|
1704
1895
|
export class MIMEType {
|
|
1705
1896
|
/**
|
|
@@ -1917,6 +2108,18 @@ declare module "util/types" {
|
|
|
1917
2108
|
* @since v10.0.0
|
|
1918
2109
|
*/
|
|
1919
2110
|
function isBigInt64Array(value: unknown): value is BigInt64Array;
|
|
2111
|
+
/**
|
|
2112
|
+
* Returns `true` if the value is a BigInt object, e.g. created
|
|
2113
|
+
* by `Object(BigInt(123))`.
|
|
2114
|
+
*
|
|
2115
|
+
* ```js
|
|
2116
|
+
* util.types.isBigIntObject(Object(BigInt(123))); // Returns true
|
|
2117
|
+
* util.types.isBigIntObject(BigInt(123)); // Returns false
|
|
2118
|
+
* util.types.isBigIntObject(123); // Returns false
|
|
2119
|
+
* ```
|
|
2120
|
+
* @since v10.4.0
|
|
2121
|
+
*/
|
|
2122
|
+
function isBigIntObject(object: unknown): object is BigInt;
|
|
1920
2123
|
/**
|
|
1921
2124
|
* Returns `true` if the value is a `BigUint64Array` instance.
|
|
1922
2125
|
*
|
|
@@ -1986,7 +2189,9 @@ declare module "util/types" {
|
|
|
1986
2189
|
* A native `External` value is a special type of object that contains a
|
|
1987
2190
|
* raw C++ pointer (`void*`) for access from native code, and has no other
|
|
1988
2191
|
* properties. Such objects are created either by Node.js internals or native
|
|
1989
|
-
* addons. In JavaScript, they are
|
|
2192
|
+
* addons. In JavaScript, they are
|
|
2193
|
+
* [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a
|
|
2194
|
+
* `null` prototype.
|
|
1990
2195
|
*
|
|
1991
2196
|
* ```c
|
|
1992
2197
|
* #include <js_native_api.h>
|
|
@@ -1994,7 +2199,7 @@ declare module "util/types" {
|
|
|
1994
2199
|
* napi_value result;
|
|
1995
2200
|
* static napi_value MyNapi(napi_env env, napi_callback_info info) {
|
|
1996
2201
|
* int* raw = (int*) malloc(1024);
|
|
1997
|
-
* napi_status status = napi_create_external(env, (void*) raw, NULL, NULL,
|
|
2202
|
+
* napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result);
|
|
1998
2203
|
* if (status != napi_ok) {
|
|
1999
2204
|
* napi_throw_error(env, NULL, "napi_create_external failed");
|
|
2000
2205
|
* return NULL;
|
|
@@ -2007,14 +2212,17 @@ declare module "util/types" {
|
|
|
2007
2212
|
* ```
|
|
2008
2213
|
*
|
|
2009
2214
|
* ```js
|
|
2010
|
-
*
|
|
2215
|
+
* import native from 'napi_addon.node';
|
|
2216
|
+
* import { types } from 'node:util';
|
|
2217
|
+
*
|
|
2011
2218
|
* const data = native.myNapi();
|
|
2012
|
-
*
|
|
2013
|
-
*
|
|
2014
|
-
*
|
|
2219
|
+
* types.isExternal(data); // returns true
|
|
2220
|
+
* types.isExternal(0); // returns false
|
|
2221
|
+
* types.isExternal(new String('foo')); // returns false
|
|
2015
2222
|
* ```
|
|
2016
2223
|
*
|
|
2017
|
-
* For further information on `napi_create_external`, refer to
|
|
2224
|
+
* For further information on `napi_create_external`, refer to
|
|
2225
|
+
* [`napi_create_external()`](https://nodejs.org/docs/latest-v22.x/api/n-api.html#napi_create_external).
|
|
2018
2226
|
* @since v10.0.0
|
|
2019
2227
|
*/
|
|
2020
2228
|
function isExternal(object: unknown): boolean;
|
|
@@ -2138,7 +2346,8 @@ declare module "util/types" {
|
|
|
2138
2346
|
*/
|
|
2139
2347
|
function isModuleNamespaceObject(value: unknown): boolean;
|
|
2140
2348
|
/**
|
|
2141
|
-
* Returns `true` if the value was returned by the constructor of a
|
|
2349
|
+
* Returns `true` if the value was returned by the constructor of a
|
|
2350
|
+
* [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects).
|
|
2142
2351
|
*
|
|
2143
2352
|
* ```js
|
|
2144
2353
|
* console.log(util.types.isNativeError(new Error())); // true
|
|
@@ -2153,14 +2362,18 @@ declare module "util/types" {
|
|
|
2153
2362
|
* console.log(util.types.isNativeError(new MyError())); // true
|
|
2154
2363
|
* ```
|
|
2155
2364
|
*
|
|
2156
|
-
* A value being `instanceof` a native error class is not equivalent to `isNativeError()`
|
|
2157
|
-
*
|
|
2365
|
+
* A value being `instanceof` a native error class is not equivalent to `isNativeError()`
|
|
2366
|
+
* returning `true` for that value. `isNativeError()` returns `true` for errors
|
|
2367
|
+
* which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false`
|
|
2368
|
+
* for these errors:
|
|
2158
2369
|
*
|
|
2159
2370
|
* ```js
|
|
2160
|
-
* import
|
|
2161
|
-
*
|
|
2162
|
-
*
|
|
2163
|
-
*
|
|
2371
|
+
* import { createContext, runInContext } from 'node:vm';
|
|
2372
|
+
* import { types } from 'node:util';
|
|
2373
|
+
*
|
|
2374
|
+
* const context = createContext({});
|
|
2375
|
+
* const myError = runInContext('new Error()', context);
|
|
2376
|
+
* console.log(types.isNativeError(myError)); // true
|
|
2164
2377
|
* console.log(myError instanceof Error); // false
|
|
2165
2378
|
* ```
|
|
2166
2379
|
*
|