cdk-ecr-deployment 2.5.5 → 2.5.21
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/.gitattributes +5 -4
- package/.jsii +673 -21
- package/.jsii.tabl.json +1 -0
- package/.projenrc.ts +100 -0
- package/API.md +4 -4
- package/README.md +4 -4
- package/lambda/go.mod +2 -5
- package/lambda/go.sum +39 -14
- package/lib/index.d.ts +7 -65
- package/lib/index.js +7 -45
- package/node_modules/@sindresorhus/is/dist/index.d.ts +12 -7
- package/node_modules/@sindresorhus/is/dist/index.js +9 -4
- package/node_modules/@sindresorhus/is/dist/types.d.ts +1 -0
- package/node_modules/@sindresorhus/is/package.json +1 -1
- package/node_modules/@sindresorhus/is/readme.md +25 -7
- package/node_modules/@types/cacheable-request/README.md +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +135 -75
- package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +67 -38
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +226 -104
- package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +87 -58
- package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +29 -29
- package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +5 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +888 -256
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +16 -16
- package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +52 -8
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +27 -18
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dom-events.d.ts +126 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +6 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +166 -93
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +169 -70
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +301 -126
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +22 -13
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +453 -125
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +74 -46
- package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +103 -53
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +6 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +20 -16
- package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +6 -4
- package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +114 -22
- package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +36 -14
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +15 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +37 -26
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +96 -15
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +95 -82
- package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +6 -6
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +145 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +51 -175
- package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +21 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +2 -14
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +983 -824
- package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +6 -6
- package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +1052 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +26 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +127 -6
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +149 -50
- package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +30 -9
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/buffer.d.ts +2354 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/crypto.d.ts +3969 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/events.d.ts +724 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/fs.d.ts +4044 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/https.d.ts +441 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/module.d.ts +116 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/net.d.ts +888 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/os.d.ts +477 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/process.d.ts +1494 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/url.d.ts +901 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +11 -7
- package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +66 -56
- package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +528 -70
- package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +271 -14
- package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +421 -34
- package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +15 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +81 -37
- package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +11 -11
- package/node_modules/@types/cacheable-request/package.json +5 -5
- package/node_modules/@types/keyv/README.md +1 -1
- package/node_modules/@types/keyv/index.d.ts +16 -3
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +135 -75
- package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +67 -38
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +226 -104
- package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +87 -58
- package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +29 -29
- package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +5 -5
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +888 -256
- package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +16 -16
- package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
- package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +52 -8
- package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +27 -18
- package/node_modules/@types/keyv/node_modules/@types/node/dom-events.d.ts +126 -0
- package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +6 -5
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +166 -93
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +169 -70
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +301 -126
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +22 -13
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +453 -125
- package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +74 -46
- package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +103 -53
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +6 -2
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +20 -16
- package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +6 -4
- package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +114 -22
- package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +36 -14
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +15 -3
- package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +37 -26
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +96 -15
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +95 -82
- package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +6 -6
- package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +145 -0
- package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +51 -175
- package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +21 -21
- package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +2 -14
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +983 -824
- package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +6 -6
- package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +1052 -0
- package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +26 -1
- package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +127 -6
- package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +149 -50
- package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +30 -9
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/buffer.d.ts +2354 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/crypto.d.ts +3969 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/events.d.ts +724 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/fs.d.ts +4044 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/https.d.ts +441 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/module.d.ts +116 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/net.d.ts +888 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/os.d.ts +477 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/process.d.ts +1494 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/url.d.ts +901 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +11 -7
- package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +66 -56
- package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +528 -70
- package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +271 -14
- package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +421 -34
- package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +15 -21
- package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +81 -37
- package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +11 -11
- package/node_modules/@types/keyv/package.json +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +135 -75
- package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +67 -38
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +226 -104
- package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +87 -58
- package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +29 -29
- package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +5 -5
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +888 -256
- package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +16 -16
- package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
- package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +52 -8
- package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +27 -18
- package/node_modules/@types/responselike/node_modules/@types/node/dom-events.d.ts +126 -0
- package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +6 -5
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +166 -93
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +169 -70
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +301 -126
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +22 -13
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +453 -125
- package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +74 -46
- package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +103 -53
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +6 -2
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +20 -16
- package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +6 -4
- package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +114 -22
- package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +36 -14
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +15 -3
- package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +37 -26
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +96 -15
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +95 -82
- package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +6 -6
- package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +145 -0
- package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +51 -175
- package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +21 -21
- package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +2 -14
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +983 -824
- package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +6 -6
- package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +1052 -0
- package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +26 -1
- package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +127 -6
- package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +149 -50
- package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +30 -9
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/buffer.d.ts +2354 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/crypto.d.ts +3969 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/events.d.ts +724 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/fs.d.ts +4044 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/https.d.ts +441 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/module.d.ts +116 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/net.d.ts +888 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/os.d.ts +477 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/process.d.ts +1494 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/url.d.ts +901 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +11 -7
- package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +66 -56
- package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +528 -70
- package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +271 -14
- package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +421 -34
- package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +15 -21
- package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +81 -37
- package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +11 -11
- package/node_modules/cacheable-request/package.json +1 -1
- package/node_modules/clone-response/node_modules/mimic-response/index.js +32 -0
- package/node_modules/{get-stream → clone-response/node_modules/mimic-response}/license +1 -1
- package/node_modules/clone-response/node_modules/mimic-response/package.json +37 -0
- package/node_modules/clone-response/node_modules/mimic-response/readme.md +54 -0
- package/node_modules/clone-response/package.json +3 -6
- package/node_modules/got/dist/source/as-promise/index.js +2 -1
- package/node_modules/got/dist/source/core/index.js +8 -0
- package/node_modules/got/dist/source/types.d.ts +8 -8
- package/node_modules/got/package.json +2 -1
- package/node_modules/http-cache-semantics/index.js +4 -3
- package/node_modules/http-cache-semantics/package.json +2 -8
- package/node_modules/keyv/README.md +141 -5
- package/node_modules/keyv/package.json +56 -50
- package/node_modules/keyv/src/index.d.ts +116 -0
- package/node_modules/keyv/src/index.js +179 -24
- package/node_modules/mimic-response/index.js +58 -13
- package/node_modules/mimic-response/license +1 -1
- package/node_modules/mimic-response/package.json +40 -35
- package/node_modules/mimic-response/readme.md +33 -9
- package/node_modules/responselike/package.json +3 -2
- package/package.json +54 -25
- package/rosetta/default.ts-fixture +17 -0
- package/changelog.md +0 -2
- package/node_modules/decompress-response/node_modules/mimic-response/index.js +0 -77
- package/node_modules/decompress-response/node_modules/mimic-response/package.json +0 -42
- package/node_modules/decompress-response/node_modules/mimic-response/readme.md +0 -78
- package/node_modules/keyv/.nyc_output/37411020-4142-4b08-b825-343ba2427bf7.json +0 -1
- package/node_modules/keyv/.nyc_output/cd79f2de-c8b8-4493-bc15-b2bde28efa4b.json +0 -1
- package/node_modules/keyv/.nyc_output/processinfo/37411020-4142-4b08-b825-343ba2427bf7.json +0 -1
- package/node_modules/keyv/.nyc_output/processinfo/cd79f2de-c8b8-4493-bc15-b2bde28efa4b.json +0 -1
- package/node_modules/keyv/.nyc_output/processinfo/index.json +0 -1
- package/node_modules/keyv/test/test.js +0 -132
- package/node_modules/keyv/test/testdb.sqlite +0 -0
- package/releasetag.txt +0 -1
- package/version.txt +0 -1
- /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/buffer-stream.js +0 -0
- /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/index.d.ts +0 -0
- /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/index.js +0 -0
- /package/node_modules/{decompress-response/node_modules/mimic-response → cacheable-request/node_modules/get-stream}/license +0 -0
- /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/package.json +0 -0
- /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/readme.md +0 -0
- /package/node_modules/{decompress-response/node_modules/mimic-response → mimic-response}/index.d.ts +0 -0
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* recommended to explicitly reference it via an import or require statement.
|
|
11
11
|
*
|
|
12
12
|
* ```js
|
|
13
|
-
* import { Buffer } from 'buffer';
|
|
13
|
+
* import { Buffer } from 'node:buffer';
|
|
14
14
|
*
|
|
15
15
|
* // Creates a zero-filled Buffer of length 10.
|
|
16
16
|
* const buf1 = Buffer.alloc(10);
|
|
@@ -41,10 +41,29 @@
|
|
|
41
41
|
* // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
|
|
42
42
|
* const buf7 = Buffer.from('tést', 'latin1');
|
|
43
43
|
* ```
|
|
44
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
44
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/buffer.js)
|
|
45
45
|
*/
|
|
46
46
|
declare module 'buffer' {
|
|
47
47
|
import { BinaryLike } from 'node:crypto';
|
|
48
|
+
import { ReadableStream as WebReadableStream } from 'node:stream/web';
|
|
49
|
+
/**
|
|
50
|
+
* This function returns `true` if `input` contains only valid UTF-8-encoded data,
|
|
51
|
+
* including the case in which `input` is empty.
|
|
52
|
+
*
|
|
53
|
+
* Throws if the `input` is a detached array buffer.
|
|
54
|
+
* @since v19.4.0, v18.14.0
|
|
55
|
+
* @param input The input to validate.
|
|
56
|
+
*/
|
|
57
|
+
export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* This function returns `true` if `input` contains only valid ASCII-encoded data,
|
|
60
|
+
* including the case in which `input` is empty.
|
|
61
|
+
*
|
|
62
|
+
* Throws if the `input` is a detached array buffer.
|
|
63
|
+
* @since v19.6.0, v18.15.0
|
|
64
|
+
* @param input The input to validate.
|
|
65
|
+
*/
|
|
66
|
+
export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
|
|
48
67
|
export const INSPECT_MAX_BYTES: number;
|
|
49
68
|
export const kMaxLength: number;
|
|
50
69
|
export const kStringMaxLength: number;
|
|
@@ -66,7 +85,7 @@ declare module 'buffer' {
|
|
|
66
85
|
* sequence cannot be adequately represented in the target encoding. For instance:
|
|
67
86
|
*
|
|
68
87
|
* ```js
|
|
69
|
-
* import { Buffer, transcode } from 'buffer';
|
|
88
|
+
* import { Buffer, transcode } from 'node:buffer';
|
|
70
89
|
*
|
|
71
90
|
* const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii');
|
|
72
91
|
* console.log(newBuf.toString('ascii'));
|
|
@@ -114,7 +133,6 @@ declare module 'buffer' {
|
|
|
114
133
|
* A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
|
|
115
134
|
* multiple worker threads.
|
|
116
135
|
* @since v15.7.0, v14.18.0
|
|
117
|
-
* @experimental
|
|
118
136
|
*/
|
|
119
137
|
export class Blob {
|
|
120
138
|
/**
|
|
@@ -161,13 +179,59 @@ declare module 'buffer' {
|
|
|
161
179
|
* Returns a new `ReadableStream` that allows the content of the `Blob` to be read.
|
|
162
180
|
* @since v16.7.0
|
|
163
181
|
*/
|
|
164
|
-
stream():
|
|
182
|
+
stream(): WebReadableStream;
|
|
183
|
+
}
|
|
184
|
+
export interface FileOptions {
|
|
185
|
+
/**
|
|
186
|
+
* One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
|
|
187
|
+
* converted to the platform native line-ending as specified by `require('node:os').EOL`.
|
|
188
|
+
*/
|
|
189
|
+
endings?: 'native' | 'transparent';
|
|
190
|
+
/** The File content-type. */
|
|
191
|
+
type?: string;
|
|
192
|
+
/** The last modified date of the file. `Default`: Date.now(). */
|
|
193
|
+
lastModified?: number;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
|
|
197
|
+
* @since v19.2.0, v18.13.0
|
|
198
|
+
*/
|
|
199
|
+
export class File extends Blob {
|
|
200
|
+
constructor(sources: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
|
|
201
|
+
/**
|
|
202
|
+
* The name of the `File`.
|
|
203
|
+
* @since v19.2.0, v18.13.0
|
|
204
|
+
*/
|
|
205
|
+
readonly name: string;
|
|
206
|
+
/**
|
|
207
|
+
* The last modified date of the `File`.
|
|
208
|
+
* @since v19.2.0, v18.13.0
|
|
209
|
+
*/
|
|
210
|
+
readonly lastModified: number;
|
|
165
211
|
}
|
|
166
212
|
export import atob = globalThis.atob;
|
|
167
213
|
export import btoa = globalThis.btoa;
|
|
214
|
+
import { Blob as NodeBlob } from 'buffer';
|
|
215
|
+
// This conditional type will be the existing global Blob in a browser, or
|
|
216
|
+
// the copy below in a Node environment.
|
|
217
|
+
type __Blob = typeof globalThis extends { onmessage: any; Blob: infer T } ? T : NodeBlob;
|
|
168
218
|
global {
|
|
219
|
+
namespace NodeJS {
|
|
220
|
+
export { BufferEncoding };
|
|
221
|
+
}
|
|
169
222
|
// Buffer class
|
|
170
|
-
type BufferEncoding =
|
|
223
|
+
type BufferEncoding =
|
|
224
|
+
| 'ascii'
|
|
225
|
+
| 'utf8'
|
|
226
|
+
| 'utf-8'
|
|
227
|
+
| 'utf16le'
|
|
228
|
+
| 'ucs2'
|
|
229
|
+
| 'ucs-2'
|
|
230
|
+
| 'base64'
|
|
231
|
+
| 'base64url'
|
|
232
|
+
| 'latin1'
|
|
233
|
+
| 'binary'
|
|
234
|
+
| 'hex';
|
|
171
235
|
type WithImplicitCoercion<T> =
|
|
172
236
|
| T
|
|
173
237
|
| {
|
|
@@ -229,19 +293,27 @@ declare module 'buffer' {
|
|
|
229
293
|
* Array entries outside that range will be truncated to fit into it.
|
|
230
294
|
*
|
|
231
295
|
* ```js
|
|
232
|
-
* import { Buffer } from 'buffer';
|
|
296
|
+
* import { Buffer } from 'node:buffer';
|
|
233
297
|
*
|
|
234
298
|
* // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
|
|
235
299
|
* const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
|
|
236
300
|
* ```
|
|
237
301
|
*
|
|
302
|
+
* If `array` is an `Array`\-like object (that is, one with a `length` property of
|
|
303
|
+
* type `number`), it is treated as if it is an array, unless it is a `Buffer` or
|
|
304
|
+
* a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`.
|
|
305
|
+
*
|
|
238
306
|
* A `TypeError` will be thrown if `array` is not an `Array` or another type
|
|
239
307
|
* appropriate for `Buffer.from()` variants.
|
|
240
308
|
*
|
|
241
309
|
* `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
|
|
242
310
|
* @since v5.10.0
|
|
243
311
|
*/
|
|
244
|
-
from(
|
|
312
|
+
from(
|
|
313
|
+
arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
|
|
314
|
+
byteOffset?: number,
|
|
315
|
+
length?: number,
|
|
316
|
+
): Buffer;
|
|
245
317
|
/**
|
|
246
318
|
* Creates a new Buffer using the passed {data}
|
|
247
319
|
* @param data data to create a new Buffer
|
|
@@ -259,7 +331,7 @@ declare module 'buffer' {
|
|
|
259
331
|
| {
|
|
260
332
|
[Symbol.toPrimitive](hint: 'string'): string;
|
|
261
333
|
},
|
|
262
|
-
encoding?: BufferEncoding
|
|
334
|
+
encoding?: BufferEncoding,
|
|
263
335
|
): Buffer;
|
|
264
336
|
/**
|
|
265
337
|
* Creates a new Buffer using the passed {data}
|
|
@@ -270,7 +342,7 @@ declare module 'buffer' {
|
|
|
270
342
|
* Returns `true` if `obj` is a `Buffer`, `false` otherwise.
|
|
271
343
|
*
|
|
272
344
|
* ```js
|
|
273
|
-
* import { Buffer } from 'buffer';
|
|
345
|
+
* import { Buffer } from 'node:buffer';
|
|
274
346
|
*
|
|
275
347
|
* Buffer.isBuffer(Buffer.alloc(10)); // true
|
|
276
348
|
* Buffer.isBuffer(Buffer.from('foo')); // true
|
|
@@ -286,7 +358,7 @@ declare module 'buffer' {
|
|
|
286
358
|
* or `false` otherwise.
|
|
287
359
|
*
|
|
288
360
|
* ```js
|
|
289
|
-
* import { Buffer } from 'buffer';
|
|
361
|
+
* import { Buffer } from 'node:buffer';
|
|
290
362
|
*
|
|
291
363
|
* console.log(Buffer.isEncoding('utf8'));
|
|
292
364
|
* // Prints: true
|
|
@@ -315,7 +387,7 @@ declare module 'buffer' {
|
|
|
315
387
|
* string.
|
|
316
388
|
*
|
|
317
389
|
* ```js
|
|
318
|
-
* import { Buffer } from 'buffer';
|
|
390
|
+
* import { Buffer } from 'node:buffer';
|
|
319
391
|
*
|
|
320
392
|
* const str = '\u00bd + \u00bc = \u00be';
|
|
321
393
|
*
|
|
@@ -333,7 +405,10 @@ declare module 'buffer' {
|
|
|
333
405
|
* @param [encoding='utf8'] If `string` is a string, this is its encoding.
|
|
334
406
|
* @return The number of bytes contained within `string`.
|
|
335
407
|
*/
|
|
336
|
-
byteLength(
|
|
408
|
+
byteLength(
|
|
409
|
+
string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
|
|
410
|
+
encoding?: BufferEncoding,
|
|
411
|
+
): number;
|
|
337
412
|
/**
|
|
338
413
|
* Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
|
|
339
414
|
*
|
|
@@ -347,7 +422,7 @@ declare module 'buffer' {
|
|
|
347
422
|
* truncated to `totalLength`.
|
|
348
423
|
*
|
|
349
424
|
* ```js
|
|
350
|
-
* import { Buffer } from 'buffer';
|
|
425
|
+
* import { Buffer } from 'node:buffer';
|
|
351
426
|
*
|
|
352
427
|
* // Create a single `Buffer` from a list of three `Buffer` instances.
|
|
353
428
|
*
|
|
@@ -373,11 +448,28 @@ declare module 'buffer' {
|
|
|
373
448
|
* @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
|
|
374
449
|
*/
|
|
375
450
|
concat(list: ReadonlyArray<Uint8Array>, totalLength?: number): Buffer;
|
|
451
|
+
/**
|
|
452
|
+
* Copies the underlying memory of `view` into a new `Buffer`.
|
|
453
|
+
*
|
|
454
|
+
* ```js
|
|
455
|
+
* const u16 = new Uint16Array([0, 0xffff]);
|
|
456
|
+
* const buf = Buffer.copyBytesFrom(u16, 1, 1);
|
|
457
|
+
* u16[1] = 0;
|
|
458
|
+
* console.log(buf.length); // 2
|
|
459
|
+
* console.log(buf[0]); // 255
|
|
460
|
+
* console.log(buf[1]); // 255
|
|
461
|
+
* ```
|
|
462
|
+
* @since v19.8.0
|
|
463
|
+
* @param view The {TypedArray} to copy.
|
|
464
|
+
* @param [offset=': 0'] The starting offset within `view`.
|
|
465
|
+
* @param [length=view.length - offset] The number of elements from `view` to copy.
|
|
466
|
+
*/
|
|
467
|
+
copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer;
|
|
376
468
|
/**
|
|
377
469
|
* Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
|
|
378
470
|
*
|
|
379
471
|
* ```js
|
|
380
|
-
* import { Buffer } from 'buffer';
|
|
472
|
+
* import { Buffer } from 'node:buffer';
|
|
381
473
|
*
|
|
382
474
|
* const buf1 = Buffer.from('1234');
|
|
383
475
|
* const buf2 = Buffer.from('0123');
|
|
@@ -395,7 +487,7 @@ declare module 'buffer' {
|
|
|
395
487
|
* Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
|
|
396
488
|
*
|
|
397
489
|
* ```js
|
|
398
|
-
* import { Buffer } from 'buffer';
|
|
490
|
+
* import { Buffer } from 'node:buffer';
|
|
399
491
|
*
|
|
400
492
|
* const buf = Buffer.alloc(5);
|
|
401
493
|
*
|
|
@@ -403,12 +495,12 @@ declare module 'buffer' {
|
|
|
403
495
|
* // Prints: <Buffer 00 00 00 00 00>
|
|
404
496
|
* ```
|
|
405
497
|
*
|
|
406
|
-
* If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `
|
|
498
|
+
* If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
|
|
407
499
|
*
|
|
408
500
|
* If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
|
|
409
501
|
*
|
|
410
502
|
* ```js
|
|
411
|
-
* import { Buffer } from 'buffer';
|
|
503
|
+
* import { Buffer } from 'node:buffer';
|
|
412
504
|
*
|
|
413
505
|
* const buf = Buffer.alloc(5, 'a');
|
|
414
506
|
*
|
|
@@ -420,7 +512,7 @@ declare module 'buffer' {
|
|
|
420
512
|
* initialized by calling `buf.fill(fill, encoding)`.
|
|
421
513
|
*
|
|
422
514
|
* ```js
|
|
423
|
-
* import { Buffer } from 'buffer';
|
|
515
|
+
* import { Buffer } from 'node:buffer';
|
|
424
516
|
*
|
|
425
517
|
* const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
|
|
426
518
|
*
|
|
@@ -440,13 +532,13 @@ declare module 'buffer' {
|
|
|
440
532
|
*/
|
|
441
533
|
alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
|
|
442
534
|
/**
|
|
443
|
-
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `
|
|
535
|
+
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
|
|
444
536
|
*
|
|
445
537
|
* The underlying memory for `Buffer` instances created in this way is _not_
|
|
446
538
|
* _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
|
|
447
539
|
*
|
|
448
540
|
* ```js
|
|
449
|
-
* import { Buffer } from 'buffer';
|
|
541
|
+
* import { Buffer } from 'node:buffer';
|
|
450
542
|
*
|
|
451
543
|
* const buf = Buffer.allocUnsafe(10);
|
|
452
544
|
*
|
|
@@ -462,9 +554,8 @@ declare module 'buffer' {
|
|
|
462
554
|
* A `TypeError` will be thrown if `size` is not a number.
|
|
463
555
|
*
|
|
464
556
|
* The `Buffer` module pre-allocates an internal `Buffer` instance of
|
|
465
|
-
* size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()
|
|
466
|
-
*
|
|
467
|
-
* to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
|
|
557
|
+
* size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
|
|
558
|
+
* and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two).
|
|
468
559
|
*
|
|
469
560
|
* Use of this pre-allocated internal memory pool is a key difference between
|
|
470
561
|
* calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
|
|
@@ -477,15 +568,15 @@ declare module 'buffer' {
|
|
|
477
568
|
*/
|
|
478
569
|
allocUnsafe(size: number): Buffer;
|
|
479
570
|
/**
|
|
480
|
-
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `
|
|
481
|
-
*
|
|
571
|
+
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if
|
|
572
|
+
* `size` is 0.
|
|
482
573
|
*
|
|
483
574
|
* The underlying memory for `Buffer` instances created in this way is _not_
|
|
484
|
-
* _initialized_. The contents of the newly created `Buffer` are unknown
|
|
575
|
+
* _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize
|
|
485
576
|
* such `Buffer` instances with zeroes.
|
|
486
577
|
*
|
|
487
578
|
* When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
|
|
488
|
-
* allocations under 4
|
|
579
|
+
* allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This
|
|
489
580
|
* allows applications to avoid the garbage collection overhead of creating many
|
|
490
581
|
* individually allocated `Buffer` instances. This approach improves both
|
|
491
582
|
* performance and memory usage by eliminating the need to track and clean up as
|
|
@@ -497,7 +588,7 @@ declare module 'buffer' {
|
|
|
497
588
|
* then copying out the relevant bits.
|
|
498
589
|
*
|
|
499
590
|
* ```js
|
|
500
|
-
* import { Buffer } from 'buffer';
|
|
591
|
+
* import { Buffer } from 'node:buffer';
|
|
501
592
|
*
|
|
502
593
|
* // Need to keep around a few small chunks of memory.
|
|
503
594
|
* const store = [];
|
|
@@ -535,7 +626,7 @@ declare module 'buffer' {
|
|
|
535
626
|
* written. However, partially encoded characters will not be written.
|
|
536
627
|
*
|
|
537
628
|
* ```js
|
|
538
|
-
* import { Buffer } from 'buffer';
|
|
629
|
+
* import { Buffer } from 'node:buffer';
|
|
539
630
|
*
|
|
540
631
|
* const buf = Buffer.alloc(256);
|
|
541
632
|
*
|
|
@@ -571,7 +662,7 @@ declare module 'buffer' {
|
|
|
571
662
|
* as {@link constants.MAX_STRING_LENGTH}.
|
|
572
663
|
*
|
|
573
664
|
* ```js
|
|
574
|
-
* import { Buffer } from 'buffer';
|
|
665
|
+
* import { Buffer } from 'node:buffer';
|
|
575
666
|
*
|
|
576
667
|
* const buf1 = Buffer.allocUnsafe(26);
|
|
577
668
|
*
|
|
@@ -608,7 +699,7 @@ declare module 'buffer' {
|
|
|
608
699
|
* In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
|
|
609
700
|
*
|
|
610
701
|
* ```js
|
|
611
|
-
* import { Buffer } from 'buffer';
|
|
702
|
+
* import { Buffer } from 'node:buffer';
|
|
612
703
|
*
|
|
613
704
|
* const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
|
|
614
705
|
* const json = JSON.stringify(buf);
|
|
@@ -635,7 +726,7 @@ declare module 'buffer' {
|
|
|
635
726
|
* Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
|
|
636
727
|
*
|
|
637
728
|
* ```js
|
|
638
|
-
* import { Buffer } from 'buffer';
|
|
729
|
+
* import { Buffer } from 'node:buffer';
|
|
639
730
|
*
|
|
640
731
|
* const buf1 = Buffer.from('ABC');
|
|
641
732
|
* const buf2 = Buffer.from('414243', 'hex');
|
|
@@ -659,7 +750,7 @@ declare module 'buffer' {
|
|
|
659
750
|
* * `-1` is returned if `target` should come _after_`buf` when sorted.
|
|
660
751
|
*
|
|
661
752
|
* ```js
|
|
662
|
-
* import { Buffer } from 'buffer';
|
|
753
|
+
* import { Buffer } from 'node:buffer';
|
|
663
754
|
*
|
|
664
755
|
* const buf1 = Buffer.from('ABC');
|
|
665
756
|
* const buf2 = Buffer.from('BCD');
|
|
@@ -683,7 +774,7 @@ declare module 'buffer' {
|
|
|
683
774
|
* The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively.
|
|
684
775
|
*
|
|
685
776
|
* ```js
|
|
686
|
-
* import { Buffer } from 'buffer';
|
|
777
|
+
* import { Buffer } from 'node:buffer';
|
|
687
778
|
*
|
|
688
779
|
* const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
|
689
780
|
* const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
|
|
@@ -704,7 +795,13 @@ declare module 'buffer' {
|
|
|
704
795
|
* @param [sourceStart=0] The offset within `buf` at which to begin comparison.
|
|
705
796
|
* @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
|
|
706
797
|
*/
|
|
707
|
-
compare(
|
|
798
|
+
compare(
|
|
799
|
+
target: Uint8Array,
|
|
800
|
+
targetStart?: number,
|
|
801
|
+
targetEnd?: number,
|
|
802
|
+
sourceStart?: number,
|
|
803
|
+
sourceEnd?: number,
|
|
804
|
+
): -1 | 0 | 1;
|
|
708
805
|
/**
|
|
709
806
|
* Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
|
|
710
807
|
*
|
|
@@ -713,7 +810,7 @@ declare module 'buffer' {
|
|
|
713
810
|
* different function arguments.
|
|
714
811
|
*
|
|
715
812
|
* ```js
|
|
716
|
-
* import { Buffer } from 'buffer';
|
|
813
|
+
* import { Buffer } from 'node:buffer';
|
|
717
814
|
*
|
|
718
815
|
* // Create two `Buffer` instances.
|
|
719
816
|
* const buf1 = Buffer.allocUnsafe(26);
|
|
@@ -734,7 +831,7 @@ declare module 'buffer' {
|
|
|
734
831
|
* ```
|
|
735
832
|
*
|
|
736
833
|
* ```js
|
|
737
|
-
* import { Buffer } from 'buffer';
|
|
834
|
+
* import { Buffer } from 'node:buffer';
|
|
738
835
|
*
|
|
739
836
|
* // Create a `Buffer` and copy data from one region to an overlapping region
|
|
740
837
|
* // within the same `Buffer`.
|
|
@@ -763,13 +860,11 @@ declare module 'buffer' {
|
|
|
763
860
|
* Returns a new `Buffer` that references the same memory as the original, but
|
|
764
861
|
* offset and cropped by the `start` and `end` indices.
|
|
765
862
|
*
|
|
766
|
-
* This is the same behavior as `buf.subarray()`.
|
|
767
|
-
*
|
|
768
863
|
* This method is not compatible with the `Uint8Array.prototype.slice()`,
|
|
769
864
|
* which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
|
|
770
865
|
*
|
|
771
866
|
* ```js
|
|
772
|
-
* import { Buffer } from 'buffer';
|
|
867
|
+
* import { Buffer } from 'node:buffer';
|
|
773
868
|
*
|
|
774
869
|
* const buf = Buffer.from('buffer');
|
|
775
870
|
*
|
|
@@ -780,8 +875,17 @@ declare module 'buffer' {
|
|
|
780
875
|
*
|
|
781
876
|
* console.log(buf.toString());
|
|
782
877
|
* // Prints: buffer
|
|
878
|
+
*
|
|
879
|
+
* // With buf.slice(), the original buffer is modified.
|
|
880
|
+
* const notReallyCopiedBuf = buf.slice();
|
|
881
|
+
* notReallyCopiedBuf[0]++;
|
|
882
|
+
* console.log(notReallyCopiedBuf.toString());
|
|
883
|
+
* // Prints: cuffer
|
|
884
|
+
* console.log(buf.toString());
|
|
885
|
+
* // Also prints: cuffer (!)
|
|
783
886
|
* ```
|
|
784
887
|
* @since v0.3.0
|
|
888
|
+
* @deprecated Use `subarray` instead.
|
|
785
889
|
* @param [start=0] Where the new `Buffer` will start.
|
|
786
890
|
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
|
|
787
891
|
*/
|
|
@@ -798,7 +902,7 @@ declare module 'buffer' {
|
|
|
798
902
|
* Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
|
|
799
903
|
*
|
|
800
904
|
* ```js
|
|
801
|
-
* import { Buffer } from 'buffer';
|
|
905
|
+
* import { Buffer } from 'node:buffer';
|
|
802
906
|
*
|
|
803
907
|
* // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
|
|
804
908
|
* // from the original `Buffer`.
|
|
@@ -825,7 +929,7 @@ declare module 'buffer' {
|
|
|
825
929
|
* end of `buf` rather than the beginning.
|
|
826
930
|
*
|
|
827
931
|
* ```js
|
|
828
|
-
* import { Buffer } from 'buffer';
|
|
932
|
+
* import { Buffer } from 'node:buffer';
|
|
829
933
|
*
|
|
830
934
|
* const buf = Buffer.from('buffer');
|
|
831
935
|
*
|
|
@@ -852,7 +956,7 @@ declare module 'buffer' {
|
|
|
852
956
|
* `value` is interpreted and written as a two's complement signed integer.
|
|
853
957
|
*
|
|
854
958
|
* ```js
|
|
855
|
-
* import { Buffer } from 'buffer';
|
|
959
|
+
* import { Buffer } from 'node:buffer';
|
|
856
960
|
*
|
|
857
961
|
* const buf = Buffer.allocUnsafe(8);
|
|
858
962
|
*
|
|
@@ -873,7 +977,7 @@ declare module 'buffer' {
|
|
|
873
977
|
* `value` is interpreted and written as a two's complement signed integer.
|
|
874
978
|
*
|
|
875
979
|
* ```js
|
|
876
|
-
* import { Buffer } from 'buffer';
|
|
980
|
+
* import { Buffer } from 'node:buffer';
|
|
877
981
|
*
|
|
878
982
|
* const buf = Buffer.allocUnsafe(8);
|
|
879
983
|
*
|
|
@@ -894,7 +998,7 @@ declare module 'buffer' {
|
|
|
894
998
|
* This function is also available under the `writeBigUint64BE` alias.
|
|
895
999
|
*
|
|
896
1000
|
* ```js
|
|
897
|
-
* import { Buffer } from 'buffer';
|
|
1001
|
+
* import { Buffer } from 'node:buffer';
|
|
898
1002
|
*
|
|
899
1003
|
* const buf = Buffer.allocUnsafe(8);
|
|
900
1004
|
*
|
|
@@ -918,7 +1022,7 @@ declare module 'buffer' {
|
|
|
918
1022
|
* Writes `value` to `buf` at the specified `offset` as little-endian
|
|
919
1023
|
*
|
|
920
1024
|
* ```js
|
|
921
|
-
* import { Buffer } from 'buffer';
|
|
1025
|
+
* import { Buffer } from 'node:buffer';
|
|
922
1026
|
*
|
|
923
1027
|
* const buf = Buffer.allocUnsafe(8);
|
|
924
1028
|
*
|
|
@@ -947,7 +1051,7 @@ declare module 'buffer' {
|
|
|
947
1051
|
* This function is also available under the `writeUintLE` alias.
|
|
948
1052
|
*
|
|
949
1053
|
* ```js
|
|
950
|
-
* import { Buffer } from 'buffer';
|
|
1054
|
+
* import { Buffer } from 'node:buffer';
|
|
951
1055
|
*
|
|
952
1056
|
* const buf = Buffer.allocUnsafe(6);
|
|
953
1057
|
*
|
|
@@ -975,7 +1079,7 @@ declare module 'buffer' {
|
|
|
975
1079
|
* This function is also available under the `writeUintBE` alias.
|
|
976
1080
|
*
|
|
977
1081
|
* ```js
|
|
978
|
-
* import { Buffer } from 'buffer';
|
|
1082
|
+
* import { Buffer } from 'node:buffer';
|
|
979
1083
|
*
|
|
980
1084
|
* const buf = Buffer.allocUnsafe(6);
|
|
981
1085
|
*
|
|
@@ -1001,7 +1105,7 @@ declare module 'buffer' {
|
|
|
1001
1105
|
* when `value` is anything other than a signed integer.
|
|
1002
1106
|
*
|
|
1003
1107
|
* ```js
|
|
1004
|
-
* import { Buffer } from 'buffer';
|
|
1108
|
+
* import { Buffer } from 'node:buffer';
|
|
1005
1109
|
*
|
|
1006
1110
|
* const buf = Buffer.allocUnsafe(6);
|
|
1007
1111
|
*
|
|
@@ -1022,7 +1126,7 @@ declare module 'buffer' {
|
|
|
1022
1126
|
* signed integer.
|
|
1023
1127
|
*
|
|
1024
1128
|
* ```js
|
|
1025
|
-
* import { Buffer } from 'buffer';
|
|
1129
|
+
* import { Buffer } from 'node:buffer';
|
|
1026
1130
|
*
|
|
1027
1131
|
* const buf = Buffer.allocUnsafe(6);
|
|
1028
1132
|
*
|
|
@@ -1044,7 +1148,7 @@ declare module 'buffer' {
|
|
|
1044
1148
|
* This function is also available under the `readBigUint64BE` alias.
|
|
1045
1149
|
*
|
|
1046
1150
|
* ```js
|
|
1047
|
-
* import { Buffer } from 'buffer';
|
|
1151
|
+
* import { Buffer } from 'node:buffer';
|
|
1048
1152
|
*
|
|
1049
1153
|
* const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
|
|
1050
1154
|
*
|
|
@@ -1066,7 +1170,7 @@ declare module 'buffer' {
|
|
|
1066
1170
|
* This function is also available under the `readBigUint64LE` alias.
|
|
1067
1171
|
*
|
|
1068
1172
|
* ```js
|
|
1069
|
-
* import { Buffer } from 'buffer';
|
|
1173
|
+
* import { Buffer } from 'node:buffer';
|
|
1070
1174
|
*
|
|
1071
1175
|
* const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
|
|
1072
1176
|
*
|
|
@@ -1107,7 +1211,7 @@ declare module 'buffer' {
|
|
|
1107
1211
|
* This function is also available under the `readUintLE` alias.
|
|
1108
1212
|
*
|
|
1109
1213
|
* ```js
|
|
1110
|
-
* import { Buffer } from 'buffer';
|
|
1214
|
+
* import { Buffer } from 'node:buffer';
|
|
1111
1215
|
*
|
|
1112
1216
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
|
1113
1217
|
*
|
|
@@ -1131,7 +1235,7 @@ declare module 'buffer' {
|
|
|
1131
1235
|
* This function is also available under the `readUintBE` alias.
|
|
1132
1236
|
*
|
|
1133
1237
|
* ```js
|
|
1134
|
-
* import { Buffer } from 'buffer';
|
|
1238
|
+
* import { Buffer } from 'node:buffer';
|
|
1135
1239
|
*
|
|
1136
1240
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
|
1137
1241
|
*
|
|
@@ -1155,7 +1259,7 @@ declare module 'buffer' {
|
|
|
1155
1259
|
* supporting up to 48 bits of accuracy.
|
|
1156
1260
|
*
|
|
1157
1261
|
* ```js
|
|
1158
|
-
* import { Buffer } from 'buffer';
|
|
1262
|
+
* import { Buffer } from 'node:buffer';
|
|
1159
1263
|
*
|
|
1160
1264
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
|
1161
1265
|
*
|
|
@@ -1172,7 +1276,7 @@ declare module 'buffer' {
|
|
|
1172
1276
|
* supporting up to 48 bits of accuracy.
|
|
1173
1277
|
*
|
|
1174
1278
|
* ```js
|
|
1175
|
-
* import { Buffer } from 'buffer';
|
|
1279
|
+
* import { Buffer } from 'node:buffer';
|
|
1176
1280
|
*
|
|
1177
1281
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
|
|
1178
1282
|
*
|
|
@@ -1194,7 +1298,7 @@ declare module 'buffer' {
|
|
|
1194
1298
|
* This function is also available under the `readUint8` alias.
|
|
1195
1299
|
*
|
|
1196
1300
|
* ```js
|
|
1197
|
-
* import { Buffer } from 'buffer';
|
|
1301
|
+
* import { Buffer } from 'node:buffer';
|
|
1198
1302
|
*
|
|
1199
1303
|
* const buf = Buffer.from([1, -2]);
|
|
1200
1304
|
*
|
|
@@ -1220,7 +1324,7 @@ declare module 'buffer' {
|
|
|
1220
1324
|
* This function is also available under the `readUint16LE` alias.
|
|
1221
1325
|
*
|
|
1222
1326
|
* ```js
|
|
1223
|
-
* import { Buffer } from 'buffer';
|
|
1327
|
+
* import { Buffer } from 'node:buffer';
|
|
1224
1328
|
*
|
|
1225
1329
|
* const buf = Buffer.from([0x12, 0x34, 0x56]);
|
|
1226
1330
|
*
|
|
@@ -1246,7 +1350,7 @@ declare module 'buffer' {
|
|
|
1246
1350
|
* This function is also available under the `readUint16BE` alias.
|
|
1247
1351
|
*
|
|
1248
1352
|
* ```js
|
|
1249
|
-
* import { Buffer } from 'buffer';
|
|
1353
|
+
* import { Buffer } from 'node:buffer';
|
|
1250
1354
|
*
|
|
1251
1355
|
* const buf = Buffer.from([0x12, 0x34, 0x56]);
|
|
1252
1356
|
*
|
|
@@ -1270,7 +1374,7 @@ declare module 'buffer' {
|
|
|
1270
1374
|
* This function is also available under the `readUint32LE` alias.
|
|
1271
1375
|
*
|
|
1272
1376
|
* ```js
|
|
1273
|
-
* import { Buffer } from 'buffer';
|
|
1377
|
+
* import { Buffer } from 'node:buffer';
|
|
1274
1378
|
*
|
|
1275
1379
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
|
|
1276
1380
|
*
|
|
@@ -1294,7 +1398,7 @@ declare module 'buffer' {
|
|
|
1294
1398
|
* This function is also available under the `readUint32BE` alias.
|
|
1295
1399
|
*
|
|
1296
1400
|
* ```js
|
|
1297
|
-
* import { Buffer } from 'buffer';
|
|
1401
|
+
* import { Buffer } from 'node:buffer';
|
|
1298
1402
|
*
|
|
1299
1403
|
* const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
|
|
1300
1404
|
*
|
|
@@ -1316,7 +1420,7 @@ declare module 'buffer' {
|
|
|
1316
1420
|
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
|
1317
1421
|
*
|
|
1318
1422
|
* ```js
|
|
1319
|
-
* import { Buffer } from 'buffer';
|
|
1423
|
+
* import { Buffer } from 'node:buffer';
|
|
1320
1424
|
*
|
|
1321
1425
|
* const buf = Buffer.from([-1, 5]);
|
|
1322
1426
|
*
|
|
@@ -1337,7 +1441,7 @@ declare module 'buffer' {
|
|
|
1337
1441
|
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
|
1338
1442
|
*
|
|
1339
1443
|
* ```js
|
|
1340
|
-
* import { Buffer } from 'buffer';
|
|
1444
|
+
* import { Buffer } from 'node:buffer';
|
|
1341
1445
|
*
|
|
1342
1446
|
* const buf = Buffer.from([0, 5]);
|
|
1343
1447
|
*
|
|
@@ -1356,7 +1460,7 @@ declare module 'buffer' {
|
|
|
1356
1460
|
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
|
1357
1461
|
*
|
|
1358
1462
|
* ```js
|
|
1359
|
-
* import { Buffer } from 'buffer';
|
|
1463
|
+
* import { Buffer } from 'node:buffer';
|
|
1360
1464
|
*
|
|
1361
1465
|
* const buf = Buffer.from([0, 5]);
|
|
1362
1466
|
*
|
|
@@ -1373,7 +1477,7 @@ declare module 'buffer' {
|
|
|
1373
1477
|
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
|
1374
1478
|
*
|
|
1375
1479
|
* ```js
|
|
1376
|
-
* import { Buffer } from 'buffer';
|
|
1480
|
+
* import { Buffer } from 'node:buffer';
|
|
1377
1481
|
*
|
|
1378
1482
|
* const buf = Buffer.from([0, 0, 0, 5]);
|
|
1379
1483
|
*
|
|
@@ -1392,7 +1496,7 @@ declare module 'buffer' {
|
|
|
1392
1496
|
* Integers read from a `Buffer` are interpreted as two's complement signed values.
|
|
1393
1497
|
*
|
|
1394
1498
|
* ```js
|
|
1395
|
-
* import { Buffer } from 'buffer';
|
|
1499
|
+
* import { Buffer } from 'node:buffer';
|
|
1396
1500
|
*
|
|
1397
1501
|
* const buf = Buffer.from([0, 0, 0, 5]);
|
|
1398
1502
|
*
|
|
@@ -1407,7 +1511,7 @@ declare module 'buffer' {
|
|
|
1407
1511
|
* Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
|
|
1408
1512
|
*
|
|
1409
1513
|
* ```js
|
|
1410
|
-
* import { Buffer } from 'buffer';
|
|
1514
|
+
* import { Buffer } from 'node:buffer';
|
|
1411
1515
|
*
|
|
1412
1516
|
* const buf = Buffer.from([1, 2, 3, 4]);
|
|
1413
1517
|
*
|
|
@@ -1424,7 +1528,7 @@ declare module 'buffer' {
|
|
|
1424
1528
|
* Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
|
|
1425
1529
|
*
|
|
1426
1530
|
* ```js
|
|
1427
|
-
* import { Buffer } from 'buffer';
|
|
1531
|
+
* import { Buffer } from 'node:buffer';
|
|
1428
1532
|
*
|
|
1429
1533
|
* const buf = Buffer.from([1, 2, 3, 4]);
|
|
1430
1534
|
*
|
|
@@ -1439,7 +1543,7 @@ declare module 'buffer' {
|
|
|
1439
1543
|
* Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
|
|
1440
1544
|
*
|
|
1441
1545
|
* ```js
|
|
1442
|
-
* import { Buffer } from 'buffer';
|
|
1546
|
+
* import { Buffer } from 'node:buffer';
|
|
1443
1547
|
*
|
|
1444
1548
|
* const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
|
|
1445
1549
|
*
|
|
@@ -1456,7 +1560,7 @@ declare module 'buffer' {
|
|
|
1456
1560
|
* Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
|
|
1457
1561
|
*
|
|
1458
1562
|
* ```js
|
|
1459
|
-
* import { Buffer } from 'buffer';
|
|
1563
|
+
* import { Buffer } from 'node:buffer';
|
|
1460
1564
|
*
|
|
1461
1565
|
* const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
|
|
1462
1566
|
*
|
|
@@ -1473,7 +1577,7 @@ declare module 'buffer' {
|
|
|
1473
1577
|
* byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
|
|
1474
1578
|
*
|
|
1475
1579
|
* ```js
|
|
1476
|
-
* import { Buffer } from 'buffer';
|
|
1580
|
+
* import { Buffer } from 'node:buffer';
|
|
1477
1581
|
*
|
|
1478
1582
|
* const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
|
1479
1583
|
*
|
|
@@ -1495,7 +1599,7 @@ declare module 'buffer' {
|
|
|
1495
1599
|
* between UTF-16 little-endian and UTF-16 big-endian:
|
|
1496
1600
|
*
|
|
1497
1601
|
* ```js
|
|
1498
|
-
* import { Buffer } from 'buffer';
|
|
1602
|
+
* import { Buffer } from 'node:buffer';
|
|
1499
1603
|
*
|
|
1500
1604
|
* const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
|
|
1501
1605
|
* buf.swap16(); // Convert to big-endian UTF-16 text.
|
|
@@ -1509,7 +1613,7 @@ declare module 'buffer' {
|
|
|
1509
1613
|
* byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
|
|
1510
1614
|
*
|
|
1511
1615
|
* ```js
|
|
1512
|
-
* import { Buffer } from 'buffer';
|
|
1616
|
+
* import { Buffer } from 'node:buffer';
|
|
1513
1617
|
*
|
|
1514
1618
|
* const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
|
1515
1619
|
*
|
|
@@ -1535,7 +1639,7 @@ declare module 'buffer' {
|
|
|
1535
1639
|
* Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
|
|
1536
1640
|
*
|
|
1537
1641
|
* ```js
|
|
1538
|
-
* import { Buffer } from 'buffer';
|
|
1642
|
+
* import { Buffer } from 'node:buffer';
|
|
1539
1643
|
*
|
|
1540
1644
|
* const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
|
|
1541
1645
|
*
|
|
@@ -1564,7 +1668,7 @@ declare module 'buffer' {
|
|
|
1564
1668
|
* This function is also available under the `writeUint8` alias.
|
|
1565
1669
|
*
|
|
1566
1670
|
* ```js
|
|
1567
|
-
* import { Buffer } from 'buffer';
|
|
1671
|
+
* import { Buffer } from 'node:buffer';
|
|
1568
1672
|
*
|
|
1569
1673
|
* const buf = Buffer.allocUnsafe(4);
|
|
1570
1674
|
*
|
|
@@ -1594,7 +1698,7 @@ declare module 'buffer' {
|
|
|
1594
1698
|
* This function is also available under the `writeUint16LE` alias.
|
|
1595
1699
|
*
|
|
1596
1700
|
* ```js
|
|
1597
|
-
* import { Buffer } from 'buffer';
|
|
1701
|
+
* import { Buffer } from 'node:buffer';
|
|
1598
1702
|
*
|
|
1599
1703
|
* const buf = Buffer.allocUnsafe(4);
|
|
1600
1704
|
*
|
|
@@ -1622,7 +1726,7 @@ declare module 'buffer' {
|
|
|
1622
1726
|
* This function is also available under the `writeUint16BE` alias.
|
|
1623
1727
|
*
|
|
1624
1728
|
* ```js
|
|
1625
|
-
* import { Buffer } from 'buffer';
|
|
1729
|
+
* import { Buffer } from 'node:buffer';
|
|
1626
1730
|
*
|
|
1627
1731
|
* const buf = Buffer.allocUnsafe(4);
|
|
1628
1732
|
*
|
|
@@ -1650,7 +1754,7 @@ declare module 'buffer' {
|
|
|
1650
1754
|
* This function is also available under the `writeUint32LE` alias.
|
|
1651
1755
|
*
|
|
1652
1756
|
* ```js
|
|
1653
|
-
* import { Buffer } from 'buffer';
|
|
1757
|
+
* import { Buffer } from 'node:buffer';
|
|
1654
1758
|
*
|
|
1655
1759
|
* const buf = Buffer.allocUnsafe(4);
|
|
1656
1760
|
*
|
|
@@ -1677,7 +1781,7 @@ declare module 'buffer' {
|
|
|
1677
1781
|
* This function is also available under the `writeUint32BE` alias.
|
|
1678
1782
|
*
|
|
1679
1783
|
* ```js
|
|
1680
|
-
* import { Buffer } from 'buffer';
|
|
1784
|
+
* import { Buffer } from 'node:buffer';
|
|
1681
1785
|
*
|
|
1682
1786
|
* const buf = Buffer.allocUnsafe(4);
|
|
1683
1787
|
*
|
|
@@ -1705,7 +1809,7 @@ declare module 'buffer' {
|
|
|
1705
1809
|
* `value` is interpreted and written as a two's complement signed integer.
|
|
1706
1810
|
*
|
|
1707
1811
|
* ```js
|
|
1708
|
-
* import { Buffer } from 'buffer';
|
|
1812
|
+
* import { Buffer } from 'node:buffer';
|
|
1709
1813
|
*
|
|
1710
1814
|
* const buf = Buffer.allocUnsafe(2);
|
|
1711
1815
|
*
|
|
@@ -1728,7 +1832,7 @@ declare module 'buffer' {
|
|
|
1728
1832
|
* The `value` is interpreted and written as a two's complement signed integer.
|
|
1729
1833
|
*
|
|
1730
1834
|
* ```js
|
|
1731
|
-
* import { Buffer } from 'buffer';
|
|
1835
|
+
* import { Buffer } from 'node:buffer';
|
|
1732
1836
|
*
|
|
1733
1837
|
* const buf = Buffer.allocUnsafe(2);
|
|
1734
1838
|
*
|
|
@@ -1750,7 +1854,7 @@ declare module 'buffer' {
|
|
|
1750
1854
|
* The `value` is interpreted and written as a two's complement signed integer.
|
|
1751
1855
|
*
|
|
1752
1856
|
* ```js
|
|
1753
|
-
* import { Buffer } from 'buffer';
|
|
1857
|
+
* import { Buffer } from 'node:buffer';
|
|
1754
1858
|
*
|
|
1755
1859
|
* const buf = Buffer.allocUnsafe(2);
|
|
1756
1860
|
*
|
|
@@ -1772,7 +1876,7 @@ declare module 'buffer' {
|
|
|
1772
1876
|
* The `value` is interpreted and written as a two's complement signed integer.
|
|
1773
1877
|
*
|
|
1774
1878
|
* ```js
|
|
1775
|
-
* import { Buffer } from 'buffer';
|
|
1879
|
+
* import { Buffer } from 'node:buffer';
|
|
1776
1880
|
*
|
|
1777
1881
|
* const buf = Buffer.allocUnsafe(4);
|
|
1778
1882
|
*
|
|
@@ -1794,7 +1898,7 @@ declare module 'buffer' {
|
|
|
1794
1898
|
* The `value` is interpreted and written as a two's complement signed integer.
|
|
1795
1899
|
*
|
|
1796
1900
|
* ```js
|
|
1797
|
-
* import { Buffer } from 'buffer';
|
|
1901
|
+
* import { Buffer } from 'node:buffer';
|
|
1798
1902
|
*
|
|
1799
1903
|
* const buf = Buffer.allocUnsafe(4);
|
|
1800
1904
|
*
|
|
@@ -1814,7 +1918,7 @@ declare module 'buffer' {
|
|
|
1814
1918
|
* undefined when `value` is anything other than a JavaScript number.
|
|
1815
1919
|
*
|
|
1816
1920
|
* ```js
|
|
1817
|
-
* import { Buffer } from 'buffer';
|
|
1921
|
+
* import { Buffer } from 'node:buffer';
|
|
1818
1922
|
*
|
|
1819
1923
|
* const buf = Buffer.allocUnsafe(4);
|
|
1820
1924
|
*
|
|
@@ -1834,7 +1938,7 @@ declare module 'buffer' {
|
|
|
1834
1938
|
* undefined when `value` is anything other than a JavaScript number.
|
|
1835
1939
|
*
|
|
1836
1940
|
* ```js
|
|
1837
|
-
* import { Buffer } from 'buffer';
|
|
1941
|
+
* import { Buffer } from 'node:buffer';
|
|
1838
1942
|
*
|
|
1839
1943
|
* const buf = Buffer.allocUnsafe(4);
|
|
1840
1944
|
*
|
|
@@ -1854,7 +1958,7 @@ declare module 'buffer' {
|
|
|
1854
1958
|
* other than a JavaScript number.
|
|
1855
1959
|
*
|
|
1856
1960
|
* ```js
|
|
1857
|
-
* import { Buffer } from 'buffer';
|
|
1961
|
+
* import { Buffer } from 'node:buffer';
|
|
1858
1962
|
*
|
|
1859
1963
|
* const buf = Buffer.allocUnsafe(8);
|
|
1860
1964
|
*
|
|
@@ -1874,7 +1978,7 @@ declare module 'buffer' {
|
|
|
1874
1978
|
* other than a JavaScript number.
|
|
1875
1979
|
*
|
|
1876
1980
|
* ```js
|
|
1877
|
-
* import { Buffer } from 'buffer';
|
|
1981
|
+
* import { Buffer } from 'node:buffer';
|
|
1878
1982
|
*
|
|
1879
1983
|
* const buf = Buffer.allocUnsafe(8);
|
|
1880
1984
|
*
|
|
@@ -1894,7 +1998,7 @@ declare module 'buffer' {
|
|
|
1894
1998
|
* the entire `buf` will be filled:
|
|
1895
1999
|
*
|
|
1896
2000
|
* ```js
|
|
1897
|
-
* import { Buffer } from 'buffer';
|
|
2001
|
+
* import { Buffer } from 'node:buffer';
|
|
1898
2002
|
*
|
|
1899
2003
|
* // Fill a `Buffer` with the ASCII character 'h'.
|
|
1900
2004
|
*
|
|
@@ -1902,6 +2006,12 @@ declare module 'buffer' {
|
|
|
1902
2006
|
*
|
|
1903
2007
|
* console.log(b.toString());
|
|
1904
2008
|
* // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
|
|
2009
|
+
*
|
|
2010
|
+
* // Fill a buffer with empty string
|
|
2011
|
+
* const c = Buffer.allocUnsafe(5).fill('');
|
|
2012
|
+
*
|
|
2013
|
+
* console.log(c.fill(''));
|
|
2014
|
+
* // Prints: <Buffer 00 00 00 00 00>
|
|
1905
2015
|
* ```
|
|
1906
2016
|
*
|
|
1907
2017
|
* `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
|
|
@@ -1912,7 +2022,7 @@ declare module 'buffer' {
|
|
|
1912
2022
|
* then only the bytes of that character that fit into `buf` are written:
|
|
1913
2023
|
*
|
|
1914
2024
|
* ```js
|
|
1915
|
-
* import { Buffer } from 'buffer';
|
|
2025
|
+
* import { Buffer } from 'node:buffer';
|
|
1916
2026
|
*
|
|
1917
2027
|
* // Fill a `Buffer` with character that takes up two bytes in UTF-8.
|
|
1918
2028
|
*
|
|
@@ -1924,7 +2034,7 @@ declare module 'buffer' {
|
|
|
1924
2034
|
* fill data remains, an exception is thrown:
|
|
1925
2035
|
*
|
|
1926
2036
|
* ```js
|
|
1927
|
-
* import { Buffer } from 'buffer';
|
|
2037
|
+
* import { Buffer } from 'node:buffer';
|
|
1928
2038
|
*
|
|
1929
2039
|
* const buf = Buffer.allocUnsafe(5);
|
|
1930
2040
|
*
|
|
@@ -1936,7 +2046,7 @@ declare module 'buffer' {
|
|
|
1936
2046
|
* // Throws an exception.
|
|
1937
2047
|
* ```
|
|
1938
2048
|
* @since v0.5.0
|
|
1939
|
-
* @param value The value with which to fill `buf`.
|
|
2049
|
+
* @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`.
|
|
1940
2050
|
* @param [offset=0] Number of bytes to skip before starting to fill `buf`.
|
|
1941
2051
|
* @param [end=buf.length] Where to stop filling `buf` (not inclusive).
|
|
1942
2052
|
* @param [encoding='utf8'] The encoding for `value` if `value` is a string.
|
|
@@ -1948,12 +2058,12 @@ declare module 'buffer' {
|
|
|
1948
2058
|
*
|
|
1949
2059
|
* * a string, `value` is interpreted according to the character encoding in`encoding`.
|
|
1950
2060
|
* * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety.
|
|
1951
|
-
* To compare a partial `Buffer`, use `buf.
|
|
2061
|
+
* To compare a partial `Buffer`, use `buf.subarray`.
|
|
1952
2062
|
* * a number, `value` will be interpreted as an unsigned 8-bit integer
|
|
1953
2063
|
* value between `0` and `255`.
|
|
1954
2064
|
*
|
|
1955
2065
|
* ```js
|
|
1956
|
-
* import { Buffer } from 'buffer';
|
|
2066
|
+
* import { Buffer } from 'node:buffer';
|
|
1957
2067
|
*
|
|
1958
2068
|
* const buf = Buffer.from('this is a buffer');
|
|
1959
2069
|
*
|
|
@@ -1986,7 +2096,7 @@ declare module 'buffer' {
|
|
|
1986
2096
|
* behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
|
|
1987
2097
|
*
|
|
1988
2098
|
* ```js
|
|
1989
|
-
* import { Buffer } from 'buffer';
|
|
2099
|
+
* import { Buffer } from 'node:buffer';
|
|
1990
2100
|
*
|
|
1991
2101
|
* const b = Buffer.from('abcdef');
|
|
1992
2102
|
*
|
|
@@ -2017,7 +2127,7 @@ declare module 'buffer' {
|
|
|
2017
2127
|
* rather than the first occurrence.
|
|
2018
2128
|
*
|
|
2019
2129
|
* ```js
|
|
2020
|
-
* import { Buffer } from 'buffer';
|
|
2130
|
+
* import { Buffer } from 'node:buffer';
|
|
2021
2131
|
*
|
|
2022
2132
|
* const buf = Buffer.from('this buffer is a buffer');
|
|
2023
2133
|
*
|
|
@@ -2052,7 +2162,7 @@ declare module 'buffer' {
|
|
|
2052
2162
|
* This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
|
|
2053
2163
|
*
|
|
2054
2164
|
* ```js
|
|
2055
|
-
* import { Buffer } from 'buffer';
|
|
2165
|
+
* import { Buffer } from 'node:buffer';
|
|
2056
2166
|
*
|
|
2057
2167
|
* const b = Buffer.from('abcdef');
|
|
2058
2168
|
*
|
|
@@ -2085,7 +2195,7 @@ declare module 'buffer' {
|
|
|
2085
2195
|
* of `buf`.
|
|
2086
2196
|
*
|
|
2087
2197
|
* ```js
|
|
2088
|
-
* import { Buffer } from 'buffer';
|
|
2198
|
+
* import { Buffer } from 'node:buffer';
|
|
2089
2199
|
*
|
|
2090
2200
|
* // Log the entire contents of a `Buffer`.
|
|
2091
2201
|
*
|
|
@@ -2109,7 +2219,7 @@ declare module 'buffer' {
|
|
|
2109
2219
|
* Equivalent to `buf.indexOf() !== -1`.
|
|
2110
2220
|
*
|
|
2111
2221
|
* ```js
|
|
2112
|
-
* import { Buffer } from 'buffer';
|
|
2222
|
+
* import { Buffer } from 'node:buffer';
|
|
2113
2223
|
*
|
|
2114
2224
|
* const buf = Buffer.from('this is a buffer');
|
|
2115
2225
|
*
|
|
@@ -2139,7 +2249,7 @@ declare module 'buffer' {
|
|
|
2139
2249
|
* Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
|
|
2140
2250
|
*
|
|
2141
2251
|
* ```js
|
|
2142
|
-
* import { Buffer } from 'buffer';
|
|
2252
|
+
* import { Buffer } from 'node:buffer';
|
|
2143
2253
|
*
|
|
2144
2254
|
* const buf = Buffer.from('buffer');
|
|
2145
2255
|
*
|
|
@@ -2162,7 +2272,7 @@ declare module 'buffer' {
|
|
|
2162
2272
|
* called automatically when a `Buffer` is used in a `for..of` statement.
|
|
2163
2273
|
*
|
|
2164
2274
|
* ```js
|
|
2165
|
-
* import { Buffer } from 'buffer';
|
|
2275
|
+
* import { Buffer } from 'node:buffer';
|
|
2166
2276
|
*
|
|
2167
2277
|
* const buf = Buffer.from('buffer');
|
|
2168
2278
|
*
|
|
@@ -2205,7 +2315,7 @@ declare module 'buffer' {
|
|
|
2205
2315
|
* **For code running using Node.js APIs, converting between base64-encoded strings**
|
|
2206
2316
|
* **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
|
|
2207
2317
|
* @since v15.13.0, v14.17.0
|
|
2208
|
-
* @
|
|
2318
|
+
* @legacy Use `Buffer.from(data, 'base64')` instead.
|
|
2209
2319
|
* @param data The Base64-encoded input string.
|
|
2210
2320
|
*/
|
|
2211
2321
|
function atob(data: string): string;
|
|
@@ -2221,10 +2331,22 @@ declare module 'buffer' {
|
|
|
2221
2331
|
* **For code running using Node.js APIs, converting between base64-encoded strings**
|
|
2222
2332
|
* **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
|
|
2223
2333
|
* @since v15.13.0, v14.17.0
|
|
2224
|
-
* @
|
|
2334
|
+
* @legacy Use `buf.toString('base64')` instead.
|
|
2225
2335
|
* @param data An ASCII (Latin1) string.
|
|
2226
2336
|
*/
|
|
2227
2337
|
function btoa(data: string): string;
|
|
2338
|
+
interface Blob extends __Blob {}
|
|
2339
|
+
/**
|
|
2340
|
+
* `Blob` class is a global reference for `require('node:buffer').Blob`
|
|
2341
|
+
* https://nodejs.org/api/buffer.html#class-blob
|
|
2342
|
+
* @since v18.0.0
|
|
2343
|
+
*/
|
|
2344
|
+
var Blob: typeof globalThis extends {
|
|
2345
|
+
onmessage: any;
|
|
2346
|
+
Blob: infer T;
|
|
2347
|
+
}
|
|
2348
|
+
? T
|
|
2349
|
+
: typeof NodeBlob;
|
|
2228
2350
|
}
|
|
2229
2351
|
}
|
|
2230
2352
|
declare module 'node:buffer' {
|