cdk-ecr-deployment 3.3.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (539) hide show
  1. package/.jsii +2 -6
  2. package/lib/index.js +3 -3
  3. package/package.json +1 -13
  4. package/build-lambda.sh +0 -12
  5. package/node_modules/@sindresorhus/is/dist/index.d.ts +0 -232
  6. package/node_modules/@sindresorhus/is/dist/index.js +0 -434
  7. package/node_modules/@sindresorhus/is/dist/types.d.ts +0 -25
  8. package/node_modules/@sindresorhus/is/dist/types.js +0 -3
  9. package/node_modules/@sindresorhus/is/license +0 -9
  10. package/node_modules/@sindresorhus/is/package.json +0 -96
  11. package/node_modules/@sindresorhus/is/readme.md +0 -669
  12. package/node_modules/@szmarczak/http-timer/LICENSE +0 -21
  13. package/node_modules/@szmarczak/http-timer/README.md +0 -93
  14. package/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +0 -32
  15. package/node_modules/@szmarczak/http-timer/dist/source/index.js +0 -126
  16. package/node_modules/@szmarczak/http-timer/package.json +0 -72
  17. package/node_modules/@types/cacheable-request/LICENSE +0 -21
  18. package/node_modules/@types/cacheable-request/README.md +0 -16
  19. package/node_modules/@types/cacheable-request/index.d.ts +0 -137
  20. package/node_modules/@types/cacheable-request/node_modules/@types/node/LICENSE +0 -21
  21. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +0 -15
  22. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +0 -8
  23. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +0 -1095
  24. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +0 -541
  25. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.buffer.d.ts +0 -460
  26. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +0 -1926
  27. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +0 -1549
  28. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +0 -579
  29. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  30. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/index.d.ts +0 -9
  31. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  32. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  33. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +0 -452
  34. package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +0 -21
  35. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +0 -4510
  36. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +0 -599
  37. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  38. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +0 -476
  39. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +0 -865
  40. package/node_modules/@types/cacheable-request/node_modules/@types/node/dom-events.d.ts +0 -124
  41. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +0 -170
  42. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +0 -931
  43. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +0 -1275
  44. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +0 -4343
  45. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +0 -511
  46. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  47. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +0 -1959
  48. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +0 -2558
  49. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +0 -543
  50. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +0 -92
  51. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +0 -3966
  52. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +0 -702
  53. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +0 -1029
  54. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +0 -495
  55. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +0 -220
  56. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +0 -200
  57. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +0 -970
  58. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +0 -2013
  59. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +0 -117
  60. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +0 -153
  61. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +0 -162
  62. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +0 -589
  63. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +0 -430
  64. package/node_modules/@types/cacheable-request/node_modules/@types/node/sea.d.ts +0 -153
  65. package/node_modules/@types/cacheable-request/node_modules/@types/node/sqlite.d.ts +0 -439
  66. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +0 -12
  67. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +0 -90
  68. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +0 -614
  69. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +0 -1662
  70. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +0 -67
  71. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +0 -2150
  72. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +0 -97
  73. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +0 -240
  74. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +0 -1226
  75. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +0 -197
  76. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
  77. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  78. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  79. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +0 -208
  80. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +0 -972
  81. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +0 -2439
  82. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +0 -808
  83. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +0 -976
  84. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +0 -181
  85. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +0 -745
  86. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +0 -539
  87. package/node_modules/@types/cacheable-request/node_modules/undici-types/LICENSE +0 -21
  88. package/node_modules/@types/cacheable-request/node_modules/undici-types/README.md +0 -6
  89. package/node_modules/@types/cacheable-request/node_modules/undici-types/agent.d.ts +0 -31
  90. package/node_modules/@types/cacheable-request/node_modules/undici-types/api.d.ts +0 -43
  91. package/node_modules/@types/cacheable-request/node_modules/undici-types/balanced-pool.d.ts +0 -29
  92. package/node_modules/@types/cacheable-request/node_modules/undici-types/cache.d.ts +0 -36
  93. package/node_modules/@types/cacheable-request/node_modules/undici-types/client.d.ts +0 -108
  94. package/node_modules/@types/cacheable-request/node_modules/undici-types/connector.d.ts +0 -34
  95. package/node_modules/@types/cacheable-request/node_modules/undici-types/content-type.d.ts +0 -21
  96. package/node_modules/@types/cacheable-request/node_modules/undici-types/cookies.d.ts +0 -28
  97. package/node_modules/@types/cacheable-request/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  98. package/node_modules/@types/cacheable-request/node_modules/undici-types/dispatcher.d.ts +0 -255
  99. package/node_modules/@types/cacheable-request/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  100. package/node_modules/@types/cacheable-request/node_modules/undici-types/errors.d.ts +0 -149
  101. package/node_modules/@types/cacheable-request/node_modules/undici-types/eventsource.d.ts +0 -61
  102. package/node_modules/@types/cacheable-request/node_modules/undici-types/fetch.d.ts +0 -209
  103. package/node_modules/@types/cacheable-request/node_modules/undici-types/file.d.ts +0 -39
  104. package/node_modules/@types/cacheable-request/node_modules/undici-types/filereader.d.ts +0 -54
  105. package/node_modules/@types/cacheable-request/node_modules/undici-types/formdata.d.ts +0 -108
  106. package/node_modules/@types/cacheable-request/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  107. package/node_modules/@types/cacheable-request/node_modules/undici-types/global-origin.d.ts +0 -7
  108. package/node_modules/@types/cacheable-request/node_modules/undici-types/handlers.d.ts +0 -15
  109. package/node_modules/@types/cacheable-request/node_modules/undici-types/header.d.ts +0 -4
  110. package/node_modules/@types/cacheable-request/node_modules/undici-types/index.d.ts +0 -71
  111. package/node_modules/@types/cacheable-request/node_modules/undici-types/interceptors.d.ts +0 -17
  112. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-agent.d.ts +0 -50
  113. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-client.d.ts +0 -25
  114. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-errors.d.ts +0 -12
  115. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  116. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-pool.d.ts +0 -25
  117. package/node_modules/@types/cacheable-request/node_modules/undici-types/package.json +0 -55
  118. package/node_modules/@types/cacheable-request/node_modules/undici-types/patch.d.ts +0 -33
  119. package/node_modules/@types/cacheable-request/node_modules/undici-types/pool-stats.d.ts +0 -19
  120. package/node_modules/@types/cacheable-request/node_modules/undici-types/pool.d.ts +0 -39
  121. package/node_modules/@types/cacheable-request/node_modules/undici-types/proxy-agent.d.ts +0 -28
  122. package/node_modules/@types/cacheable-request/node_modules/undici-types/readable.d.ts +0 -60
  123. package/node_modules/@types/cacheable-request/node_modules/undici-types/retry-agent.d.ts +0 -8
  124. package/node_modules/@types/cacheable-request/node_modules/undici-types/retry-handler.d.ts +0 -116
  125. package/node_modules/@types/cacheable-request/node_modules/undici-types/util.d.ts +0 -18
  126. package/node_modules/@types/cacheable-request/node_modules/undici-types/webidl.d.ts +0 -222
  127. package/node_modules/@types/cacheable-request/node_modules/undici-types/websocket.d.ts +0 -150
  128. package/node_modules/@types/cacheable-request/package.json +0 -35
  129. package/node_modules/@types/http-cache-semantics/LICENSE +0 -21
  130. package/node_modules/@types/http-cache-semantics/README.md +0 -15
  131. package/node_modules/@types/http-cache-semantics/index.d.ts +0 -165
  132. package/node_modules/@types/http-cache-semantics/package.json +0 -25
  133. package/node_modules/@types/keyv/LICENSE +0 -21
  134. package/node_modules/@types/keyv/README.md +0 -16
  135. package/node_modules/@types/keyv/index.d.ts +0 -90
  136. package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +0 -21
  137. package/node_modules/@types/keyv/node_modules/@types/node/README.md +0 -15
  138. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +0 -8
  139. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +0 -1095
  140. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +0 -541
  141. package/node_modules/@types/keyv/node_modules/@types/node/buffer.buffer.d.ts +0 -460
  142. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +0 -1926
  143. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +0 -1549
  144. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +0 -579
  145. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  146. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/index.d.ts +0 -9
  147. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  148. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  149. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +0 -452
  150. package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +0 -21
  151. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +0 -4510
  152. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +0 -599
  153. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  154. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +0 -476
  155. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +0 -865
  156. package/node_modules/@types/keyv/node_modules/@types/node/dom-events.d.ts +0 -124
  157. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +0 -170
  158. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +0 -931
  159. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +0 -1275
  160. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +0 -4343
  161. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +0 -511
  162. package/node_modules/@types/keyv/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  163. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +0 -1959
  164. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +0 -2558
  165. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +0 -543
  166. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +0 -92
  167. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +0 -3966
  168. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +0 -702
  169. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +0 -1029
  170. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +0 -495
  171. package/node_modules/@types/keyv/node_modules/@types/node/package.json +0 -220
  172. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +0 -200
  173. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +0 -970
  174. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +0 -2013
  175. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +0 -117
  176. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +0 -153
  177. package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +0 -162
  178. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +0 -589
  179. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +0 -430
  180. package/node_modules/@types/keyv/node_modules/@types/node/sea.d.ts +0 -153
  181. package/node_modules/@types/keyv/node_modules/@types/node/sqlite.d.ts +0 -439
  182. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +0 -12
  183. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +0 -90
  184. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +0 -614
  185. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +0 -1662
  186. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +0 -67
  187. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +0 -2150
  188. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +0 -97
  189. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +0 -240
  190. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +0 -1226
  191. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +0 -197
  192. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
  193. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  194. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  195. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +0 -208
  196. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +0 -972
  197. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +0 -2439
  198. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +0 -808
  199. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +0 -976
  200. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +0 -181
  201. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +0 -745
  202. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +0 -539
  203. package/node_modules/@types/keyv/node_modules/undici-types/LICENSE +0 -21
  204. package/node_modules/@types/keyv/node_modules/undici-types/README.md +0 -6
  205. package/node_modules/@types/keyv/node_modules/undici-types/agent.d.ts +0 -31
  206. package/node_modules/@types/keyv/node_modules/undici-types/api.d.ts +0 -43
  207. package/node_modules/@types/keyv/node_modules/undici-types/balanced-pool.d.ts +0 -29
  208. package/node_modules/@types/keyv/node_modules/undici-types/cache.d.ts +0 -36
  209. package/node_modules/@types/keyv/node_modules/undici-types/client.d.ts +0 -108
  210. package/node_modules/@types/keyv/node_modules/undici-types/connector.d.ts +0 -34
  211. package/node_modules/@types/keyv/node_modules/undici-types/content-type.d.ts +0 -21
  212. package/node_modules/@types/keyv/node_modules/undici-types/cookies.d.ts +0 -28
  213. package/node_modules/@types/keyv/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  214. package/node_modules/@types/keyv/node_modules/undici-types/dispatcher.d.ts +0 -255
  215. package/node_modules/@types/keyv/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  216. package/node_modules/@types/keyv/node_modules/undici-types/errors.d.ts +0 -149
  217. package/node_modules/@types/keyv/node_modules/undici-types/eventsource.d.ts +0 -61
  218. package/node_modules/@types/keyv/node_modules/undici-types/fetch.d.ts +0 -209
  219. package/node_modules/@types/keyv/node_modules/undici-types/file.d.ts +0 -39
  220. package/node_modules/@types/keyv/node_modules/undici-types/filereader.d.ts +0 -54
  221. package/node_modules/@types/keyv/node_modules/undici-types/formdata.d.ts +0 -108
  222. package/node_modules/@types/keyv/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  223. package/node_modules/@types/keyv/node_modules/undici-types/global-origin.d.ts +0 -7
  224. package/node_modules/@types/keyv/node_modules/undici-types/handlers.d.ts +0 -15
  225. package/node_modules/@types/keyv/node_modules/undici-types/header.d.ts +0 -4
  226. package/node_modules/@types/keyv/node_modules/undici-types/index.d.ts +0 -71
  227. package/node_modules/@types/keyv/node_modules/undici-types/interceptors.d.ts +0 -17
  228. package/node_modules/@types/keyv/node_modules/undici-types/mock-agent.d.ts +0 -50
  229. package/node_modules/@types/keyv/node_modules/undici-types/mock-client.d.ts +0 -25
  230. package/node_modules/@types/keyv/node_modules/undici-types/mock-errors.d.ts +0 -12
  231. package/node_modules/@types/keyv/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  232. package/node_modules/@types/keyv/node_modules/undici-types/mock-pool.d.ts +0 -25
  233. package/node_modules/@types/keyv/node_modules/undici-types/package.json +0 -55
  234. package/node_modules/@types/keyv/node_modules/undici-types/patch.d.ts +0 -33
  235. package/node_modules/@types/keyv/node_modules/undici-types/pool-stats.d.ts +0 -19
  236. package/node_modules/@types/keyv/node_modules/undici-types/pool.d.ts +0 -39
  237. package/node_modules/@types/keyv/node_modules/undici-types/proxy-agent.d.ts +0 -28
  238. package/node_modules/@types/keyv/node_modules/undici-types/readable.d.ts +0 -60
  239. package/node_modules/@types/keyv/node_modules/undici-types/retry-agent.d.ts +0 -8
  240. package/node_modules/@types/keyv/node_modules/undici-types/retry-handler.d.ts +0 -116
  241. package/node_modules/@types/keyv/node_modules/undici-types/util.d.ts +0 -18
  242. package/node_modules/@types/keyv/node_modules/undici-types/webidl.d.ts +0 -222
  243. package/node_modules/@types/keyv/node_modules/undici-types/websocket.d.ts +0 -150
  244. package/node_modules/@types/keyv/package.json +0 -32
  245. package/node_modules/@types/responselike/LICENSE +0 -21
  246. package/node_modules/@types/responselike/README.md +0 -48
  247. package/node_modules/@types/responselike/index.d.ts +0 -29
  248. package/node_modules/@types/responselike/node_modules/@types/node/LICENSE +0 -21
  249. package/node_modules/@types/responselike/node_modules/@types/node/README.md +0 -15
  250. package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +0 -8
  251. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +0 -1095
  252. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +0 -541
  253. package/node_modules/@types/responselike/node_modules/@types/node/buffer.buffer.d.ts +0 -460
  254. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +0 -1926
  255. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +0 -1549
  256. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +0 -579
  257. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  258. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/index.d.ts +0 -9
  259. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  260. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  261. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +0 -452
  262. package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +0 -21
  263. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +0 -4510
  264. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +0 -599
  265. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  266. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +0 -476
  267. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +0 -865
  268. package/node_modules/@types/responselike/node_modules/@types/node/dom-events.d.ts +0 -124
  269. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +0 -170
  270. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +0 -931
  271. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +0 -1275
  272. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +0 -4343
  273. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +0 -511
  274. package/node_modules/@types/responselike/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  275. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +0 -1959
  276. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +0 -2558
  277. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +0 -543
  278. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +0 -92
  279. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +0 -3966
  280. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +0 -702
  281. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +0 -1029
  282. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +0 -495
  283. package/node_modules/@types/responselike/node_modules/@types/node/package.json +0 -220
  284. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +0 -200
  285. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +0 -970
  286. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +0 -2013
  287. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +0 -117
  288. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +0 -153
  289. package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +0 -162
  290. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +0 -589
  291. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +0 -430
  292. package/node_modules/@types/responselike/node_modules/@types/node/sea.d.ts +0 -153
  293. package/node_modules/@types/responselike/node_modules/@types/node/sqlite.d.ts +0 -439
  294. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +0 -12
  295. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +0 -90
  296. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +0 -614
  297. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +0 -1662
  298. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +0 -67
  299. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +0 -2150
  300. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +0 -97
  301. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +0 -240
  302. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +0 -1226
  303. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +0 -197
  304. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
  305. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  306. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  307. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +0 -208
  308. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +0 -972
  309. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +0 -2439
  310. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +0 -808
  311. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +0 -976
  312. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +0 -181
  313. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +0 -745
  314. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +0 -539
  315. package/node_modules/@types/responselike/node_modules/undici-types/LICENSE +0 -21
  316. package/node_modules/@types/responselike/node_modules/undici-types/README.md +0 -6
  317. package/node_modules/@types/responselike/node_modules/undici-types/agent.d.ts +0 -31
  318. package/node_modules/@types/responselike/node_modules/undici-types/api.d.ts +0 -43
  319. package/node_modules/@types/responselike/node_modules/undici-types/balanced-pool.d.ts +0 -29
  320. package/node_modules/@types/responselike/node_modules/undici-types/cache.d.ts +0 -36
  321. package/node_modules/@types/responselike/node_modules/undici-types/client.d.ts +0 -108
  322. package/node_modules/@types/responselike/node_modules/undici-types/connector.d.ts +0 -34
  323. package/node_modules/@types/responselike/node_modules/undici-types/content-type.d.ts +0 -21
  324. package/node_modules/@types/responselike/node_modules/undici-types/cookies.d.ts +0 -28
  325. package/node_modules/@types/responselike/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  326. package/node_modules/@types/responselike/node_modules/undici-types/dispatcher.d.ts +0 -255
  327. package/node_modules/@types/responselike/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  328. package/node_modules/@types/responselike/node_modules/undici-types/errors.d.ts +0 -149
  329. package/node_modules/@types/responselike/node_modules/undici-types/eventsource.d.ts +0 -61
  330. package/node_modules/@types/responselike/node_modules/undici-types/fetch.d.ts +0 -209
  331. package/node_modules/@types/responselike/node_modules/undici-types/file.d.ts +0 -39
  332. package/node_modules/@types/responselike/node_modules/undici-types/filereader.d.ts +0 -54
  333. package/node_modules/@types/responselike/node_modules/undici-types/formdata.d.ts +0 -108
  334. package/node_modules/@types/responselike/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  335. package/node_modules/@types/responselike/node_modules/undici-types/global-origin.d.ts +0 -7
  336. package/node_modules/@types/responselike/node_modules/undici-types/handlers.d.ts +0 -15
  337. package/node_modules/@types/responselike/node_modules/undici-types/header.d.ts +0 -4
  338. package/node_modules/@types/responselike/node_modules/undici-types/index.d.ts +0 -71
  339. package/node_modules/@types/responselike/node_modules/undici-types/interceptors.d.ts +0 -17
  340. package/node_modules/@types/responselike/node_modules/undici-types/mock-agent.d.ts +0 -50
  341. package/node_modules/@types/responselike/node_modules/undici-types/mock-client.d.ts +0 -25
  342. package/node_modules/@types/responselike/node_modules/undici-types/mock-errors.d.ts +0 -12
  343. package/node_modules/@types/responselike/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  344. package/node_modules/@types/responselike/node_modules/undici-types/mock-pool.d.ts +0 -25
  345. package/node_modules/@types/responselike/node_modules/undici-types/package.json +0 -55
  346. package/node_modules/@types/responselike/node_modules/undici-types/patch.d.ts +0 -33
  347. package/node_modules/@types/responselike/node_modules/undici-types/pool-stats.d.ts +0 -19
  348. package/node_modules/@types/responselike/node_modules/undici-types/pool.d.ts +0 -39
  349. package/node_modules/@types/responselike/node_modules/undici-types/proxy-agent.d.ts +0 -28
  350. package/node_modules/@types/responselike/node_modules/undici-types/readable.d.ts +0 -60
  351. package/node_modules/@types/responselike/node_modules/undici-types/retry-agent.d.ts +0 -8
  352. package/node_modules/@types/responselike/node_modules/undici-types/retry-handler.d.ts +0 -116
  353. package/node_modules/@types/responselike/node_modules/undici-types/util.d.ts +0 -18
  354. package/node_modules/@types/responselike/node_modules/undici-types/webidl.d.ts +0 -222
  355. package/node_modules/@types/responselike/node_modules/undici-types/websocket.d.ts +0 -150
  356. package/node_modules/@types/responselike/package.json +0 -27
  357. package/node_modules/cacheable-lookup/LICENSE +0 -21
  358. package/node_modules/cacheable-lookup/README.md +0 -240
  359. package/node_modules/cacheable-lookup/index.d.ts +0 -139
  360. package/node_modules/cacheable-lookup/package.json +0 -45
  361. package/node_modules/cacheable-lookup/source/index.js +0 -436
  362. package/node_modules/cacheable-request/LICENSE +0 -21
  363. package/node_modules/cacheable-request/README.md +0 -206
  364. package/node_modules/cacheable-request/package.json +0 -56
  365. package/node_modules/cacheable-request/src/index.js +0 -251
  366. package/node_modules/clone-response/LICENSE +0 -21
  367. package/node_modules/clone-response/README.md +0 -62
  368. package/node_modules/clone-response/node_modules/mimic-response/index.js +0 -32
  369. package/node_modules/clone-response/node_modules/mimic-response/license +0 -9
  370. package/node_modules/clone-response/node_modules/mimic-response/package.json +0 -37
  371. package/node_modules/clone-response/node_modules/mimic-response/readme.md +0 -54
  372. package/node_modules/clone-response/package.json +0 -41
  373. package/node_modules/clone-response/src/index.js +0 -17
  374. package/node_modules/decompress-response/index.d.ts +0 -22
  375. package/node_modules/decompress-response/index.js +0 -58
  376. package/node_modules/decompress-response/license +0 -9
  377. package/node_modules/decompress-response/package.json +0 -56
  378. package/node_modules/decompress-response/readme.md +0 -48
  379. package/node_modules/defer-to-connect/LICENSE +0 -21
  380. package/node_modules/defer-to-connect/README.md +0 -38
  381. package/node_modules/defer-to-connect/dist/source/index.d.ts +0 -10
  382. package/node_modules/defer-to-connect/dist/source/index.js +0 -47
  383. package/node_modules/defer-to-connect/package.json +0 -71
  384. package/node_modules/end-of-stream/LICENSE +0 -21
  385. package/node_modules/end-of-stream/README.md +0 -54
  386. package/node_modules/end-of-stream/index.js +0 -94
  387. package/node_modules/end-of-stream/package.json +0 -37
  388. package/node_modules/get-stream/buffer-stream.js +0 -52
  389. package/node_modules/get-stream/index.d.ts +0 -108
  390. package/node_modules/get-stream/index.js +0 -60
  391. package/node_modules/get-stream/license +0 -9
  392. package/node_modules/get-stream/package.json +0 -50
  393. package/node_modules/get-stream/readme.md +0 -124
  394. package/node_modules/got/dist/source/as-promise/create-rejection.d.ts +0 -2
  395. package/node_modules/got/dist/source/as-promise/create-rejection.js +0 -30
  396. package/node_modules/got/dist/source/as-promise/index.d.ts +0 -3
  397. package/node_modules/got/dist/source/as-promise/index.js +0 -176
  398. package/node_modules/got/dist/source/as-promise/normalize-arguments.d.ts +0 -3
  399. package/node_modules/got/dist/source/as-promise/normalize-arguments.js +0 -78
  400. package/node_modules/got/dist/source/as-promise/parse-body.d.ts +0 -3
  401. package/node_modules/got/dist/source/as-promise/parse-body.js +0 -25
  402. package/node_modules/got/dist/source/as-promise/types.d.ts +0 -256
  403. package/node_modules/got/dist/source/as-promise/types.js +0 -42
  404. package/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +0 -5
  405. package/node_modules/got/dist/source/core/calculate-retry-delay.js +0 -29
  406. package/node_modules/got/dist/source/core/index.d.ts +0 -1124
  407. package/node_modules/got/dist/source/core/index.js +0 -1505
  408. package/node_modules/got/dist/source/core/utils/dns-ip-version.d.ts +0 -5
  409. package/node_modules/got/dist/source/core/utils/dns-ip-version.js +0 -17
  410. package/node_modules/got/dist/source/core/utils/get-body-size.d.ts +0 -3
  411. package/node_modules/got/dist/source/core/utils/get-body-size.js +0 -32
  412. package/node_modules/got/dist/source/core/utils/get-buffer.d.ts +0 -4
  413. package/node_modules/got/dist/source/core/utils/get-buffer.js +0 -16
  414. package/node_modules/got/dist/source/core/utils/is-form-data.d.ts +0 -8
  415. package/node_modules/got/dist/source/core/utils/is-form-data.js +0 -4
  416. package/node_modules/got/dist/source/core/utils/is-response-ok.d.ts +0 -2
  417. package/node_modules/got/dist/source/core/utils/is-response-ok.js +0 -8
  418. package/node_modules/got/dist/source/core/utils/options-to-url.d.ts +0 -14
  419. package/node_modules/got/dist/source/core/utils/options-to-url.js +0 -53
  420. package/node_modules/got/dist/source/core/utils/proxy-events.d.ts +0 -3
  421. package/node_modules/got/dist/source/core/utils/proxy-events.js +0 -17
  422. package/node_modules/got/dist/source/core/utils/timed-out.d.ts +0 -29
  423. package/node_modules/got/dist/source/core/utils/timed-out.js +0 -121
  424. package/node_modules/got/dist/source/core/utils/unhandle.d.ts +0 -11
  425. package/node_modules/got/dist/source/core/utils/unhandle.js +0 -22
  426. package/node_modules/got/dist/source/core/utils/url-to-options.d.ts +0 -15
  427. package/node_modules/got/dist/source/core/utils/url-to-options.js +0 -24
  428. package/node_modules/got/dist/source/core/utils/weakable-map.d.ts +0 -8
  429. package/node_modules/got/dist/source/core/utils/weakable-map.js +0 -29
  430. package/node_modules/got/dist/source/create.d.ts +0 -5
  431. package/node_modules/got/dist/source/create.js +0 -240
  432. package/node_modules/got/dist/source/index.d.ts +0 -4
  433. package/node_modules/got/dist/source/index.js +0 -132
  434. package/node_modules/got/dist/source/types.d.ts +0 -344
  435. package/node_modules/got/dist/source/types.js +0 -2
  436. package/node_modules/got/dist/source/utils/deep-freeze.d.ts +0 -1
  437. package/node_modules/got/dist/source/utils/deep-freeze.js +0 -12
  438. package/node_modules/got/dist/source/utils/deprecation-warning.d.ts +0 -2
  439. package/node_modules/got/dist/source/utils/deprecation-warning.js +0 -13
  440. package/node_modules/got/license +0 -9
  441. package/node_modules/got/package.json +0 -131
  442. package/node_modules/got/readme.md +0 -2477
  443. package/node_modules/hpagent/.github/dependabot.yml +0 -8
  444. package/node_modules/hpagent/.github/workflows/build.yml +0 -29
  445. package/node_modules/hpagent/LICENSE +0 -21
  446. package/node_modules/hpagent/README.md +0 -138
  447. package/node_modules/hpagent/index.d.ts +0 -26
  448. package/node_modules/hpagent/index.js +0 -101
  449. package/node_modules/hpagent/index.mjs +0 -5
  450. package/node_modules/hpagent/package.json +0 -49
  451. package/node_modules/hpagent/test/got.test.js +0 -111
  452. package/node_modules/hpagent/test/http-http.test.js +0 -351
  453. package/node_modules/hpagent/test/http-https.test.js +0 -313
  454. package/node_modules/hpagent/test/https-http.test.js +0 -313
  455. package/node_modules/hpagent/test/https-https.test.js +0 -313
  456. package/node_modules/hpagent/test/index.test-d.ts +0 -45
  457. package/node_modules/hpagent/test/needle.test.js +0 -103
  458. package/node_modules/hpagent/test/node-fetch.test.js +0 -103
  459. package/node_modules/hpagent/test/simple-get.test.js +0 -139
  460. package/node_modules/hpagent/test/ssl.cert +0 -19
  461. package/node_modules/hpagent/test/ssl.key +0 -27
  462. package/node_modules/hpagent/test/utils.js +0 -59
  463. package/node_modules/http-cache-semantics/LICENSE +0 -9
  464. package/node_modules/http-cache-semantics/README.md +0 -203
  465. package/node_modules/http-cache-semantics/index.js +0 -674
  466. package/node_modules/http-cache-semantics/package.json +0 -18
  467. package/node_modules/http2-wrapper/LICENSE +0 -21
  468. package/node_modules/http2-wrapper/README.md +0 -470
  469. package/node_modules/http2-wrapper/package.json +0 -54
  470. package/node_modules/http2-wrapper/source/agent.js +0 -670
  471. package/node_modules/http2-wrapper/source/auto.js +0 -149
  472. package/node_modules/http2-wrapper/source/client-request.js +0 -445
  473. package/node_modules/http2-wrapper/source/incoming-message.js +0 -58
  474. package/node_modules/http2-wrapper/source/index.js +0 -28
  475. package/node_modules/http2-wrapper/source/utils/calculate-server-name.js +0 -27
  476. package/node_modules/http2-wrapper/source/utils/errors.js +0 -45
  477. package/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +0 -13
  478. package/node_modules/http2-wrapper/source/utils/proxy-events.js +0 -7
  479. package/node_modules/http2-wrapper/source/utils/url-to-options.js +0 -25
  480. package/node_modules/json-buffer/.travis.yml +0 -3
  481. package/node_modules/json-buffer/LICENSE +0 -22
  482. package/node_modules/json-buffer/README.md +0 -24
  483. package/node_modules/json-buffer/index.js +0 -58
  484. package/node_modules/json-buffer/package.json +0 -34
  485. package/node_modules/json-buffer/test/index.js +0 -63
  486. package/node_modules/keyv/README.md +0 -429
  487. package/node_modules/keyv/package.json +0 -57
  488. package/node_modules/keyv/src/index.d.ts +0 -112
  489. package/node_modules/keyv/src/index.js +0 -259
  490. package/node_modules/lowercase-keys/index.d.ts +0 -16
  491. package/node_modules/lowercase-keys/index.js +0 -10
  492. package/node_modules/lowercase-keys/license +0 -9
  493. package/node_modules/lowercase-keys/package.json +0 -38
  494. package/node_modules/lowercase-keys/readme.md +0 -32
  495. package/node_modules/mimic-response/index.d.ts +0 -17
  496. package/node_modules/mimic-response/index.js +0 -77
  497. package/node_modules/mimic-response/license +0 -9
  498. package/node_modules/mimic-response/package.json +0 -42
  499. package/node_modules/mimic-response/readme.md +0 -78
  500. package/node_modules/normalize-url/index.d.ts +0 -267
  501. package/node_modules/normalize-url/index.js +0 -216
  502. package/node_modules/normalize-url/license +0 -9
  503. package/node_modules/normalize-url/package.json +0 -50
  504. package/node_modules/normalize-url/readme.md +0 -286
  505. package/node_modules/once/LICENSE +0 -15
  506. package/node_modules/once/README.md +0 -79
  507. package/node_modules/once/once.js +0 -42
  508. package/node_modules/once/package.json +0 -33
  509. package/node_modules/p-cancelable/index.d.ts +0 -176
  510. package/node_modules/p-cancelable/index.js +0 -111
  511. package/node_modules/p-cancelable/license +0 -9
  512. package/node_modules/p-cancelable/package.json +0 -49
  513. package/node_modules/p-cancelable/readme.md +0 -153
  514. package/node_modules/pump/.github/FUNDING.yml +0 -2
  515. package/node_modules/pump/.travis.yml +0 -5
  516. package/node_modules/pump/LICENSE +0 -21
  517. package/node_modules/pump/README.md +0 -74
  518. package/node_modules/pump/SECURITY.md +0 -5
  519. package/node_modules/pump/index.js +0 -86
  520. package/node_modules/pump/package.json +0 -24
  521. package/node_modules/pump/test-browser.js +0 -66
  522. package/node_modules/pump/test-node.js +0 -53
  523. package/node_modules/quick-lru/index.d.ts +0 -97
  524. package/node_modules/quick-lru/index.js +0 -123
  525. package/node_modules/quick-lru/license +0 -9
  526. package/node_modules/quick-lru/package.json +0 -43
  527. package/node_modules/quick-lru/readme.md +0 -111
  528. package/node_modules/resolve-alpn/LICENSE +0 -22
  529. package/node_modules/resolve-alpn/README.md +0 -60
  530. package/node_modules/resolve-alpn/index.js +0 -43
  531. package/node_modules/resolve-alpn/package.json +0 -34
  532. package/node_modules/responselike/LICENSE +0 -19
  533. package/node_modules/responselike/README.md +0 -77
  534. package/node_modules/responselike/package.json +0 -39
  535. package/node_modules/responselike/src/index.js +0 -34
  536. package/node_modules/wrappy/LICENSE +0 -15
  537. package/node_modules/wrappy/README.md +0 -36
  538. package/node_modules/wrappy/package.json +0 -29
  539. package/node_modules/wrappy/wrappy.js +0 -33
@@ -1,1926 +0,0 @@
1
- // If lib.dom.d.ts or lib.webworker.d.ts is loaded, then use the global types.
2
- // Otherwise, use the types from node.
3
- type _Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : import("buffer").Blob;
4
- type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : import("buffer").File;
5
-
6
- /**
7
- * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
8
- * Node.js APIs support `Buffer`s.
9
- *
10
- * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and
11
- * extends it with methods that cover additional use cases. Node.js APIs accept
12
- * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well.
13
- *
14
- * While the `Buffer` class is available within the global scope, it is still
15
- * recommended to explicitly reference it via an import or require statement.
16
- *
17
- * ```js
18
- * import { Buffer } from 'node:buffer';
19
- *
20
- * // Creates a zero-filled Buffer of length 10.
21
- * const buf1 = Buffer.alloc(10);
22
- *
23
- * // Creates a Buffer of length 10,
24
- * // filled with bytes which all have the value `1`.
25
- * const buf2 = Buffer.alloc(10, 1);
26
- *
27
- * // Creates an uninitialized buffer of length 10.
28
- * // This is faster than calling Buffer.alloc() but the returned
29
- * // Buffer instance might contain old data that needs to be
30
- * // overwritten using fill(), write(), or other functions that fill the Buffer's
31
- * // contents.
32
- * const buf3 = Buffer.allocUnsafe(10);
33
- *
34
- * // Creates a Buffer containing the bytes [1, 2, 3].
35
- * const buf4 = Buffer.from([1, 2, 3]);
36
- *
37
- * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries
38
- * // are all truncated using `(value & 255)` to fit into the range 0–255.
39
- * const buf5 = Buffer.from([257, 257.5, -255, '1']);
40
- *
41
- * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':
42
- * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)
43
- * // [116, 195, 169, 115, 116] (in decimal notation)
44
- * const buf6 = Buffer.from('tést');
45
- *
46
- * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
47
- * const buf7 = Buffer.from('tést', 'latin1');
48
- * ```
49
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/buffer.js)
50
- */
51
- declare module "buffer" {
52
- import { BinaryLike } from "node:crypto";
53
- import { ReadableStream as WebReadableStream } from "node:stream/web";
54
- /**
55
- * This function returns `true` if `input` contains only valid UTF-8-encoded data,
56
- * including the case in which `input` is empty.
57
- *
58
- * Throws if the `input` is a detached array buffer.
59
- * @since v19.4.0, v18.14.0
60
- * @param input The input to validate.
61
- */
62
- export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
63
- /**
64
- * This function returns `true` if `input` contains only valid ASCII-encoded data,
65
- * including the case in which `input` is empty.
66
- *
67
- * Throws if the `input` is a detached array buffer.
68
- * @since v19.6.0, v18.15.0
69
- * @param input The input to validate.
70
- */
71
- export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
72
- export const INSPECT_MAX_BYTES: number;
73
- export const kMaxLength: number;
74
- export const kStringMaxLength: number;
75
- export const constants: {
76
- MAX_LENGTH: number;
77
- MAX_STRING_LENGTH: number;
78
- };
79
- export type TranscodeEncoding =
80
- | "ascii"
81
- | "utf8"
82
- | "utf-8"
83
- | "utf16le"
84
- | "utf-16le"
85
- | "ucs2"
86
- | "ucs-2"
87
- | "latin1"
88
- | "binary";
89
- /**
90
- * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
91
- * encoding to another. Returns a new `Buffer` instance.
92
- *
93
- * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if
94
- * conversion from `fromEnc` to `toEnc` is not permitted.
95
- *
96
- * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`, `'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`.
97
- *
98
- * The transcoding process will use substitution characters if a given byte
99
- * sequence cannot be adequately represented in the target encoding. For instance:
100
- *
101
- * ```js
102
- * import { Buffer, transcode } from 'node:buffer';
103
- *
104
- * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii');
105
- * console.log(newBuf.toString('ascii'));
106
- * // Prints: '?'
107
- * ```
108
- *
109
- * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced
110
- * with `?` in the transcoded `Buffer`.
111
- * @since v7.1.0
112
- * @param source A `Buffer` or `Uint8Array` instance.
113
- * @param fromEnc The current encoding.
114
- * @param toEnc To target encoding.
115
- */
116
- export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
117
- /**
118
- * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
119
- * a prior call to `URL.createObjectURL()`.
120
- * @since v16.7.0
121
- * @experimental
122
- * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
123
- */
124
- export function resolveObjectURL(id: string): Blob | undefined;
125
- export { Buffer };
126
- /**
127
- * @experimental
128
- */
129
- export interface BlobOptions {
130
- /**
131
- * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts
132
- * will be converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
133
- */
134
- endings?: "transparent" | "native";
135
- /**
136
- * The Blob content-type. The intent is for `type` to convey
137
- * the MIME media type of the data, however no validation of the type format
138
- * is performed.
139
- */
140
- type?: string | undefined;
141
- }
142
- /**
143
- * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
144
- * multiple worker threads.
145
- * @since v15.7.0, v14.18.0
146
- */
147
- export class Blob {
148
- /**
149
- * The total size of the `Blob` in bytes.
150
- * @since v15.7.0, v14.18.0
151
- */
152
- readonly size: number;
153
- /**
154
- * The content-type of the `Blob`.
155
- * @since v15.7.0, v14.18.0
156
- */
157
- readonly type: string;
158
- /**
159
- * Creates a new `Blob` object containing a concatenation of the given sources.
160
- *
161
- * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
162
- * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
163
- *
164
- * String sources are also copied into the `Blob`.
165
- */
166
- constructor(sources: Array<ArrayBuffer | BinaryLike | Blob>, options?: BlobOptions);
167
- /**
168
- * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
169
- * the `Blob` data.
170
- * @since v15.7.0, v14.18.0
171
- */
172
- arrayBuffer(): Promise<ArrayBuffer>;
173
- /**
174
- * The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise<Uint8Array>`.
175
- *
176
- * ```js
177
- * const blob = new Blob(['hello']);
178
- * blob.bytes().then((bytes) => {
179
- * console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
180
- * });
181
- * ```
182
- */
183
- bytes(): Promise<Uint8Array>;
184
- /**
185
- * Creates and returns a new `Blob` containing a subset of this `Blob` objects
186
- * data. The original `Blob` is not altered.
187
- * @since v15.7.0, v14.18.0
188
- * @param start The starting index.
189
- * @param end The ending index.
190
- * @param type The content-type for the new `Blob`
191
- */
192
- slice(start?: number, end?: number, type?: string): Blob;
193
- /**
194
- * Returns a promise that fulfills with the contents of the `Blob` decoded as a
195
- * UTF-8 string.
196
- * @since v15.7.0, v14.18.0
197
- */
198
- text(): Promise<string>;
199
- /**
200
- * Returns a new `ReadableStream` that allows the content of the `Blob` to be read.
201
- * @since v16.7.0
202
- */
203
- stream(): WebReadableStream;
204
- }
205
- export interface FileOptions {
206
- /**
207
- * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
208
- * converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
209
- */
210
- endings?: "native" | "transparent";
211
- /** The File content-type. */
212
- type?: string;
213
- /** The last modified date of the file. `Default`: Date.now(). */
214
- lastModified?: number;
215
- }
216
- /**
217
- * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
218
- * @since v19.2.0, v18.13.0
219
- */
220
- export class File extends Blob {
221
- constructor(sources: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
222
- /**
223
- * The name of the `File`.
224
- * @since v19.2.0, v18.13.0
225
- */
226
- readonly name: string;
227
- /**
228
- * The last modified date of the `File`.
229
- * @since v19.2.0, v18.13.0
230
- */
231
- readonly lastModified: number;
232
- }
233
- export import atob = globalThis.atob;
234
- export import btoa = globalThis.btoa;
235
- export type WithImplicitCoercion<T> =
236
- | T
237
- | { valueOf(): T }
238
- | (T extends string ? { [Symbol.toPrimitive](hint: "string"): T } : never);
239
- global {
240
- namespace NodeJS {
241
- export { BufferEncoding };
242
- }
243
- // Buffer class
244
- type BufferEncoding =
245
- | "ascii"
246
- | "utf8"
247
- | "utf-8"
248
- | "utf16le"
249
- | "utf-16le"
250
- | "ucs2"
251
- | "ucs-2"
252
- | "base64"
253
- | "base64url"
254
- | "latin1"
255
- | "binary"
256
- | "hex";
257
- /**
258
- * Raw data is stored in instances of the Buffer class.
259
- * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
260
- * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex'
261
- */
262
- interface BufferConstructor {
263
- // see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later
264
- // see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier
265
-
266
- /**
267
- * Returns `true` if `obj` is a `Buffer`, `false` otherwise.
268
- *
269
- * ```js
270
- * import { Buffer } from 'node:buffer';
271
- *
272
- * Buffer.isBuffer(Buffer.alloc(10)); // true
273
- * Buffer.isBuffer(Buffer.from('foo')); // true
274
- * Buffer.isBuffer('a string'); // false
275
- * Buffer.isBuffer([]); // false
276
- * Buffer.isBuffer(new Uint8Array(1024)); // false
277
- * ```
278
- * @since v0.1.101
279
- */
280
- isBuffer(obj: any): obj is Buffer;
281
- /**
282
- * Returns `true` if `encoding` is the name of a supported character encoding,
283
- * or `false` otherwise.
284
- *
285
- * ```js
286
- * import { Buffer } from 'node:buffer';
287
- *
288
- * console.log(Buffer.isEncoding('utf8'));
289
- * // Prints: true
290
- *
291
- * console.log(Buffer.isEncoding('hex'));
292
- * // Prints: true
293
- *
294
- * console.log(Buffer.isEncoding('utf/8'));
295
- * // Prints: false
296
- *
297
- * console.log(Buffer.isEncoding(''));
298
- * // Prints: false
299
- * ```
300
- * @since v0.9.1
301
- * @param encoding A character encoding name to check.
302
- */
303
- isEncoding(encoding: string): encoding is BufferEncoding;
304
- /**
305
- * Returns the byte length of a string when encoded using `encoding`.
306
- * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account
307
- * for the encoding that is used to convert the string into bytes.
308
- *
309
- * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input.
310
- * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the
311
- * return value might be greater than the length of a `Buffer` created from the
312
- * string.
313
- *
314
- * ```js
315
- * import { Buffer } from 'node:buffer';
316
- *
317
- * const str = '\u00bd + \u00bc = \u00be';
318
- *
319
- * console.log(`${str}: ${str.length} characters, ` +
320
- * `${Buffer.byteLength(str, 'utf8')} bytes`);
321
- * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes
322
- * ```
323
- *
324
- * When `string` is a
325
- * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/-
326
- * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop-
327
- * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned.
328
- * @since v0.1.90
329
- * @param string A value to calculate the length of.
330
- * @param [encoding='utf8'] If `string` is a string, this is its encoding.
331
- * @return The number of bytes contained within `string`.
332
- */
333
- byteLength(
334
- string: string | Buffer | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
335
- encoding?: BufferEncoding,
336
- ): number;
337
- /**
338
- * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of `Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
339
- *
340
- * ```js
341
- * import { Buffer } from 'node:buffer';
342
- *
343
- * const buf1 = Buffer.from('1234');
344
- * const buf2 = Buffer.from('0123');
345
- * const arr = [buf1, buf2];
346
- *
347
- * console.log(arr.sort(Buffer.compare));
348
- * // Prints: [ <Buffer 30 31 32 33>, <Buffer 31 32 33 34> ]
349
- * // (This result is equal to: [buf2, buf1].)
350
- * ```
351
- * @since v0.11.13
352
- * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details.
353
- */
354
- compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1;
355
- /**
356
- * This is the size (in bytes) of pre-allocated internal `Buffer` instances used
357
- * for pooling. This value may be modified.
358
- * @since v0.11.3
359
- */
360
- poolSize: number;
361
- }
362
- interface Buffer {
363
- // see buffer.buffer.d.ts for implementation specific to TypeScript 5.7 and later
364
- // see ts5.6/buffer.buffer.d.ts for implementation specific to TypeScript 5.6 and earlier
365
-
366
- /**
367
- * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did
368
- * not contain enough space to fit the entire string, only part of `string` will be
369
- * written. However, partially encoded characters will not be written.
370
- *
371
- * ```js
372
- * import { Buffer } from 'node:buffer';
373
- *
374
- * const buf = Buffer.alloc(256);
375
- *
376
- * const len = buf.write('\u00bd + \u00bc = \u00be', 0);
377
- *
378
- * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
379
- * // Prints: 12 bytes: ½ + ¼ = ¾
380
- *
381
- * const buffer = Buffer.alloc(10);
382
- *
383
- * const length = buffer.write('abcd', 8);
384
- *
385
- * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
386
- * // Prints: 2 bytes : ab
387
- * ```
388
- * @since v0.1.90
389
- * @param string String to write to `buf`.
390
- * @param [offset=0] Number of bytes to skip before starting to write `string`.
391
- * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`).
392
- * @param [encoding='utf8'] The character encoding of `string`.
393
- * @return Number of bytes written.
394
- */
395
- write(string: string, encoding?: BufferEncoding): number;
396
- write(string: string, offset: number, encoding?: BufferEncoding): number;
397
- write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
398
- /**
399
- * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`.
400
- *
401
- * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8,
402
- * then each invalid byte is replaced with the replacement character `U+FFFD`.
403
- *
404
- * The maximum length of a string instance (in UTF-16 code units) is available
405
- * as {@link constants.MAX_STRING_LENGTH}.
406
- *
407
- * ```js
408
- * import { Buffer } from 'node:buffer';
409
- *
410
- * const buf1 = Buffer.allocUnsafe(26);
411
- *
412
- * for (let i = 0; i < 26; i++) {
413
- * // 97 is the decimal ASCII value for 'a'.
414
- * buf1[i] = i + 97;
415
- * }
416
- *
417
- * console.log(buf1.toString('utf8'));
418
- * // Prints: abcdefghijklmnopqrstuvwxyz
419
- * console.log(buf1.toString('utf8', 0, 5));
420
- * // Prints: abcde
421
- *
422
- * const buf2 = Buffer.from('tést');
423
- *
424
- * console.log(buf2.toString('hex'));
425
- * // Prints: 74c3a97374
426
- * console.log(buf2.toString('utf8', 0, 3));
427
- * // Prints: té
428
- * console.log(buf2.toString(undefined, 0, 3));
429
- * // Prints: té
430
- * ```
431
- * @since v0.1.90
432
- * @param [encoding='utf8'] The character encoding to use.
433
- * @param [start=0] The byte offset to start decoding at.
434
- * @param [end=buf.length] The byte offset to stop decoding at (not inclusive).
435
- */
436
- toString(encoding?: BufferEncoding, start?: number, end?: number): string;
437
- /**
438
- * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls
439
- * this function when stringifying a `Buffer` instance.
440
- *
441
- * `Buffer.from()` accepts objects in the format returned from this method.
442
- * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
443
- *
444
- * ```js
445
- * import { Buffer } from 'node:buffer';
446
- *
447
- * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
448
- * const json = JSON.stringify(buf);
449
- *
450
- * console.log(json);
451
- * // Prints: {"type":"Buffer","data":[1,2,3,4,5]}
452
- *
453
- * const copy = JSON.parse(json, (key, value) => {
454
- * return value &#x26;&#x26; value.type === 'Buffer' ?
455
- * Buffer.from(value) :
456
- * value;
457
- * });
458
- *
459
- * console.log(copy);
460
- * // Prints: <Buffer 01 02 03 04 05>
461
- * ```
462
- * @since v0.9.2
463
- */
464
- toJSON(): {
465
- type: "Buffer";
466
- data: number[];
467
- };
468
- /**
469
- * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
470
- *
471
- * ```js
472
- * import { Buffer } from 'node:buffer';
473
- *
474
- * const buf1 = Buffer.from('ABC');
475
- * const buf2 = Buffer.from('414243', 'hex');
476
- * const buf3 = Buffer.from('ABCD');
477
- *
478
- * console.log(buf1.equals(buf2));
479
- * // Prints: true
480
- * console.log(buf1.equals(buf3));
481
- * // Prints: false
482
- * ```
483
- * @since v0.11.13
484
- * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`.
485
- */
486
- equals(otherBuffer: Uint8Array): boolean;
487
- /**
488
- * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order.
489
- * Comparison is based on the actual sequence of bytes in each `Buffer`.
490
- *
491
- * * `0` is returned if `target` is the same as `buf`
492
- * * `1` is returned if `target` should come _before_`buf` when sorted.
493
- * * `-1` is returned if `target` should come _after_`buf` when sorted.
494
- *
495
- * ```js
496
- * import { Buffer } from 'node:buffer';
497
- *
498
- * const buf1 = Buffer.from('ABC');
499
- * const buf2 = Buffer.from('BCD');
500
- * const buf3 = Buffer.from('ABCD');
501
- *
502
- * console.log(buf1.compare(buf1));
503
- * // Prints: 0
504
- * console.log(buf1.compare(buf2));
505
- * // Prints: -1
506
- * console.log(buf1.compare(buf3));
507
- * // Prints: -1
508
- * console.log(buf2.compare(buf1));
509
- * // Prints: 1
510
- * console.log(buf2.compare(buf3));
511
- * // Prints: 1
512
- * console.log([buf1, buf2, buf3].sort(Buffer.compare));
513
- * // Prints: [ <Buffer 41 42 43>, <Buffer 41 42 43 44>, <Buffer 42 43 44> ]
514
- * // (This result is equal to: [buf1, buf3, buf2].)
515
- * ```
516
- *
517
- * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd` arguments can be used to limit the comparison to specific ranges within `target` and `buf` respectively.
518
- *
519
- * ```js
520
- * import { Buffer } from 'node:buffer';
521
- *
522
- * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
523
- * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
524
- *
525
- * console.log(buf1.compare(buf2, 5, 9, 0, 4));
526
- * // Prints: 0
527
- * console.log(buf1.compare(buf2, 0, 6, 4));
528
- * // Prints: -1
529
- * console.log(buf1.compare(buf2, 5, 6, 5));
530
- * // Prints: 1
531
- * ```
532
- *
533
- * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`, `targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`.
534
- * @since v0.11.13
535
- * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`.
536
- * @param [targetStart=0] The offset within `target` at which to begin comparison.
537
- * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive).
538
- * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
539
- * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
540
- */
541
- compare(
542
- target: Uint8Array,
543
- targetStart?: number,
544
- targetEnd?: number,
545
- sourceStart?: number,
546
- sourceEnd?: number,
547
- ): -1 | 0 | 1;
548
- /**
549
- * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
550
- *
551
- * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available
552
- * for all TypedArrays, including Node.js `Buffer`s, although it takes
553
- * different function arguments.
554
- *
555
- * ```js
556
- * import { Buffer } from 'node:buffer';
557
- *
558
- * // Create two `Buffer` instances.
559
- * const buf1 = Buffer.allocUnsafe(26);
560
- * const buf2 = Buffer.allocUnsafe(26).fill('!');
561
- *
562
- * for (let i = 0; i < 26; i++) {
563
- * // 97 is the decimal ASCII value for 'a'.
564
- * buf1[i] = i + 97;
565
- * }
566
- *
567
- * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.
568
- * buf1.copy(buf2, 8, 16, 20);
569
- * // This is equivalent to:
570
- * // buf2.set(buf1.subarray(16, 20), 8);
571
- *
572
- * console.log(buf2.toString('ascii', 0, 25));
573
- * // Prints: !!!!!!!!qrst!!!!!!!!!!!!!
574
- * ```
575
- *
576
- * ```js
577
- * import { Buffer } from 'node:buffer';
578
- *
579
- * // Create a `Buffer` and copy data from one region to an overlapping region
580
- * // within the same `Buffer`.
581
- *
582
- * const buf = Buffer.allocUnsafe(26);
583
- *
584
- * for (let i = 0; i < 26; i++) {
585
- * // 97 is the decimal ASCII value for 'a'.
586
- * buf[i] = i + 97;
587
- * }
588
- *
589
- * buf.copy(buf, 0, 4, 10);
590
- *
591
- * console.log(buf.toString());
592
- * // Prints: efghijghijklmnopqrstuvwxyz
593
- * ```
594
- * @since v0.1.90
595
- * @param target A `Buffer` or {@link Uint8Array} to copy into.
596
- * @param [targetStart=0] The offset within `target` at which to begin writing.
597
- * @param [sourceStart=0] The offset within `buf` from which to begin copying.
598
- * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive).
599
- * @return The number of bytes copied.
600
- */
601
- copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
602
- /**
603
- * Writes `value` to `buf` at the specified `offset` as big-endian.
604
- *
605
- * `value` is interpreted and written as a two's complement signed integer.
606
- *
607
- * ```js
608
- * import { Buffer } from 'node:buffer';
609
- *
610
- * const buf = Buffer.allocUnsafe(8);
611
- *
612
- * buf.writeBigInt64BE(0x0102030405060708n, 0);
613
- *
614
- * console.log(buf);
615
- * // Prints: <Buffer 01 02 03 04 05 06 07 08>
616
- * ```
617
- * @since v12.0.0, v10.20.0
618
- * @param value Number to be written to `buf`.
619
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
620
- * @return `offset` plus the number of bytes written.
621
- */
622
- writeBigInt64BE(value: bigint, offset?: number): number;
623
- /**
624
- * Writes `value` to `buf` at the specified `offset` as little-endian.
625
- *
626
- * `value` is interpreted and written as a two's complement signed integer.
627
- *
628
- * ```js
629
- * import { Buffer } from 'node:buffer';
630
- *
631
- * const buf = Buffer.allocUnsafe(8);
632
- *
633
- * buf.writeBigInt64LE(0x0102030405060708n, 0);
634
- *
635
- * console.log(buf);
636
- * // Prints: <Buffer 08 07 06 05 04 03 02 01>
637
- * ```
638
- * @since v12.0.0, v10.20.0
639
- * @param value Number to be written to `buf`.
640
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
641
- * @return `offset` plus the number of bytes written.
642
- */
643
- writeBigInt64LE(value: bigint, offset?: number): number;
644
- /**
645
- * Writes `value` to `buf` at the specified `offset` as big-endian.
646
- *
647
- * This function is also available under the `writeBigUint64BE` alias.
648
- *
649
- * ```js
650
- * import { Buffer } from 'node:buffer';
651
- *
652
- * const buf = Buffer.allocUnsafe(8);
653
- *
654
- * buf.writeBigUInt64BE(0xdecafafecacefaden, 0);
655
- *
656
- * console.log(buf);
657
- * // Prints: <Buffer de ca fa fe ca ce fa de>
658
- * ```
659
- * @since v12.0.0, v10.20.0
660
- * @param value Number to be written to `buf`.
661
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
662
- * @return `offset` plus the number of bytes written.
663
- */
664
- writeBigUInt64BE(value: bigint, offset?: number): number;
665
- /**
666
- * @alias Buffer.writeBigUInt64BE
667
- * @since v14.10.0, v12.19.0
668
- */
669
- writeBigUint64BE(value: bigint, offset?: number): number;
670
- /**
671
- * Writes `value` to `buf` at the specified `offset` as little-endian
672
- *
673
- * ```js
674
- * import { Buffer } from 'node:buffer';
675
- *
676
- * const buf = Buffer.allocUnsafe(8);
677
- *
678
- * buf.writeBigUInt64LE(0xdecafafecacefaden, 0);
679
- *
680
- * console.log(buf);
681
- * // Prints: <Buffer de fa ce ca fe fa ca de>
682
- * ```
683
- *
684
- * This function is also available under the `writeBigUint64LE` alias.
685
- * @since v12.0.0, v10.20.0
686
- * @param value Number to be written to `buf`.
687
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
688
- * @return `offset` plus the number of bytes written.
689
- */
690
- writeBigUInt64LE(value: bigint, offset?: number): number;
691
- /**
692
- * @alias Buffer.writeBigUInt64LE
693
- * @since v14.10.0, v12.19.0
694
- */
695
- writeBigUint64LE(value: bigint, offset?: number): number;
696
- /**
697
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
698
- * when `value` is anything other than an unsigned integer.
699
- *
700
- * This function is also available under the `writeUintLE` alias.
701
- *
702
- * ```js
703
- * import { Buffer } from 'node:buffer';
704
- *
705
- * const buf = Buffer.allocUnsafe(6);
706
- *
707
- * buf.writeUIntLE(0x1234567890ab, 0, 6);
708
- *
709
- * console.log(buf);
710
- * // Prints: <Buffer ab 90 78 56 34 12>
711
- * ```
712
- * @since v0.5.5
713
- * @param value Number to be written to `buf`.
714
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
715
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
716
- * @return `offset` plus the number of bytes written.
717
- */
718
- writeUIntLE(value: number, offset: number, byteLength: number): number;
719
- /**
720
- * @alias Buffer.writeUIntLE
721
- * @since v14.9.0, v12.19.0
722
- */
723
- writeUintLE(value: number, offset: number, byteLength: number): number;
724
- /**
725
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined
726
- * when `value` is anything other than an unsigned integer.
727
- *
728
- * This function is also available under the `writeUintBE` alias.
729
- *
730
- * ```js
731
- * import { Buffer } from 'node:buffer';
732
- *
733
- * const buf = Buffer.allocUnsafe(6);
734
- *
735
- * buf.writeUIntBE(0x1234567890ab, 0, 6);
736
- *
737
- * console.log(buf);
738
- * // Prints: <Buffer 12 34 56 78 90 ab>
739
- * ```
740
- * @since v0.5.5
741
- * @param value Number to be written to `buf`.
742
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
743
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
744
- * @return `offset` plus the number of bytes written.
745
- */
746
- writeUIntBE(value: number, offset: number, byteLength: number): number;
747
- /**
748
- * @alias Buffer.writeUIntBE
749
- * @since v14.9.0, v12.19.0
750
- */
751
- writeUintBE(value: number, offset: number, byteLength: number): number;
752
- /**
753
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
754
- * when `value` is anything other than a signed integer.
755
- *
756
- * ```js
757
- * import { Buffer } from 'node:buffer';
758
- *
759
- * const buf = Buffer.allocUnsafe(6);
760
- *
761
- * buf.writeIntLE(0x1234567890ab, 0, 6);
762
- *
763
- * console.log(buf);
764
- * // Prints: <Buffer ab 90 78 56 34 12>
765
- * ```
766
- * @since v0.11.15
767
- * @param value Number to be written to `buf`.
768
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
769
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
770
- * @return `offset` plus the number of bytes written.
771
- */
772
- writeIntLE(value: number, offset: number, byteLength: number): number;
773
- /**
774
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a
775
- * signed integer.
776
- *
777
- * ```js
778
- * import { Buffer } from 'node:buffer';
779
- *
780
- * const buf = Buffer.allocUnsafe(6);
781
- *
782
- * buf.writeIntBE(0x1234567890ab, 0, 6);
783
- *
784
- * console.log(buf);
785
- * // Prints: <Buffer 12 34 56 78 90 ab>
786
- * ```
787
- * @since v0.11.15
788
- * @param value Number to be written to `buf`.
789
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
790
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
791
- * @return `offset` plus the number of bytes written.
792
- */
793
- writeIntBE(value: number, offset: number, byteLength: number): number;
794
- /**
795
- * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`.
796
- *
797
- * This function is also available under the `readBigUint64BE` alias.
798
- *
799
- * ```js
800
- * import { Buffer } from 'node:buffer';
801
- *
802
- * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
803
- *
804
- * console.log(buf.readBigUInt64BE(0));
805
- * // Prints: 4294967295n
806
- * ```
807
- * @since v12.0.0, v10.20.0
808
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
809
- */
810
- readBigUInt64BE(offset?: number): bigint;
811
- /**
812
- * @alias Buffer.readBigUInt64BE
813
- * @since v14.10.0, v12.19.0
814
- */
815
- readBigUint64BE(offset?: number): bigint;
816
- /**
817
- * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`.
818
- *
819
- * This function is also available under the `readBigUint64LE` alias.
820
- *
821
- * ```js
822
- * import { Buffer } from 'node:buffer';
823
- *
824
- * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
825
- *
826
- * console.log(buf.readBigUInt64LE(0));
827
- * // Prints: 18446744069414584320n
828
- * ```
829
- * @since v12.0.0, v10.20.0
830
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
831
- */
832
- readBigUInt64LE(offset?: number): bigint;
833
- /**
834
- * @alias Buffer.readBigUInt64LE
835
- * @since v14.10.0, v12.19.0
836
- */
837
- readBigUint64LE(offset?: number): bigint;
838
- /**
839
- * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`.
840
- *
841
- * Integers read from a `Buffer` are interpreted as two's complement signed
842
- * values.
843
- * @since v12.0.0, v10.20.0
844
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
845
- */
846
- readBigInt64BE(offset?: number): bigint;
847
- /**
848
- * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`.
849
- *
850
- * Integers read from a `Buffer` are interpreted as two's complement signed
851
- * values.
852
- * @since v12.0.0, v10.20.0
853
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
854
- */
855
- readBigInt64LE(offset?: number): bigint;
856
- /**
857
- * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned, little-endian integer supporting
858
- * up to 48 bits of accuracy.
859
- *
860
- * This function is also available under the `readUintLE` alias.
861
- *
862
- * ```js
863
- * import { Buffer } from 'node:buffer';
864
- *
865
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
866
- *
867
- * console.log(buf.readUIntLE(0, 6).toString(16));
868
- * // Prints: ab9078563412
869
- * ```
870
- * @since v0.11.15
871
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
872
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
873
- */
874
- readUIntLE(offset: number, byteLength: number): number;
875
- /**
876
- * @alias Buffer.readUIntLE
877
- * @since v14.9.0, v12.19.0
878
- */
879
- readUintLE(offset: number, byteLength: number): number;
880
- /**
881
- * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned big-endian integer supporting
882
- * up to 48 bits of accuracy.
883
- *
884
- * This function is also available under the `readUintBE` alias.
885
- *
886
- * ```js
887
- * import { Buffer } from 'node:buffer';
888
- *
889
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
890
- *
891
- * console.log(buf.readUIntBE(0, 6).toString(16));
892
- * // Prints: 1234567890ab
893
- * console.log(buf.readUIntBE(1, 6).toString(16));
894
- * // Throws ERR_OUT_OF_RANGE.
895
- * ```
896
- * @since v0.11.15
897
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
898
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
899
- */
900
- readUIntBE(offset: number, byteLength: number): number;
901
- /**
902
- * @alias Buffer.readUIntBE
903
- * @since v14.9.0, v12.19.0
904
- */
905
- readUintBE(offset: number, byteLength: number): number;
906
- /**
907
- * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a little-endian, two's complement signed value
908
- * supporting up to 48 bits of accuracy.
909
- *
910
- * ```js
911
- * import { Buffer } from 'node:buffer';
912
- *
913
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
914
- *
915
- * console.log(buf.readIntLE(0, 6).toString(16));
916
- * // Prints: -546f87a9cbee
917
- * ```
918
- * @since v0.11.15
919
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
920
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
921
- */
922
- readIntLE(offset: number, byteLength: number): number;
923
- /**
924
- * Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as a big-endian, two's complement signed value
925
- * supporting up to 48 bits of accuracy.
926
- *
927
- * ```js
928
- * import { Buffer } from 'node:buffer';
929
- *
930
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
931
- *
932
- * console.log(buf.readIntBE(0, 6).toString(16));
933
- * // Prints: 1234567890ab
934
- * console.log(buf.readIntBE(1, 6).toString(16));
935
- * // Throws ERR_OUT_OF_RANGE.
936
- * console.log(buf.readIntBE(1, 0).toString(16));
937
- * // Throws ERR_OUT_OF_RANGE.
938
- * ```
939
- * @since v0.11.15
940
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
941
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
942
- */
943
- readIntBE(offset: number, byteLength: number): number;
944
- /**
945
- * Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
946
- *
947
- * This function is also available under the `readUint8` alias.
948
- *
949
- * ```js
950
- * import { Buffer } from 'node:buffer';
951
- *
952
- * const buf = Buffer.from([1, -2]);
953
- *
954
- * console.log(buf.readUInt8(0));
955
- * // Prints: 1
956
- * console.log(buf.readUInt8(1));
957
- * // Prints: 254
958
- * console.log(buf.readUInt8(2));
959
- * // Throws ERR_OUT_OF_RANGE.
960
- * ```
961
- * @since v0.5.0
962
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
963
- */
964
- readUInt8(offset?: number): number;
965
- /**
966
- * @alias Buffer.readUInt8
967
- * @since v14.9.0, v12.19.0
968
- */
969
- readUint8(offset?: number): number;
970
- /**
971
- * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified `offset`.
972
- *
973
- * This function is also available under the `readUint16LE` alias.
974
- *
975
- * ```js
976
- * import { Buffer } from 'node:buffer';
977
- *
978
- * const buf = Buffer.from([0x12, 0x34, 0x56]);
979
- *
980
- * console.log(buf.readUInt16LE(0).toString(16));
981
- * // Prints: 3412
982
- * console.log(buf.readUInt16LE(1).toString(16));
983
- * // Prints: 5634
984
- * console.log(buf.readUInt16LE(2).toString(16));
985
- * // Throws ERR_OUT_OF_RANGE.
986
- * ```
987
- * @since v0.5.5
988
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
989
- */
990
- readUInt16LE(offset?: number): number;
991
- /**
992
- * @alias Buffer.readUInt16LE
993
- * @since v14.9.0, v12.19.0
994
- */
995
- readUint16LE(offset?: number): number;
996
- /**
997
- * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`.
998
- *
999
- * This function is also available under the `readUint16BE` alias.
1000
- *
1001
- * ```js
1002
- * import { Buffer } from 'node:buffer';
1003
- *
1004
- * const buf = Buffer.from([0x12, 0x34, 0x56]);
1005
- *
1006
- * console.log(buf.readUInt16BE(0).toString(16));
1007
- * // Prints: 1234
1008
- * console.log(buf.readUInt16BE(1).toString(16));
1009
- * // Prints: 3456
1010
- * ```
1011
- * @since v0.5.5
1012
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1013
- */
1014
- readUInt16BE(offset?: number): number;
1015
- /**
1016
- * @alias Buffer.readUInt16BE
1017
- * @since v14.9.0, v12.19.0
1018
- */
1019
- readUint16BE(offset?: number): number;
1020
- /**
1021
- * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`.
1022
- *
1023
- * This function is also available under the `readUint32LE` alias.
1024
- *
1025
- * ```js
1026
- * import { Buffer } from 'node:buffer';
1027
- *
1028
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
1029
- *
1030
- * console.log(buf.readUInt32LE(0).toString(16));
1031
- * // Prints: 78563412
1032
- * console.log(buf.readUInt32LE(1).toString(16));
1033
- * // Throws ERR_OUT_OF_RANGE.
1034
- * ```
1035
- * @since v0.5.5
1036
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1037
- */
1038
- readUInt32LE(offset?: number): number;
1039
- /**
1040
- * @alias Buffer.readUInt32LE
1041
- * @since v14.9.0, v12.19.0
1042
- */
1043
- readUint32LE(offset?: number): number;
1044
- /**
1045
- * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`.
1046
- *
1047
- * This function is also available under the `readUint32BE` alias.
1048
- *
1049
- * ```js
1050
- * import { Buffer } from 'node:buffer';
1051
- *
1052
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
1053
- *
1054
- * console.log(buf.readUInt32BE(0).toString(16));
1055
- * // Prints: 12345678
1056
- * ```
1057
- * @since v0.5.5
1058
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1059
- */
1060
- readUInt32BE(offset?: number): number;
1061
- /**
1062
- * @alias Buffer.readUInt32BE
1063
- * @since v14.9.0, v12.19.0
1064
- */
1065
- readUint32BE(offset?: number): number;
1066
- /**
1067
- * Reads a signed 8-bit integer from `buf` at the specified `offset`.
1068
- *
1069
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
1070
- *
1071
- * ```js
1072
- * import { Buffer } from 'node:buffer';
1073
- *
1074
- * const buf = Buffer.from([-1, 5]);
1075
- *
1076
- * console.log(buf.readInt8(0));
1077
- * // Prints: -1
1078
- * console.log(buf.readInt8(1));
1079
- * // Prints: 5
1080
- * console.log(buf.readInt8(2));
1081
- * // Throws ERR_OUT_OF_RANGE.
1082
- * ```
1083
- * @since v0.5.0
1084
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
1085
- */
1086
- readInt8(offset?: number): number;
1087
- /**
1088
- * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`.
1089
- *
1090
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
1091
- *
1092
- * ```js
1093
- * import { Buffer } from 'node:buffer';
1094
- *
1095
- * const buf = Buffer.from([0, 5]);
1096
- *
1097
- * console.log(buf.readInt16LE(0));
1098
- * // Prints: 1280
1099
- * console.log(buf.readInt16LE(1));
1100
- * // Throws ERR_OUT_OF_RANGE.
1101
- * ```
1102
- * @since v0.5.5
1103
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1104
- */
1105
- readInt16LE(offset?: number): number;
1106
- /**
1107
- * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`.
1108
- *
1109
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
1110
- *
1111
- * ```js
1112
- * import { Buffer } from 'node:buffer';
1113
- *
1114
- * const buf = Buffer.from([0, 5]);
1115
- *
1116
- * console.log(buf.readInt16BE(0));
1117
- * // Prints: 5
1118
- * ```
1119
- * @since v0.5.5
1120
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1121
- */
1122
- readInt16BE(offset?: number): number;
1123
- /**
1124
- * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`.
1125
- *
1126
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
1127
- *
1128
- * ```js
1129
- * import { Buffer } from 'node:buffer';
1130
- *
1131
- * const buf = Buffer.from([0, 0, 0, 5]);
1132
- *
1133
- * console.log(buf.readInt32LE(0));
1134
- * // Prints: 83886080
1135
- * console.log(buf.readInt32LE(1));
1136
- * // Throws ERR_OUT_OF_RANGE.
1137
- * ```
1138
- * @since v0.5.5
1139
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1140
- */
1141
- readInt32LE(offset?: number): number;
1142
- /**
1143
- * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`.
1144
- *
1145
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
1146
- *
1147
- * ```js
1148
- * import { Buffer } from 'node:buffer';
1149
- *
1150
- * const buf = Buffer.from([0, 0, 0, 5]);
1151
- *
1152
- * console.log(buf.readInt32BE(0));
1153
- * // Prints: 5
1154
- * ```
1155
- * @since v0.5.5
1156
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1157
- */
1158
- readInt32BE(offset?: number): number;
1159
- /**
1160
- * Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
1161
- *
1162
- * ```js
1163
- * import { Buffer } from 'node:buffer';
1164
- *
1165
- * const buf = Buffer.from([1, 2, 3, 4]);
1166
- *
1167
- * console.log(buf.readFloatLE(0));
1168
- * // Prints: 1.539989614439558e-36
1169
- * console.log(buf.readFloatLE(1));
1170
- * // Throws ERR_OUT_OF_RANGE.
1171
- * ```
1172
- * @since v0.11.15
1173
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1174
- */
1175
- readFloatLE(offset?: number): number;
1176
- /**
1177
- * Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
1178
- *
1179
- * ```js
1180
- * import { Buffer } from 'node:buffer';
1181
- *
1182
- * const buf = Buffer.from([1, 2, 3, 4]);
1183
- *
1184
- * console.log(buf.readFloatBE(0));
1185
- * // Prints: 2.387939260590663e-38
1186
- * ```
1187
- * @since v0.11.15
1188
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1189
- */
1190
- readFloatBE(offset?: number): number;
1191
- /**
1192
- * Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
1193
- *
1194
- * ```js
1195
- * import { Buffer } from 'node:buffer';
1196
- *
1197
- * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
1198
- *
1199
- * console.log(buf.readDoubleLE(0));
1200
- * // Prints: 5.447603722011605e-270
1201
- * console.log(buf.readDoubleLE(1));
1202
- * // Throws ERR_OUT_OF_RANGE.
1203
- * ```
1204
- * @since v0.11.15
1205
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
1206
- */
1207
- readDoubleLE(offset?: number): number;
1208
- /**
1209
- * Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
1210
- *
1211
- * ```js
1212
- * import { Buffer } from 'node:buffer';
1213
- *
1214
- * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
1215
- *
1216
- * console.log(buf.readDoubleBE(0));
1217
- * // Prints: 8.20788039913184e-304
1218
- * ```
1219
- * @since v0.11.15
1220
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
1221
- */
1222
- readDoubleBE(offset?: number): number;
1223
- reverse(): this;
1224
- /**
1225
- * Interprets `buf` as an array of unsigned 16-bit integers and swaps the
1226
- * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
1227
- *
1228
- * ```js
1229
- * import { Buffer } from 'node:buffer';
1230
- *
1231
- * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
1232
- *
1233
- * console.log(buf1);
1234
- * // Prints: <Buffer 01 02 03 04 05 06 07 08>
1235
- *
1236
- * buf1.swap16();
1237
- *
1238
- * console.log(buf1);
1239
- * // Prints: <Buffer 02 01 04 03 06 05 08 07>
1240
- *
1241
- * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
1242
- *
1243
- * buf2.swap16();
1244
- * // Throws ERR_INVALID_BUFFER_SIZE.
1245
- * ```
1246
- *
1247
- * One convenient use of `buf.swap16()` is to perform a fast in-place conversion
1248
- * between UTF-16 little-endian and UTF-16 big-endian:
1249
- *
1250
- * ```js
1251
- * import { Buffer } from 'node:buffer';
1252
- *
1253
- * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
1254
- * buf.swap16(); // Convert to big-endian UTF-16 text.
1255
- * ```
1256
- * @since v5.10.0
1257
- * @return A reference to `buf`.
1258
- */
1259
- swap16(): this;
1260
- /**
1261
- * Interprets `buf` as an array of unsigned 32-bit integers and swaps the
1262
- * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
1263
- *
1264
- * ```js
1265
- * import { Buffer } from 'node:buffer';
1266
- *
1267
- * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
1268
- *
1269
- * console.log(buf1);
1270
- * // Prints: <Buffer 01 02 03 04 05 06 07 08>
1271
- *
1272
- * buf1.swap32();
1273
- *
1274
- * console.log(buf1);
1275
- * // Prints: <Buffer 04 03 02 01 08 07 06 05>
1276
- *
1277
- * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
1278
- *
1279
- * buf2.swap32();
1280
- * // Throws ERR_INVALID_BUFFER_SIZE.
1281
- * ```
1282
- * @since v5.10.0
1283
- * @return A reference to `buf`.
1284
- */
1285
- swap32(): this;
1286
- /**
1287
- * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
1288
- * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
1289
- *
1290
- * ```js
1291
- * import { Buffer } from 'node:buffer';
1292
- *
1293
- * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
1294
- *
1295
- * console.log(buf1);
1296
- * // Prints: <Buffer 01 02 03 04 05 06 07 08>
1297
- *
1298
- * buf1.swap64();
1299
- *
1300
- * console.log(buf1);
1301
- * // Prints: <Buffer 08 07 06 05 04 03 02 01>
1302
- *
1303
- * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
1304
- *
1305
- * buf2.swap64();
1306
- * // Throws ERR_INVALID_BUFFER_SIZE.
1307
- * ```
1308
- * @since v6.3.0
1309
- * @return A reference to `buf`.
1310
- */
1311
- swap64(): this;
1312
- /**
1313
- * Writes `value` to `buf` at the specified `offset`. `value` must be a
1314
- * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
1315
- * other than an unsigned 8-bit integer.
1316
- *
1317
- * This function is also available under the `writeUint8` alias.
1318
- *
1319
- * ```js
1320
- * import { Buffer } from 'node:buffer';
1321
- *
1322
- * const buf = Buffer.allocUnsafe(4);
1323
- *
1324
- * buf.writeUInt8(0x3, 0);
1325
- * buf.writeUInt8(0x4, 1);
1326
- * buf.writeUInt8(0x23, 2);
1327
- * buf.writeUInt8(0x42, 3);
1328
- *
1329
- * console.log(buf);
1330
- * // Prints: <Buffer 03 04 23 42>
1331
- * ```
1332
- * @since v0.5.0
1333
- * @param value Number to be written to `buf`.
1334
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
1335
- * @return `offset` plus the number of bytes written.
1336
- */
1337
- writeUInt8(value: number, offset?: number): number;
1338
- /**
1339
- * @alias Buffer.writeUInt8
1340
- * @since v14.9.0, v12.19.0
1341
- */
1342
- writeUint8(value: number, offset?: number): number;
1343
- /**
1344
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is
1345
- * anything other than an unsigned 16-bit integer.
1346
- *
1347
- * This function is also available under the `writeUint16LE` alias.
1348
- *
1349
- * ```js
1350
- * import { Buffer } from 'node:buffer';
1351
- *
1352
- * const buf = Buffer.allocUnsafe(4);
1353
- *
1354
- * buf.writeUInt16LE(0xdead, 0);
1355
- * buf.writeUInt16LE(0xbeef, 2);
1356
- *
1357
- * console.log(buf);
1358
- * // Prints: <Buffer ad de ef be>
1359
- * ```
1360
- * @since v0.5.5
1361
- * @param value Number to be written to `buf`.
1362
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1363
- * @return `offset` plus the number of bytes written.
1364
- */
1365
- writeUInt16LE(value: number, offset?: number): number;
1366
- /**
1367
- * @alias Buffer.writeUInt16LE
1368
- * @since v14.9.0, v12.19.0
1369
- */
1370
- writeUint16LE(value: number, offset?: number): number;
1371
- /**
1372
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an
1373
- * unsigned 16-bit integer.
1374
- *
1375
- * This function is also available under the `writeUint16BE` alias.
1376
- *
1377
- * ```js
1378
- * import { Buffer } from 'node:buffer';
1379
- *
1380
- * const buf = Buffer.allocUnsafe(4);
1381
- *
1382
- * buf.writeUInt16BE(0xdead, 0);
1383
- * buf.writeUInt16BE(0xbeef, 2);
1384
- *
1385
- * console.log(buf);
1386
- * // Prints: <Buffer de ad be ef>
1387
- * ```
1388
- * @since v0.5.5
1389
- * @param value Number to be written to `buf`.
1390
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1391
- * @return `offset` plus the number of bytes written.
1392
- */
1393
- writeUInt16BE(value: number, offset?: number): number;
1394
- /**
1395
- * @alias Buffer.writeUInt16BE
1396
- * @since v14.9.0, v12.19.0
1397
- */
1398
- writeUint16BE(value: number, offset?: number): number;
1399
- /**
1400
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is
1401
- * anything other than an unsigned 32-bit integer.
1402
- *
1403
- * This function is also available under the `writeUint32LE` alias.
1404
- *
1405
- * ```js
1406
- * import { Buffer } from 'node:buffer';
1407
- *
1408
- * const buf = Buffer.allocUnsafe(4);
1409
- *
1410
- * buf.writeUInt32LE(0xfeedface, 0);
1411
- *
1412
- * console.log(buf);
1413
- * // Prints: <Buffer ce fa ed fe>
1414
- * ```
1415
- * @since v0.5.5
1416
- * @param value Number to be written to `buf`.
1417
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1418
- * @return `offset` plus the number of bytes written.
1419
- */
1420
- writeUInt32LE(value: number, offset?: number): number;
1421
- /**
1422
- * @alias Buffer.writeUInt32LE
1423
- * @since v14.9.0, v12.19.0
1424
- */
1425
- writeUint32LE(value: number, offset?: number): number;
1426
- /**
1427
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an
1428
- * unsigned 32-bit integer.
1429
- *
1430
- * This function is also available under the `writeUint32BE` alias.
1431
- *
1432
- * ```js
1433
- * import { Buffer } from 'node:buffer';
1434
- *
1435
- * const buf = Buffer.allocUnsafe(4);
1436
- *
1437
- * buf.writeUInt32BE(0xfeedface, 0);
1438
- *
1439
- * console.log(buf);
1440
- * // Prints: <Buffer fe ed fa ce>
1441
- * ```
1442
- * @since v0.5.5
1443
- * @param value Number to be written to `buf`.
1444
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1445
- * @return `offset` plus the number of bytes written.
1446
- */
1447
- writeUInt32BE(value: number, offset?: number): number;
1448
- /**
1449
- * @alias Buffer.writeUInt32BE
1450
- * @since v14.9.0, v12.19.0
1451
- */
1452
- writeUint32BE(value: number, offset?: number): number;
1453
- /**
1454
- * Writes `value` to `buf` at the specified `offset`. `value` must be a valid
1455
- * signed 8-bit integer. Behavior is undefined when `value` is anything other than
1456
- * a signed 8-bit integer.
1457
- *
1458
- * `value` is interpreted and written as a two's complement signed integer.
1459
- *
1460
- * ```js
1461
- * import { Buffer } from 'node:buffer';
1462
- *
1463
- * const buf = Buffer.allocUnsafe(2);
1464
- *
1465
- * buf.writeInt8(2, 0);
1466
- * buf.writeInt8(-2, 1);
1467
- *
1468
- * console.log(buf);
1469
- * // Prints: <Buffer 02 fe>
1470
- * ```
1471
- * @since v0.5.0
1472
- * @param value Number to be written to `buf`.
1473
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
1474
- * @return `offset` plus the number of bytes written.
1475
- */
1476
- writeInt8(value: number, offset?: number): number;
1477
- /**
1478
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is
1479
- * anything other than a signed 16-bit integer.
1480
- *
1481
- * The `value` is interpreted and written as a two's complement signed integer.
1482
- *
1483
- * ```js
1484
- * import { Buffer } from 'node:buffer';
1485
- *
1486
- * const buf = Buffer.allocUnsafe(2);
1487
- *
1488
- * buf.writeInt16LE(0x0304, 0);
1489
- *
1490
- * console.log(buf);
1491
- * // Prints: <Buffer 04 03>
1492
- * ```
1493
- * @since v0.5.5
1494
- * @param value Number to be written to `buf`.
1495
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1496
- * @return `offset` plus the number of bytes written.
1497
- */
1498
- writeInt16LE(value: number, offset?: number): number;
1499
- /**
1500
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 16-bit integer. Behavior is undefined when `value` is
1501
- * anything other than a signed 16-bit integer.
1502
- *
1503
- * The `value` is interpreted and written as a two's complement signed integer.
1504
- *
1505
- * ```js
1506
- * import { Buffer } from 'node:buffer';
1507
- *
1508
- * const buf = Buffer.allocUnsafe(2);
1509
- *
1510
- * buf.writeInt16BE(0x0102, 0);
1511
- *
1512
- * console.log(buf);
1513
- * // Prints: <Buffer 01 02>
1514
- * ```
1515
- * @since v0.5.5
1516
- * @param value Number to be written to `buf`.
1517
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1518
- * @return `offset` plus the number of bytes written.
1519
- */
1520
- writeInt16BE(value: number, offset?: number): number;
1521
- /**
1522
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is
1523
- * anything other than a signed 32-bit integer.
1524
- *
1525
- * The `value` is interpreted and written as a two's complement signed integer.
1526
- *
1527
- * ```js
1528
- * import { Buffer } from 'node:buffer';
1529
- *
1530
- * const buf = Buffer.allocUnsafe(4);
1531
- *
1532
- * buf.writeInt32LE(0x05060708, 0);
1533
- *
1534
- * console.log(buf);
1535
- * // Prints: <Buffer 08 07 06 05>
1536
- * ```
1537
- * @since v0.5.5
1538
- * @param value Number to be written to `buf`.
1539
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1540
- * @return `offset` plus the number of bytes written.
1541
- */
1542
- writeInt32LE(value: number, offset?: number): number;
1543
- /**
1544
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid signed 32-bit integer. Behavior is undefined when `value` is
1545
- * anything other than a signed 32-bit integer.
1546
- *
1547
- * The `value` is interpreted and written as a two's complement signed integer.
1548
- *
1549
- * ```js
1550
- * import { Buffer } from 'node:buffer';
1551
- *
1552
- * const buf = Buffer.allocUnsafe(4);
1553
- *
1554
- * buf.writeInt32BE(0x01020304, 0);
1555
- *
1556
- * console.log(buf);
1557
- * // Prints: <Buffer 01 02 03 04>
1558
- * ```
1559
- * @since v0.5.5
1560
- * @param value Number to be written to `buf`.
1561
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1562
- * @return `offset` plus the number of bytes written.
1563
- */
1564
- writeInt32BE(value: number, offset?: number): number;
1565
- /**
1566
- * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is
1567
- * undefined when `value` is anything other than a JavaScript number.
1568
- *
1569
- * ```js
1570
- * import { Buffer } from 'node:buffer';
1571
- *
1572
- * const buf = Buffer.allocUnsafe(4);
1573
- *
1574
- * buf.writeFloatLE(0xcafebabe, 0);
1575
- *
1576
- * console.log(buf);
1577
- * // Prints: <Buffer bb fe 4a 4f>
1578
- * ```
1579
- * @since v0.11.15
1580
- * @param value Number to be written to `buf`.
1581
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1582
- * @return `offset` plus the number of bytes written.
1583
- */
1584
- writeFloatLE(value: number, offset?: number): number;
1585
- /**
1586
- * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is
1587
- * undefined when `value` is anything other than a JavaScript number.
1588
- *
1589
- * ```js
1590
- * import { Buffer } from 'node:buffer';
1591
- *
1592
- * const buf = Buffer.allocUnsafe(4);
1593
- *
1594
- * buf.writeFloatBE(0xcafebabe, 0);
1595
- *
1596
- * console.log(buf);
1597
- * // Prints: <Buffer 4f 4a fe bb>
1598
- * ```
1599
- * @since v0.11.15
1600
- * @param value Number to be written to `buf`.
1601
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1602
- * @return `offset` plus the number of bytes written.
1603
- */
1604
- writeFloatBE(value: number, offset?: number): number;
1605
- /**
1606
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything
1607
- * other than a JavaScript number.
1608
- *
1609
- * ```js
1610
- * import { Buffer } from 'node:buffer';
1611
- *
1612
- * const buf = Buffer.allocUnsafe(8);
1613
- *
1614
- * buf.writeDoubleLE(123.456, 0);
1615
- *
1616
- * console.log(buf);
1617
- * // Prints: <Buffer 77 be 9f 1a 2f dd 5e 40>
1618
- * ```
1619
- * @since v0.11.15
1620
- * @param value Number to be written to `buf`.
1621
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
1622
- * @return `offset` plus the number of bytes written.
1623
- */
1624
- writeDoubleLE(value: number, offset?: number): number;
1625
- /**
1626
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything
1627
- * other than a JavaScript number.
1628
- *
1629
- * ```js
1630
- * import { Buffer } from 'node:buffer';
1631
- *
1632
- * const buf = Buffer.allocUnsafe(8);
1633
- *
1634
- * buf.writeDoubleBE(123.456, 0);
1635
- *
1636
- * console.log(buf);
1637
- * // Prints: <Buffer 40 5e dd 2f 1a 9f be 77>
1638
- * ```
1639
- * @since v0.11.15
1640
- * @param value Number to be written to `buf`.
1641
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
1642
- * @return `offset` plus the number of bytes written.
1643
- */
1644
- writeDoubleBE(value: number, offset?: number): number;
1645
- /**
1646
- * Fills `buf` with the specified `value`. If the `offset` and `end` are not given,
1647
- * the entire `buf` will be filled:
1648
- *
1649
- * ```js
1650
- * import { Buffer } from 'node:buffer';
1651
- *
1652
- * // Fill a `Buffer` with the ASCII character 'h'.
1653
- *
1654
- * const b = Buffer.allocUnsafe(50).fill('h');
1655
- *
1656
- * console.log(b.toString());
1657
- * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
1658
- *
1659
- * // Fill a buffer with empty string
1660
- * const c = Buffer.allocUnsafe(5).fill('');
1661
- *
1662
- * console.log(c.fill(''));
1663
- * // Prints: <Buffer 00 00 00 00 00>
1664
- * ```
1665
- *
1666
- * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
1667
- * integer. If the resulting integer is greater than `255` (decimal), `buf` will be
1668
- * filled with `value &#x26; 255`.
1669
- *
1670
- * If the final write of a `fill()` operation falls on a multi-byte character,
1671
- * then only the bytes of that character that fit into `buf` are written:
1672
- *
1673
- * ```js
1674
- * import { Buffer } from 'node:buffer';
1675
- *
1676
- * // Fill a `Buffer` with character that takes up two bytes in UTF-8.
1677
- *
1678
- * console.log(Buffer.allocUnsafe(5).fill('\u0222'));
1679
- * // Prints: <Buffer c8 a2 c8 a2 c8>
1680
- * ```
1681
- *
1682
- * If `value` contains invalid characters, it is truncated; if no valid
1683
- * fill data remains, an exception is thrown:
1684
- *
1685
- * ```js
1686
- * import { Buffer } from 'node:buffer';
1687
- *
1688
- * const buf = Buffer.allocUnsafe(5);
1689
- *
1690
- * console.log(buf.fill('a'));
1691
- * // Prints: <Buffer 61 61 61 61 61>
1692
- * console.log(buf.fill('aazz', 'hex'));
1693
- * // Prints: <Buffer aa aa aa aa aa>
1694
- * console.log(buf.fill('zz', 'hex'));
1695
- * // Throws an exception.
1696
- * ```
1697
- * @since v0.5.0
1698
- * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`.
1699
- * @param [offset=0] Number of bytes to skip before starting to fill `buf`.
1700
- * @param [end=buf.length] Where to stop filling `buf` (not inclusive).
1701
- * @param [encoding='utf8'] The encoding for `value` if `value` is a string.
1702
- * @return A reference to `buf`.
1703
- */
1704
- fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
1705
- /**
1706
- * If `value` is:
1707
- *
1708
- * * a string, `value` is interpreted according to the character encoding in `encoding`.
1709
- * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety.
1710
- * To compare a partial `Buffer`, use `buf.subarray`.
1711
- * * a number, `value` will be interpreted as an unsigned 8-bit integer
1712
- * value between `0` and `255`.
1713
- *
1714
- * ```js
1715
- * import { Buffer } from 'node:buffer';
1716
- *
1717
- * const buf = Buffer.from('this is a buffer');
1718
- *
1719
- * console.log(buf.indexOf('this'));
1720
- * // Prints: 0
1721
- * console.log(buf.indexOf('is'));
1722
- * // Prints: 2
1723
- * console.log(buf.indexOf(Buffer.from('a buffer')));
1724
- * // Prints: 8
1725
- * console.log(buf.indexOf(97));
1726
- * // Prints: 8 (97 is the decimal ASCII value for 'a')
1727
- * console.log(buf.indexOf(Buffer.from('a buffer example')));
1728
- * // Prints: -1
1729
- * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8)));
1730
- * // Prints: 8
1731
- *
1732
- * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
1733
- *
1734
- * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le'));
1735
- * // Prints: 4
1736
- * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le'));
1737
- * // Prints: 6
1738
- * ```
1739
- *
1740
- * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value,
1741
- * an integer between 0 and 255.
1742
- *
1743
- * If `byteOffset` is not a number, it will be coerced to a number. If the result
1744
- * of coercion is `NaN` or `0`, then the entire buffer will be searched. This
1745
- * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
1746
- *
1747
- * ```js
1748
- * import { Buffer } from 'node:buffer';
1749
- *
1750
- * const b = Buffer.from('abcdef');
1751
- *
1752
- * // Passing a value that's a number, but not a valid byte.
1753
- * // Prints: 2, equivalent to searching for 99 or 'c'.
1754
- * console.log(b.indexOf(99.9));
1755
- * console.log(b.indexOf(256 + 99));
1756
- *
1757
- * // Passing a byteOffset that coerces to NaN or 0.
1758
- * // Prints: 1, searching the whole buffer.
1759
- * console.log(b.indexOf('b', undefined));
1760
- * console.log(b.indexOf('b', {}));
1761
- * console.log(b.indexOf('b', null));
1762
- * console.log(b.indexOf('b', []));
1763
- * ```
1764
- *
1765
- * If `value` is an empty string or empty `Buffer` and `byteOffset` is less
1766
- * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned.
1767
- * @since v1.5.0
1768
- * @param value What to search for.
1769
- * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
1770
- * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
1771
- * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
1772
- */
1773
- indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
1774
- /**
1775
- * Identical to `buf.indexOf()`, except the last occurrence of `value` is found
1776
- * rather than the first occurrence.
1777
- *
1778
- * ```js
1779
- * import { Buffer } from 'node:buffer';
1780
- *
1781
- * const buf = Buffer.from('this buffer is a buffer');
1782
- *
1783
- * console.log(buf.lastIndexOf('this'));
1784
- * // Prints: 0
1785
- * console.log(buf.lastIndexOf('buffer'));
1786
- * // Prints: 17
1787
- * console.log(buf.lastIndexOf(Buffer.from('buffer')));
1788
- * // Prints: 17
1789
- * console.log(buf.lastIndexOf(97));
1790
- * // Prints: 15 (97 is the decimal ASCII value for 'a')
1791
- * console.log(buf.lastIndexOf(Buffer.from('yolo')));
1792
- * // Prints: -1
1793
- * console.log(buf.lastIndexOf('buffer', 5));
1794
- * // Prints: 5
1795
- * console.log(buf.lastIndexOf('buffer', 4));
1796
- * // Prints: -1
1797
- *
1798
- * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
1799
- *
1800
- * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le'));
1801
- * // Prints: 6
1802
- * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le'));
1803
- * // Prints: 4
1804
- * ```
1805
- *
1806
- * If `value` is not a string, number, or `Buffer`, this method will throw a `TypeError`. If `value` is a number, it will be coerced to a valid byte value,
1807
- * an integer between 0 and 255.
1808
- *
1809
- * If `byteOffset` is not a number, it will be coerced to a number. Any arguments
1810
- * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer.
1811
- * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
1812
- *
1813
- * ```js
1814
- * import { Buffer } from 'node:buffer';
1815
- *
1816
- * const b = Buffer.from('abcdef');
1817
- *
1818
- * // Passing a value that's a number, but not a valid byte.
1819
- * // Prints: 2, equivalent to searching for 99 or 'c'.
1820
- * console.log(b.lastIndexOf(99.9));
1821
- * console.log(b.lastIndexOf(256 + 99));
1822
- *
1823
- * // Passing a byteOffset that coerces to NaN.
1824
- * // Prints: 1, searching the whole buffer.
1825
- * console.log(b.lastIndexOf('b', undefined));
1826
- * console.log(b.lastIndexOf('b', {}));
1827
- *
1828
- * // Passing a byteOffset that coerces to 0.
1829
- * // Prints: -1, equivalent to passing 0.
1830
- * console.log(b.lastIndexOf('b', null));
1831
- * console.log(b.lastIndexOf('b', []));
1832
- * ```
1833
- *
1834
- * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
1835
- * @since v6.0.0
1836
- * @param value What to search for.
1837
- * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
1838
- * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
1839
- * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
1840
- */
1841
- lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
1842
- /**
1843
- * Equivalent to `buf.indexOf() !== -1`.
1844
- *
1845
- * ```js
1846
- * import { Buffer } from 'node:buffer';
1847
- *
1848
- * const buf = Buffer.from('this is a buffer');
1849
- *
1850
- * console.log(buf.includes('this'));
1851
- * // Prints: true
1852
- * console.log(buf.includes('is'));
1853
- * // Prints: true
1854
- * console.log(buf.includes(Buffer.from('a buffer')));
1855
- * // Prints: true
1856
- * console.log(buf.includes(97));
1857
- * // Prints: true (97 is the decimal ASCII value for 'a')
1858
- * console.log(buf.includes(Buffer.from('a buffer example')));
1859
- * // Prints: false
1860
- * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8)));
1861
- * // Prints: true
1862
- * console.log(buf.includes('this', 4));
1863
- * // Prints: false
1864
- * ```
1865
- * @since v5.3.0
1866
- * @param value What to search for.
1867
- * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
1868
- * @param [encoding='utf8'] If `value` is a string, this is its encoding.
1869
- * @return `true` if `value` was found in `buf`, `false` otherwise.
1870
- */
1871
- includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
1872
- }
1873
- var Buffer: BufferConstructor;
1874
- /**
1875
- * Decodes a string of Base64-encoded data into bytes, and encodes those bytes
1876
- * into a string using Latin-1 (ISO-8859-1).
1877
- *
1878
- * The `data` may be any JavaScript-value that can be coerced into a string.
1879
- *
1880
- * **This function is only provided for compatibility with legacy web platform APIs**
1881
- * **and should never be used in new code, because they use strings to represent**
1882
- * **binary data and predate the introduction of typed arrays in JavaScript.**
1883
- * **For code running using Node.js APIs, converting between base64-encoded strings**
1884
- * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.**
1885
- * @since v15.13.0, v14.17.0
1886
- * @legacy Use `Buffer.from(data, 'base64')` instead.
1887
- * @param data The Base64-encoded input string.
1888
- */
1889
- function atob(data: string): string;
1890
- /**
1891
- * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes
1892
- * into a string using Base64.
1893
- *
1894
- * The `data` may be any JavaScript-value that can be coerced into a string.
1895
- *
1896
- * **This function is only provided for compatibility with legacy web platform APIs**
1897
- * **and should never be used in new code, because they use strings to represent**
1898
- * **binary data and predate the introduction of typed arrays in JavaScript.**
1899
- * **For code running using Node.js APIs, converting between base64-encoded strings**
1900
- * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.**
1901
- * @since v15.13.0, v14.17.0
1902
- * @legacy Use `buf.toString('base64')` instead.
1903
- * @param data An ASCII (Latin1) string.
1904
- */
1905
- function btoa(data: string): string;
1906
- interface Blob extends _Blob {}
1907
- /**
1908
- * `Blob` class is a global reference for `import { Blob } from 'node:buffer'`
1909
- * https://nodejs.org/api/buffer.html#class-blob
1910
- * @since v18.0.0
1911
- */
1912
- var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T
1913
- : typeof import("buffer").Blob;
1914
- interface File extends _File {}
1915
- /**
1916
- * `File` class is a global reference for `import { File } from 'node:buffer'`
1917
- * https://nodejs.org/api/buffer.html#class-file
1918
- * @since v20.0.0
1919
- */
1920
- var File: typeof globalThis extends { onmessage: any; File: infer T } ? T
1921
- : typeof import("buffer").File;
1922
- }
1923
- }
1924
- declare module "node:buffer" {
1925
- export * from "buffer";
1926
- }