cdk-ecr-deployment 3.3.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (565) hide show
  1. package/.jsii +26 -107
  2. package/.jsii.tabl.json +1 -1
  3. package/API.md +0 -59
  4. package/README.md +7 -17
  5. package/lib/index.d.ts +1 -29
  6. package/lib/index.js +8 -26
  7. package/package.json +1 -13
  8. package/build-lambda.sh +0 -12
  9. package/lambda-src/.dockerignore +0 -9
  10. package/lambda-src/Dockerfile +0 -26
  11. package/lambda-src/Makefile +0 -33
  12. package/lambda-src/go.mod +0 -136
  13. package/lambda-src/go.sum +0 -499
  14. package/lambda-src/internal/iolimits/iolimits.go +0 -68
  15. package/lambda-src/internal/iolimits/iolimits_test.go +0 -39
  16. package/lambda-src/internal/tarfile/reader.go +0 -179
  17. package/lambda-src/internal/tarfile/reader_test.go +0 -31
  18. package/lambda-src/internal/tarfile/s3file.go +0 -363
  19. package/lambda-src/internal/tarfile/s3file_test.go +0 -135
  20. package/lambda-src/internal/tarfile/src.go +0 -328
  21. package/lambda-src/internal/tarfile/types.go +0 -31
  22. package/lambda-src/main.go +0 -176
  23. package/lambda-src/main_test.go +0 -64
  24. package/lambda-src/s3/src.go +0 -40
  25. package/lambda-src/s3/transport.go +0 -149
  26. package/lambda-src/s3/transport_test.go +0 -96
  27. package/lambda-src/utils.go +0 -206
  28. package/lambda-src/utils_test.go +0 -63
  29. package/lib/config.d.ts +0 -1
  30. package/lib/config.js +0 -12
  31. package/node_modules/@sindresorhus/is/dist/index.d.ts +0 -232
  32. package/node_modules/@sindresorhus/is/dist/index.js +0 -434
  33. package/node_modules/@sindresorhus/is/dist/types.d.ts +0 -25
  34. package/node_modules/@sindresorhus/is/dist/types.js +0 -3
  35. package/node_modules/@sindresorhus/is/license +0 -9
  36. package/node_modules/@sindresorhus/is/package.json +0 -96
  37. package/node_modules/@sindresorhus/is/readme.md +0 -669
  38. package/node_modules/@szmarczak/http-timer/LICENSE +0 -21
  39. package/node_modules/@szmarczak/http-timer/README.md +0 -93
  40. package/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +0 -32
  41. package/node_modules/@szmarczak/http-timer/dist/source/index.js +0 -126
  42. package/node_modules/@szmarczak/http-timer/package.json +0 -72
  43. package/node_modules/@types/cacheable-request/LICENSE +0 -21
  44. package/node_modules/@types/cacheable-request/README.md +0 -16
  45. package/node_modules/@types/cacheable-request/index.d.ts +0 -137
  46. package/node_modules/@types/cacheable-request/node_modules/@types/node/LICENSE +0 -21
  47. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +0 -15
  48. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +0 -8
  49. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +0 -1095
  50. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +0 -541
  51. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.buffer.d.ts +0 -460
  52. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +0 -1926
  53. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +0 -1549
  54. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +0 -579
  55. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  56. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/index.d.ts +0 -9
  57. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  58. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  59. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +0 -452
  60. package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +0 -21
  61. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +0 -4510
  62. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +0 -599
  63. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  64. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +0 -476
  65. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +0 -865
  66. package/node_modules/@types/cacheable-request/node_modules/@types/node/dom-events.d.ts +0 -124
  67. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +0 -170
  68. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +0 -931
  69. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +0 -1275
  70. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +0 -4343
  71. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +0 -511
  72. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  73. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +0 -1959
  74. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +0 -2558
  75. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +0 -543
  76. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +0 -92
  77. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +0 -3966
  78. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +0 -702
  79. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +0 -1029
  80. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +0 -495
  81. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +0 -220
  82. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +0 -200
  83. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +0 -970
  84. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +0 -2013
  85. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +0 -117
  86. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +0 -153
  87. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +0 -162
  88. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +0 -589
  89. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +0 -430
  90. package/node_modules/@types/cacheable-request/node_modules/@types/node/sea.d.ts +0 -153
  91. package/node_modules/@types/cacheable-request/node_modules/@types/node/sqlite.d.ts +0 -439
  92. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +0 -12
  93. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +0 -90
  94. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +0 -614
  95. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +0 -1662
  96. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +0 -67
  97. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +0 -2150
  98. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +0 -97
  99. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +0 -240
  100. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +0 -1226
  101. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +0 -197
  102. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
  103. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  104. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  105. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +0 -208
  106. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +0 -972
  107. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +0 -2439
  108. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +0 -808
  109. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +0 -976
  110. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +0 -181
  111. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +0 -745
  112. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +0 -539
  113. package/node_modules/@types/cacheable-request/node_modules/undici-types/LICENSE +0 -21
  114. package/node_modules/@types/cacheable-request/node_modules/undici-types/README.md +0 -6
  115. package/node_modules/@types/cacheable-request/node_modules/undici-types/agent.d.ts +0 -31
  116. package/node_modules/@types/cacheable-request/node_modules/undici-types/api.d.ts +0 -43
  117. package/node_modules/@types/cacheable-request/node_modules/undici-types/balanced-pool.d.ts +0 -29
  118. package/node_modules/@types/cacheable-request/node_modules/undici-types/cache.d.ts +0 -36
  119. package/node_modules/@types/cacheable-request/node_modules/undici-types/client.d.ts +0 -108
  120. package/node_modules/@types/cacheable-request/node_modules/undici-types/connector.d.ts +0 -34
  121. package/node_modules/@types/cacheable-request/node_modules/undici-types/content-type.d.ts +0 -21
  122. package/node_modules/@types/cacheable-request/node_modules/undici-types/cookies.d.ts +0 -28
  123. package/node_modules/@types/cacheable-request/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  124. package/node_modules/@types/cacheable-request/node_modules/undici-types/dispatcher.d.ts +0 -255
  125. package/node_modules/@types/cacheable-request/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  126. package/node_modules/@types/cacheable-request/node_modules/undici-types/errors.d.ts +0 -149
  127. package/node_modules/@types/cacheable-request/node_modules/undici-types/eventsource.d.ts +0 -61
  128. package/node_modules/@types/cacheable-request/node_modules/undici-types/fetch.d.ts +0 -209
  129. package/node_modules/@types/cacheable-request/node_modules/undici-types/file.d.ts +0 -39
  130. package/node_modules/@types/cacheable-request/node_modules/undici-types/filereader.d.ts +0 -54
  131. package/node_modules/@types/cacheable-request/node_modules/undici-types/formdata.d.ts +0 -108
  132. package/node_modules/@types/cacheable-request/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  133. package/node_modules/@types/cacheable-request/node_modules/undici-types/global-origin.d.ts +0 -7
  134. package/node_modules/@types/cacheable-request/node_modules/undici-types/handlers.d.ts +0 -15
  135. package/node_modules/@types/cacheable-request/node_modules/undici-types/header.d.ts +0 -4
  136. package/node_modules/@types/cacheable-request/node_modules/undici-types/index.d.ts +0 -71
  137. package/node_modules/@types/cacheable-request/node_modules/undici-types/interceptors.d.ts +0 -17
  138. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-agent.d.ts +0 -50
  139. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-client.d.ts +0 -25
  140. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-errors.d.ts +0 -12
  141. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  142. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-pool.d.ts +0 -25
  143. package/node_modules/@types/cacheable-request/node_modules/undici-types/package.json +0 -55
  144. package/node_modules/@types/cacheable-request/node_modules/undici-types/patch.d.ts +0 -33
  145. package/node_modules/@types/cacheable-request/node_modules/undici-types/pool-stats.d.ts +0 -19
  146. package/node_modules/@types/cacheable-request/node_modules/undici-types/pool.d.ts +0 -39
  147. package/node_modules/@types/cacheable-request/node_modules/undici-types/proxy-agent.d.ts +0 -28
  148. package/node_modules/@types/cacheable-request/node_modules/undici-types/readable.d.ts +0 -60
  149. package/node_modules/@types/cacheable-request/node_modules/undici-types/retry-agent.d.ts +0 -8
  150. package/node_modules/@types/cacheable-request/node_modules/undici-types/retry-handler.d.ts +0 -116
  151. package/node_modules/@types/cacheable-request/node_modules/undici-types/util.d.ts +0 -18
  152. package/node_modules/@types/cacheable-request/node_modules/undici-types/webidl.d.ts +0 -222
  153. package/node_modules/@types/cacheable-request/node_modules/undici-types/websocket.d.ts +0 -150
  154. package/node_modules/@types/cacheable-request/package.json +0 -35
  155. package/node_modules/@types/http-cache-semantics/LICENSE +0 -21
  156. package/node_modules/@types/http-cache-semantics/README.md +0 -15
  157. package/node_modules/@types/http-cache-semantics/index.d.ts +0 -165
  158. package/node_modules/@types/http-cache-semantics/package.json +0 -25
  159. package/node_modules/@types/keyv/LICENSE +0 -21
  160. package/node_modules/@types/keyv/README.md +0 -16
  161. package/node_modules/@types/keyv/index.d.ts +0 -90
  162. package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +0 -21
  163. package/node_modules/@types/keyv/node_modules/@types/node/README.md +0 -15
  164. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +0 -8
  165. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +0 -1095
  166. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +0 -541
  167. package/node_modules/@types/keyv/node_modules/@types/node/buffer.buffer.d.ts +0 -460
  168. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +0 -1926
  169. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +0 -1549
  170. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +0 -579
  171. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  172. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/index.d.ts +0 -9
  173. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  174. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  175. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +0 -452
  176. package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +0 -21
  177. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +0 -4510
  178. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +0 -599
  179. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  180. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +0 -476
  181. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +0 -865
  182. package/node_modules/@types/keyv/node_modules/@types/node/dom-events.d.ts +0 -124
  183. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +0 -170
  184. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +0 -931
  185. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +0 -1275
  186. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +0 -4343
  187. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +0 -511
  188. package/node_modules/@types/keyv/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  189. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +0 -1959
  190. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +0 -2558
  191. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +0 -543
  192. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +0 -92
  193. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +0 -3966
  194. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +0 -702
  195. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +0 -1029
  196. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +0 -495
  197. package/node_modules/@types/keyv/node_modules/@types/node/package.json +0 -220
  198. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +0 -200
  199. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +0 -970
  200. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +0 -2013
  201. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +0 -117
  202. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +0 -153
  203. package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +0 -162
  204. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +0 -589
  205. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +0 -430
  206. package/node_modules/@types/keyv/node_modules/@types/node/sea.d.ts +0 -153
  207. package/node_modules/@types/keyv/node_modules/@types/node/sqlite.d.ts +0 -439
  208. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +0 -12
  209. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +0 -90
  210. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +0 -614
  211. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +0 -1662
  212. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +0 -67
  213. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +0 -2150
  214. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +0 -97
  215. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +0 -240
  216. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +0 -1226
  217. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +0 -197
  218. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
  219. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  220. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  221. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +0 -208
  222. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +0 -972
  223. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +0 -2439
  224. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +0 -808
  225. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +0 -976
  226. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +0 -181
  227. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +0 -745
  228. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +0 -539
  229. package/node_modules/@types/keyv/node_modules/undici-types/LICENSE +0 -21
  230. package/node_modules/@types/keyv/node_modules/undici-types/README.md +0 -6
  231. package/node_modules/@types/keyv/node_modules/undici-types/agent.d.ts +0 -31
  232. package/node_modules/@types/keyv/node_modules/undici-types/api.d.ts +0 -43
  233. package/node_modules/@types/keyv/node_modules/undici-types/balanced-pool.d.ts +0 -29
  234. package/node_modules/@types/keyv/node_modules/undici-types/cache.d.ts +0 -36
  235. package/node_modules/@types/keyv/node_modules/undici-types/client.d.ts +0 -108
  236. package/node_modules/@types/keyv/node_modules/undici-types/connector.d.ts +0 -34
  237. package/node_modules/@types/keyv/node_modules/undici-types/content-type.d.ts +0 -21
  238. package/node_modules/@types/keyv/node_modules/undici-types/cookies.d.ts +0 -28
  239. package/node_modules/@types/keyv/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  240. package/node_modules/@types/keyv/node_modules/undici-types/dispatcher.d.ts +0 -255
  241. package/node_modules/@types/keyv/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  242. package/node_modules/@types/keyv/node_modules/undici-types/errors.d.ts +0 -149
  243. package/node_modules/@types/keyv/node_modules/undici-types/eventsource.d.ts +0 -61
  244. package/node_modules/@types/keyv/node_modules/undici-types/fetch.d.ts +0 -209
  245. package/node_modules/@types/keyv/node_modules/undici-types/file.d.ts +0 -39
  246. package/node_modules/@types/keyv/node_modules/undici-types/filereader.d.ts +0 -54
  247. package/node_modules/@types/keyv/node_modules/undici-types/formdata.d.ts +0 -108
  248. package/node_modules/@types/keyv/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  249. package/node_modules/@types/keyv/node_modules/undici-types/global-origin.d.ts +0 -7
  250. package/node_modules/@types/keyv/node_modules/undici-types/handlers.d.ts +0 -15
  251. package/node_modules/@types/keyv/node_modules/undici-types/header.d.ts +0 -4
  252. package/node_modules/@types/keyv/node_modules/undici-types/index.d.ts +0 -71
  253. package/node_modules/@types/keyv/node_modules/undici-types/interceptors.d.ts +0 -17
  254. package/node_modules/@types/keyv/node_modules/undici-types/mock-agent.d.ts +0 -50
  255. package/node_modules/@types/keyv/node_modules/undici-types/mock-client.d.ts +0 -25
  256. package/node_modules/@types/keyv/node_modules/undici-types/mock-errors.d.ts +0 -12
  257. package/node_modules/@types/keyv/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  258. package/node_modules/@types/keyv/node_modules/undici-types/mock-pool.d.ts +0 -25
  259. package/node_modules/@types/keyv/node_modules/undici-types/package.json +0 -55
  260. package/node_modules/@types/keyv/node_modules/undici-types/patch.d.ts +0 -33
  261. package/node_modules/@types/keyv/node_modules/undici-types/pool-stats.d.ts +0 -19
  262. package/node_modules/@types/keyv/node_modules/undici-types/pool.d.ts +0 -39
  263. package/node_modules/@types/keyv/node_modules/undici-types/proxy-agent.d.ts +0 -28
  264. package/node_modules/@types/keyv/node_modules/undici-types/readable.d.ts +0 -60
  265. package/node_modules/@types/keyv/node_modules/undici-types/retry-agent.d.ts +0 -8
  266. package/node_modules/@types/keyv/node_modules/undici-types/retry-handler.d.ts +0 -116
  267. package/node_modules/@types/keyv/node_modules/undici-types/util.d.ts +0 -18
  268. package/node_modules/@types/keyv/node_modules/undici-types/webidl.d.ts +0 -222
  269. package/node_modules/@types/keyv/node_modules/undici-types/websocket.d.ts +0 -150
  270. package/node_modules/@types/keyv/package.json +0 -32
  271. package/node_modules/@types/responselike/LICENSE +0 -21
  272. package/node_modules/@types/responselike/README.md +0 -48
  273. package/node_modules/@types/responselike/index.d.ts +0 -29
  274. package/node_modules/@types/responselike/node_modules/@types/node/LICENSE +0 -21
  275. package/node_modules/@types/responselike/node_modules/@types/node/README.md +0 -15
  276. package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +0 -8
  277. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +0 -1095
  278. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +0 -541
  279. package/node_modules/@types/responselike/node_modules/@types/node/buffer.buffer.d.ts +0 -460
  280. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +0 -1926
  281. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +0 -1549
  282. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +0 -579
  283. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  284. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/index.d.ts +0 -9
  285. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  286. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  287. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +0 -452
  288. package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +0 -21
  289. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +0 -4510
  290. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +0 -599
  291. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  292. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +0 -476
  293. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +0 -865
  294. package/node_modules/@types/responselike/node_modules/@types/node/dom-events.d.ts +0 -124
  295. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +0 -170
  296. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +0 -931
  297. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +0 -1275
  298. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +0 -4343
  299. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +0 -511
  300. package/node_modules/@types/responselike/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  301. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +0 -1959
  302. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +0 -2558
  303. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +0 -543
  304. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +0 -92
  305. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +0 -3966
  306. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +0 -702
  307. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +0 -1029
  308. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +0 -495
  309. package/node_modules/@types/responselike/node_modules/@types/node/package.json +0 -220
  310. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +0 -200
  311. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +0 -970
  312. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +0 -2013
  313. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +0 -117
  314. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +0 -153
  315. package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +0 -162
  316. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +0 -589
  317. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +0 -430
  318. package/node_modules/@types/responselike/node_modules/@types/node/sea.d.ts +0 -153
  319. package/node_modules/@types/responselike/node_modules/@types/node/sqlite.d.ts +0 -439
  320. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +0 -12
  321. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +0 -90
  322. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +0 -614
  323. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +0 -1662
  324. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +0 -67
  325. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +0 -2150
  326. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +0 -97
  327. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +0 -240
  328. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +0 -1226
  329. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +0 -197
  330. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
  331. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  332. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  333. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +0 -208
  334. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +0 -972
  335. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +0 -2439
  336. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +0 -808
  337. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +0 -976
  338. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +0 -181
  339. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +0 -745
  340. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +0 -539
  341. package/node_modules/@types/responselike/node_modules/undici-types/LICENSE +0 -21
  342. package/node_modules/@types/responselike/node_modules/undici-types/README.md +0 -6
  343. package/node_modules/@types/responselike/node_modules/undici-types/agent.d.ts +0 -31
  344. package/node_modules/@types/responselike/node_modules/undici-types/api.d.ts +0 -43
  345. package/node_modules/@types/responselike/node_modules/undici-types/balanced-pool.d.ts +0 -29
  346. package/node_modules/@types/responselike/node_modules/undici-types/cache.d.ts +0 -36
  347. package/node_modules/@types/responselike/node_modules/undici-types/client.d.ts +0 -108
  348. package/node_modules/@types/responselike/node_modules/undici-types/connector.d.ts +0 -34
  349. package/node_modules/@types/responselike/node_modules/undici-types/content-type.d.ts +0 -21
  350. package/node_modules/@types/responselike/node_modules/undici-types/cookies.d.ts +0 -28
  351. package/node_modules/@types/responselike/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  352. package/node_modules/@types/responselike/node_modules/undici-types/dispatcher.d.ts +0 -255
  353. package/node_modules/@types/responselike/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  354. package/node_modules/@types/responselike/node_modules/undici-types/errors.d.ts +0 -149
  355. package/node_modules/@types/responselike/node_modules/undici-types/eventsource.d.ts +0 -61
  356. package/node_modules/@types/responselike/node_modules/undici-types/fetch.d.ts +0 -209
  357. package/node_modules/@types/responselike/node_modules/undici-types/file.d.ts +0 -39
  358. package/node_modules/@types/responselike/node_modules/undici-types/filereader.d.ts +0 -54
  359. package/node_modules/@types/responselike/node_modules/undici-types/formdata.d.ts +0 -108
  360. package/node_modules/@types/responselike/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  361. package/node_modules/@types/responselike/node_modules/undici-types/global-origin.d.ts +0 -7
  362. package/node_modules/@types/responselike/node_modules/undici-types/handlers.d.ts +0 -15
  363. package/node_modules/@types/responselike/node_modules/undici-types/header.d.ts +0 -4
  364. package/node_modules/@types/responselike/node_modules/undici-types/index.d.ts +0 -71
  365. package/node_modules/@types/responselike/node_modules/undici-types/interceptors.d.ts +0 -17
  366. package/node_modules/@types/responselike/node_modules/undici-types/mock-agent.d.ts +0 -50
  367. package/node_modules/@types/responselike/node_modules/undici-types/mock-client.d.ts +0 -25
  368. package/node_modules/@types/responselike/node_modules/undici-types/mock-errors.d.ts +0 -12
  369. package/node_modules/@types/responselike/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  370. package/node_modules/@types/responselike/node_modules/undici-types/mock-pool.d.ts +0 -25
  371. package/node_modules/@types/responselike/node_modules/undici-types/package.json +0 -55
  372. package/node_modules/@types/responselike/node_modules/undici-types/patch.d.ts +0 -33
  373. package/node_modules/@types/responselike/node_modules/undici-types/pool-stats.d.ts +0 -19
  374. package/node_modules/@types/responselike/node_modules/undici-types/pool.d.ts +0 -39
  375. package/node_modules/@types/responselike/node_modules/undici-types/proxy-agent.d.ts +0 -28
  376. package/node_modules/@types/responselike/node_modules/undici-types/readable.d.ts +0 -60
  377. package/node_modules/@types/responselike/node_modules/undici-types/retry-agent.d.ts +0 -8
  378. package/node_modules/@types/responselike/node_modules/undici-types/retry-handler.d.ts +0 -116
  379. package/node_modules/@types/responselike/node_modules/undici-types/util.d.ts +0 -18
  380. package/node_modules/@types/responselike/node_modules/undici-types/webidl.d.ts +0 -222
  381. package/node_modules/@types/responselike/node_modules/undici-types/websocket.d.ts +0 -150
  382. package/node_modules/@types/responselike/package.json +0 -27
  383. package/node_modules/cacheable-lookup/LICENSE +0 -21
  384. package/node_modules/cacheable-lookup/README.md +0 -240
  385. package/node_modules/cacheable-lookup/index.d.ts +0 -139
  386. package/node_modules/cacheable-lookup/package.json +0 -45
  387. package/node_modules/cacheable-lookup/source/index.js +0 -436
  388. package/node_modules/cacheable-request/LICENSE +0 -21
  389. package/node_modules/cacheable-request/README.md +0 -206
  390. package/node_modules/cacheable-request/package.json +0 -56
  391. package/node_modules/cacheable-request/src/index.js +0 -251
  392. package/node_modules/clone-response/LICENSE +0 -21
  393. package/node_modules/clone-response/README.md +0 -62
  394. package/node_modules/clone-response/node_modules/mimic-response/index.js +0 -32
  395. package/node_modules/clone-response/node_modules/mimic-response/license +0 -9
  396. package/node_modules/clone-response/node_modules/mimic-response/package.json +0 -37
  397. package/node_modules/clone-response/node_modules/mimic-response/readme.md +0 -54
  398. package/node_modules/clone-response/package.json +0 -41
  399. package/node_modules/clone-response/src/index.js +0 -17
  400. package/node_modules/decompress-response/index.d.ts +0 -22
  401. package/node_modules/decompress-response/index.js +0 -58
  402. package/node_modules/decompress-response/license +0 -9
  403. package/node_modules/decompress-response/package.json +0 -56
  404. package/node_modules/decompress-response/readme.md +0 -48
  405. package/node_modules/defer-to-connect/LICENSE +0 -21
  406. package/node_modules/defer-to-connect/README.md +0 -38
  407. package/node_modules/defer-to-connect/dist/source/index.d.ts +0 -10
  408. package/node_modules/defer-to-connect/dist/source/index.js +0 -47
  409. package/node_modules/defer-to-connect/package.json +0 -71
  410. package/node_modules/end-of-stream/LICENSE +0 -21
  411. package/node_modules/end-of-stream/README.md +0 -54
  412. package/node_modules/end-of-stream/index.js +0 -94
  413. package/node_modules/end-of-stream/package.json +0 -37
  414. package/node_modules/get-stream/buffer-stream.js +0 -52
  415. package/node_modules/get-stream/index.d.ts +0 -108
  416. package/node_modules/get-stream/index.js +0 -60
  417. package/node_modules/get-stream/license +0 -9
  418. package/node_modules/get-stream/package.json +0 -50
  419. package/node_modules/get-stream/readme.md +0 -124
  420. package/node_modules/got/dist/source/as-promise/create-rejection.d.ts +0 -2
  421. package/node_modules/got/dist/source/as-promise/create-rejection.js +0 -30
  422. package/node_modules/got/dist/source/as-promise/index.d.ts +0 -3
  423. package/node_modules/got/dist/source/as-promise/index.js +0 -176
  424. package/node_modules/got/dist/source/as-promise/normalize-arguments.d.ts +0 -3
  425. package/node_modules/got/dist/source/as-promise/normalize-arguments.js +0 -78
  426. package/node_modules/got/dist/source/as-promise/parse-body.d.ts +0 -3
  427. package/node_modules/got/dist/source/as-promise/parse-body.js +0 -25
  428. package/node_modules/got/dist/source/as-promise/types.d.ts +0 -256
  429. package/node_modules/got/dist/source/as-promise/types.js +0 -42
  430. package/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +0 -5
  431. package/node_modules/got/dist/source/core/calculate-retry-delay.js +0 -29
  432. package/node_modules/got/dist/source/core/index.d.ts +0 -1124
  433. package/node_modules/got/dist/source/core/index.js +0 -1505
  434. package/node_modules/got/dist/source/core/utils/dns-ip-version.d.ts +0 -5
  435. package/node_modules/got/dist/source/core/utils/dns-ip-version.js +0 -17
  436. package/node_modules/got/dist/source/core/utils/get-body-size.d.ts +0 -3
  437. package/node_modules/got/dist/source/core/utils/get-body-size.js +0 -32
  438. package/node_modules/got/dist/source/core/utils/get-buffer.d.ts +0 -4
  439. package/node_modules/got/dist/source/core/utils/get-buffer.js +0 -16
  440. package/node_modules/got/dist/source/core/utils/is-form-data.d.ts +0 -8
  441. package/node_modules/got/dist/source/core/utils/is-form-data.js +0 -4
  442. package/node_modules/got/dist/source/core/utils/is-response-ok.d.ts +0 -2
  443. package/node_modules/got/dist/source/core/utils/is-response-ok.js +0 -8
  444. package/node_modules/got/dist/source/core/utils/options-to-url.d.ts +0 -14
  445. package/node_modules/got/dist/source/core/utils/options-to-url.js +0 -53
  446. package/node_modules/got/dist/source/core/utils/proxy-events.d.ts +0 -3
  447. package/node_modules/got/dist/source/core/utils/proxy-events.js +0 -17
  448. package/node_modules/got/dist/source/core/utils/timed-out.d.ts +0 -29
  449. package/node_modules/got/dist/source/core/utils/timed-out.js +0 -121
  450. package/node_modules/got/dist/source/core/utils/unhandle.d.ts +0 -11
  451. package/node_modules/got/dist/source/core/utils/unhandle.js +0 -22
  452. package/node_modules/got/dist/source/core/utils/url-to-options.d.ts +0 -15
  453. package/node_modules/got/dist/source/core/utils/url-to-options.js +0 -24
  454. package/node_modules/got/dist/source/core/utils/weakable-map.d.ts +0 -8
  455. package/node_modules/got/dist/source/core/utils/weakable-map.js +0 -29
  456. package/node_modules/got/dist/source/create.d.ts +0 -5
  457. package/node_modules/got/dist/source/create.js +0 -240
  458. package/node_modules/got/dist/source/index.d.ts +0 -4
  459. package/node_modules/got/dist/source/index.js +0 -132
  460. package/node_modules/got/dist/source/types.d.ts +0 -344
  461. package/node_modules/got/dist/source/types.js +0 -2
  462. package/node_modules/got/dist/source/utils/deep-freeze.d.ts +0 -1
  463. package/node_modules/got/dist/source/utils/deep-freeze.js +0 -12
  464. package/node_modules/got/dist/source/utils/deprecation-warning.d.ts +0 -2
  465. package/node_modules/got/dist/source/utils/deprecation-warning.js +0 -13
  466. package/node_modules/got/license +0 -9
  467. package/node_modules/got/package.json +0 -131
  468. package/node_modules/got/readme.md +0 -2477
  469. package/node_modules/hpagent/.github/dependabot.yml +0 -8
  470. package/node_modules/hpagent/.github/workflows/build.yml +0 -29
  471. package/node_modules/hpagent/LICENSE +0 -21
  472. package/node_modules/hpagent/README.md +0 -138
  473. package/node_modules/hpagent/index.d.ts +0 -26
  474. package/node_modules/hpagent/index.js +0 -101
  475. package/node_modules/hpagent/index.mjs +0 -5
  476. package/node_modules/hpagent/package.json +0 -49
  477. package/node_modules/hpagent/test/got.test.js +0 -111
  478. package/node_modules/hpagent/test/http-http.test.js +0 -351
  479. package/node_modules/hpagent/test/http-https.test.js +0 -313
  480. package/node_modules/hpagent/test/https-http.test.js +0 -313
  481. package/node_modules/hpagent/test/https-https.test.js +0 -313
  482. package/node_modules/hpagent/test/index.test-d.ts +0 -45
  483. package/node_modules/hpagent/test/needle.test.js +0 -103
  484. package/node_modules/hpagent/test/node-fetch.test.js +0 -103
  485. package/node_modules/hpagent/test/simple-get.test.js +0 -139
  486. package/node_modules/hpagent/test/ssl.cert +0 -19
  487. package/node_modules/hpagent/test/ssl.key +0 -27
  488. package/node_modules/hpagent/test/utils.js +0 -59
  489. package/node_modules/http-cache-semantics/LICENSE +0 -9
  490. package/node_modules/http-cache-semantics/README.md +0 -203
  491. package/node_modules/http-cache-semantics/index.js +0 -674
  492. package/node_modules/http-cache-semantics/package.json +0 -18
  493. package/node_modules/http2-wrapper/LICENSE +0 -21
  494. package/node_modules/http2-wrapper/README.md +0 -470
  495. package/node_modules/http2-wrapper/package.json +0 -54
  496. package/node_modules/http2-wrapper/source/agent.js +0 -670
  497. package/node_modules/http2-wrapper/source/auto.js +0 -149
  498. package/node_modules/http2-wrapper/source/client-request.js +0 -445
  499. package/node_modules/http2-wrapper/source/incoming-message.js +0 -58
  500. package/node_modules/http2-wrapper/source/index.js +0 -28
  501. package/node_modules/http2-wrapper/source/utils/calculate-server-name.js +0 -27
  502. package/node_modules/http2-wrapper/source/utils/errors.js +0 -45
  503. package/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +0 -13
  504. package/node_modules/http2-wrapper/source/utils/proxy-events.js +0 -7
  505. package/node_modules/http2-wrapper/source/utils/url-to-options.js +0 -25
  506. package/node_modules/json-buffer/.travis.yml +0 -3
  507. package/node_modules/json-buffer/LICENSE +0 -22
  508. package/node_modules/json-buffer/README.md +0 -24
  509. package/node_modules/json-buffer/index.js +0 -58
  510. package/node_modules/json-buffer/package.json +0 -34
  511. package/node_modules/json-buffer/test/index.js +0 -63
  512. package/node_modules/keyv/README.md +0 -429
  513. package/node_modules/keyv/package.json +0 -57
  514. package/node_modules/keyv/src/index.d.ts +0 -112
  515. package/node_modules/keyv/src/index.js +0 -259
  516. package/node_modules/lowercase-keys/index.d.ts +0 -16
  517. package/node_modules/lowercase-keys/index.js +0 -10
  518. package/node_modules/lowercase-keys/license +0 -9
  519. package/node_modules/lowercase-keys/package.json +0 -38
  520. package/node_modules/lowercase-keys/readme.md +0 -32
  521. package/node_modules/mimic-response/index.d.ts +0 -17
  522. package/node_modules/mimic-response/index.js +0 -77
  523. package/node_modules/mimic-response/license +0 -9
  524. package/node_modules/mimic-response/package.json +0 -42
  525. package/node_modules/mimic-response/readme.md +0 -78
  526. package/node_modules/normalize-url/index.d.ts +0 -267
  527. package/node_modules/normalize-url/index.js +0 -216
  528. package/node_modules/normalize-url/license +0 -9
  529. package/node_modules/normalize-url/package.json +0 -50
  530. package/node_modules/normalize-url/readme.md +0 -286
  531. package/node_modules/once/LICENSE +0 -15
  532. package/node_modules/once/README.md +0 -79
  533. package/node_modules/once/once.js +0 -42
  534. package/node_modules/once/package.json +0 -33
  535. package/node_modules/p-cancelable/index.d.ts +0 -176
  536. package/node_modules/p-cancelable/index.js +0 -111
  537. package/node_modules/p-cancelable/license +0 -9
  538. package/node_modules/p-cancelable/package.json +0 -49
  539. package/node_modules/p-cancelable/readme.md +0 -153
  540. package/node_modules/pump/.github/FUNDING.yml +0 -2
  541. package/node_modules/pump/.travis.yml +0 -5
  542. package/node_modules/pump/LICENSE +0 -21
  543. package/node_modules/pump/README.md +0 -74
  544. package/node_modules/pump/SECURITY.md +0 -5
  545. package/node_modules/pump/index.js +0 -86
  546. package/node_modules/pump/package.json +0 -24
  547. package/node_modules/pump/test-browser.js +0 -66
  548. package/node_modules/pump/test-node.js +0 -53
  549. package/node_modules/quick-lru/index.d.ts +0 -97
  550. package/node_modules/quick-lru/index.js +0 -123
  551. package/node_modules/quick-lru/license +0 -9
  552. package/node_modules/quick-lru/package.json +0 -43
  553. package/node_modules/quick-lru/readme.md +0 -111
  554. package/node_modules/resolve-alpn/LICENSE +0 -22
  555. package/node_modules/resolve-alpn/README.md +0 -60
  556. package/node_modules/resolve-alpn/index.js +0 -43
  557. package/node_modules/resolve-alpn/package.json +0 -34
  558. package/node_modules/responselike/LICENSE +0 -19
  559. package/node_modules/responselike/README.md +0 -77
  560. package/node_modules/responselike/package.json +0 -39
  561. package/node_modules/responselike/src/index.js +0 -34
  562. package/node_modules/wrappy/LICENSE +0 -15
  563. package/node_modules/wrappy/README.md +0 -36
  564. package/node_modules/wrappy/package.json +0 -29
  565. package/node_modules/wrappy/wrappy.js +0 -33
@@ -1,2439 +0,0 @@
1
- /**
2
- * The `node:util` module supports the needs of Node.js internal APIs. Many of the
3
- * utilities are useful for application and module developers as well. To access
4
- * it:
5
- *
6
- * ```js
7
- * import util from 'node:util';
8
- * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/util.js)
10
- */
11
- declare module "util" {
12
- import * as types from "node:util/types";
13
- export interface InspectOptions {
14
- /**
15
- * If `true`, object's non-enumerable symbols and properties are included in the formatted result.
16
- * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties).
17
- * @default false
18
- */
19
- showHidden?: boolean | undefined;
20
- /**
21
- * Specifies the number of times to recurse while formatting object.
22
- * This is useful for inspecting large objects.
23
- * To recurse up to the maximum call stack size pass `Infinity` or `null`.
24
- * @default 2
25
- */
26
- depth?: number | null | undefined;
27
- /**
28
- * If `true`, the output is styled with ANSI color codes. Colors are customizable.
29
- */
30
- colors?: boolean | undefined;
31
- /**
32
- * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked.
33
- * @default true
34
- */
35
- customInspect?: boolean | undefined;
36
- /**
37
- * If `true`, `Proxy` inspection includes the target and handler objects.
38
- * @default false
39
- */
40
- showProxy?: boolean | undefined;
41
- /**
42
- * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements
43
- * to include when formatting. Set to `null` or `Infinity` to show all elements.
44
- * Set to `0` or negative to show no elements.
45
- * @default 100
46
- */
47
- maxArrayLength?: number | null | undefined;
48
- /**
49
- * Specifies the maximum number of characters to
50
- * include when formatting. Set to `null` or `Infinity` to show all elements.
51
- * Set to `0` or negative to show no characters.
52
- * @default 10000
53
- */
54
- maxStringLength?: number | null | undefined;
55
- /**
56
- * The length at which input values are split across multiple lines.
57
- * Set to `Infinity` to format the input as a single line
58
- * (in combination with `compact` set to `true` or any number >= `1`).
59
- * @default 80
60
- */
61
- breakLength?: number | undefined;
62
- /**
63
- * Setting this to `false` causes each object key
64
- * to be displayed on a new line. It will also add new lines to text that is
65
- * longer than `breakLength`. If set to a number, the most `n` inner elements
66
- * are united on a single line as long as all properties fit into
67
- * `breakLength`. Short array elements are also grouped together. Note that no
68
- * text will be reduced below 16 characters, no matter the `breakLength` size.
69
- * For more information, see the example below.
70
- * @default true
71
- */
72
- compact?: boolean | number | undefined;
73
- /**
74
- * If set to `true` or a function, all properties of an object, and `Set` and `Map`
75
- * entries are sorted in the resulting string.
76
- * If set to `true` the default sort is used.
77
- * If set to a function, it is used as a compare function.
78
- */
79
- sorted?: boolean | ((a: string, b: string) => number) | undefined;
80
- /**
81
- * If set to `true`, getters are going to be
82
- * inspected as well. If set to `'get'` only getters without setter are going
83
- * to be inspected. If set to `'set'` only getters having a corresponding
84
- * setter are going to be inspected. This might cause side effects depending on
85
- * the getter function.
86
- * @default false
87
- */
88
- getters?: "get" | "set" | boolean | undefined;
89
- /**
90
- * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers.
91
- * @default false
92
- */
93
- numericSeparator?: boolean | undefined;
94
- }
95
- export type Style =
96
- | "special"
97
- | "number"
98
- | "bigint"
99
- | "boolean"
100
- | "undefined"
101
- | "null"
102
- | "string"
103
- | "symbol"
104
- | "date"
105
- | "regexp"
106
- | "module";
107
- export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect
108
- export interface InspectOptionsStylized extends InspectOptions {
109
- stylize(text: string, styleType: Style): string;
110
- }
111
- export interface CallSiteObject {
112
- /**
113
- * Returns the name of the function associated with this call site.
114
- */
115
- functionName: string;
116
- /**
117
- * Returns the name of the resource that contains the script for the
118
- * function for this call site.
119
- */
120
- scriptName: string;
121
- /**
122
- * Returns the number, 1-based, of the line for the associate function call.
123
- */
124
- lineNumber: number;
125
- /**
126
- * Returns the 1-based column offset on the line for the associated function call.
127
- */
128
- column: number;
129
- }
130
- /**
131
- * The `util.format()` method returns a formatted string using the first argument
132
- * as a `printf`-like format string which can contain zero or more format
133
- * specifiers. Each specifier is replaced with the converted value from the
134
- * corresponding argument. Supported specifiers are:
135
- *
136
- * If a specifier does not have a corresponding argument, it is not replaced:
137
- *
138
- * ```js
139
- * util.format('%s:%s', 'foo');
140
- * // Returns: 'foo:%s'
141
- * ```
142
- *
143
- * Values that are not part of the format string are formatted using `util.inspect()` if their type is not `string`.
144
- *
145
- * If there are more arguments passed to the `util.format()` method than the
146
- * number of specifiers, the extra arguments are concatenated to the returned
147
- * string, separated by spaces:
148
- *
149
- * ```js
150
- * util.format('%s:%s', 'foo', 'bar', 'baz');
151
- * // Returns: 'foo:bar baz'
152
- * ```
153
- *
154
- * If the first argument does not contain a valid format specifier, `util.format()` returns a string that is the concatenation of all arguments separated by spaces:
155
- *
156
- * ```js
157
- * util.format(1, 2, 3);
158
- * // Returns: '1 2 3'
159
- * ```
160
- *
161
- * If only one argument is passed to `util.format()`, it is returned as it is
162
- * without any formatting:
163
- *
164
- * ```js
165
- * util.format('%% %s');
166
- * // Returns: '%% %s'
167
- * ```
168
- *
169
- * `util.format()` is a synchronous method that is intended as a debugging tool.
170
- * Some input values can have a significant performance overhead that can block the
171
- * event loop. Use this function with care and never in a hot code path.
172
- * @since v0.5.3
173
- * @param format A `printf`-like format string.
174
- */
175
- export function format(format?: any, ...param: any[]): string;
176
- /**
177
- * This function is identical to {@link format}, except in that it takes
178
- * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}.
179
- *
180
- * ```js
181
- * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 });
182
- * // Returns 'See object { foo: 42 }', where `42` is colored as a number
183
- * // when printed to a terminal.
184
- * ```
185
- * @since v10.0.0
186
- */
187
- export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
188
- interface GetCallSitesOptions {
189
- /**
190
- * Reconstruct the original location in the stacktrace from the source-map.
191
- * Enabled by default with the flag `--enable-source-maps`.
192
- */
193
- sourceMap?: boolean | undefined;
194
- }
195
- /**
196
- * Returns an array of call site objects containing the stack of
197
- * the caller function.
198
- *
199
- * ```js
200
- * const util = require('node:util');
201
- *
202
- * function exampleFunction() {
203
- * const callSites = util.getCallSites();
204
- *
205
- * console.log('Call Sites:');
206
- * callSites.forEach((callSite, index) => {
207
- * console.log(`CallSite ${index + 1}:`);
208
- * console.log(`Function Name: ${callSite.functionName}`);
209
- * console.log(`Script Name: ${callSite.scriptName}`);
210
- * console.log(`Line Number: ${callSite.lineNumber}`);
211
- * console.log(`Column Number: ${callSite.column}`);
212
- * });
213
- * // CallSite 1:
214
- * // Function Name: exampleFunction
215
- * // Script Name: /home/example.js
216
- * // Line Number: 5
217
- * // Column Number: 26
218
- *
219
- * // CallSite 2:
220
- * // Function Name: anotherFunction
221
- * // Script Name: /home/example.js
222
- * // Line Number: 22
223
- * // Column Number: 3
224
- *
225
- * // ...
226
- * }
227
- *
228
- * // A function to simulate another stack layer
229
- * function anotherFunction() {
230
- * exampleFunction();
231
- * }
232
- *
233
- * anotherFunction();
234
- * ```
235
- *
236
- * It is possible to reconstruct the original locations by setting the option `sourceMap` to `true`.
237
- * If the source map is not available, the original location will be the same as the current location.
238
- * When the `--enable-source-maps` flag is enabled, for example when using `--experimental-transform-types`,
239
- * `sourceMap` will be true by default.
240
- *
241
- * ```ts
242
- * import util from 'node:util';
243
- *
244
- * interface Foo {
245
- * foo: string;
246
- * }
247
- *
248
- * const callSites = util.getCallSites({ sourceMap: true });
249
- *
250
- * // With sourceMap:
251
- * // Function Name: ''
252
- * // Script Name: example.js
253
- * // Line Number: 7
254
- * // Column Number: 26
255
- *
256
- * // Without sourceMap:
257
- * // Function Name: ''
258
- * // Script Name: example.js
259
- * // Line Number: 2
260
- * // Column Number: 26
261
- * ```
262
- * @param frameCount Number of frames to capture as call site objects.
263
- * **Default:** `10`. Allowable range is between 1 and 200.
264
- * @return An array of call site objects
265
- * @since v22.9.0
266
- */
267
- export function getCallSites(frameCount?: number, options?: GetCallSitesOptions): CallSiteObject[];
268
- export function getCallSites(options: GetCallSitesOptions): CallSiteObject[];
269
- /**
270
- * Returns the string name for a numeric error code that comes from a Node.js API.
271
- * The mapping between error codes and error names is platform-dependent.
272
- * See `Common System Errors` for the names of common errors.
273
- *
274
- * ```js
275
- * fs.access('file/that/does/not/exist', (err) => {
276
- * const name = util.getSystemErrorName(err.errno);
277
- * console.error(name); // ENOENT
278
- * });
279
- * ```
280
- * @since v9.7.0
281
- */
282
- export function getSystemErrorName(err: number): string;
283
- /**
284
- * Returns a Map of all system error codes available from the Node.js API.
285
- * The mapping between error codes and error names is platform-dependent.
286
- * See `Common System Errors` for the names of common errors.
287
- *
288
- * ```js
289
- * fs.access('file/that/does/not/exist', (err) => {
290
- * const errorMap = util.getSystemErrorMap();
291
- * const name = errorMap.get(err.errno);
292
- * console.error(name); // ENOENT
293
- * });
294
- * ```
295
- * @since v16.0.0, v14.17.0
296
- */
297
- export function getSystemErrorMap(): Map<number, [string, string]>;
298
- /**
299
- * Returns the string message for a numeric error code that comes from a Node.js
300
- * API.
301
- * The mapping between error codes and string messages is platform-dependent.
302
- *
303
- * ```js
304
- * fs.access('file/that/does/not/exist', (err) => {
305
- * const name = util.getSystemErrorMessage(err.errno);
306
- * console.error(name); // no such file or directory
307
- * });
308
- * ```
309
- * @since v22.12.0
310
- */
311
- export function getSystemErrorMessage(err: number): string;
312
- /**
313
- * The `util.log()` method prints the given `string` to `stdout` with an included
314
- * timestamp.
315
- *
316
- * ```js
317
- * import util from 'node:util';
318
- *
319
- * util.log('Timestamped message.');
320
- * ```
321
- * @since v0.3.0
322
- * @deprecated Since v6.0.0 - Use a third party module instead.
323
- */
324
- export function log(string: string): void;
325
- /**
326
- * Returns the `string` after replacing any surrogate code points
327
- * (or equivalently, any unpaired surrogate code units) with the
328
- * Unicode "replacement character" U+FFFD.
329
- * @since v16.8.0, v14.18.0
330
- */
331
- export function toUSVString(string: string): string;
332
- /**
333
- * Creates and returns an `AbortController` instance whose `AbortSignal` is marked
334
- * as transferable and can be used with `structuredClone()` or `postMessage()`.
335
- * @since v18.11.0
336
- * @experimental
337
- * @returns A transferable AbortController
338
- */
339
- export function transferableAbortController(): AbortController;
340
- /**
341
- * Marks the given `AbortSignal` as transferable so that it can be used with`structuredClone()` and `postMessage()`.
342
- *
343
- * ```js
344
- * const signal = transferableAbortSignal(AbortSignal.timeout(100));
345
- * const channel = new MessageChannel();
346
- * channel.port2.postMessage(signal, [signal]);
347
- * ```
348
- * @since v18.11.0
349
- * @experimental
350
- * @param signal The AbortSignal
351
- * @returns The same AbortSignal
352
- */
353
- export function transferableAbortSignal(signal: AbortSignal): AbortSignal;
354
- /**
355
- * Listens to abort event on the provided `signal` and returns a promise that resolves when the `signal` is aborted.
356
- * If `resource` is provided, it weakly references the operation's associated object,
357
- * so if `resource` is garbage collected before the `signal` aborts,
358
- * then returned promise shall remain pending.
359
- * This prevents memory leaks in long-running or non-cancelable operations.
360
- *
361
- * ```js
362
- * import { aborted } from 'node:util';
363
- *
364
- * // Obtain an object with an abortable signal, like a custom resource or operation.
365
- * const dependent = obtainSomethingAbortable();
366
- *
367
- * // Pass `dependent` as the resource, indicating the promise should only resolve
368
- * // if `dependent` is still in memory when the signal is aborted.
369
- * aborted(dependent.signal, dependent).then(() => {
370
- * // This code runs when `dependent` is aborted.
371
- * console.log('Dependent resource was aborted.');
372
- * });
373
- *
374
- * // Simulate an event that triggers the abort.
375
- * dependent.on('event', () => {
376
- * dependent.abort(); // This will cause the `aborted` promise to resolve.
377
- * });
378
- * ```
379
- * @since v19.7.0
380
- * @experimental
381
- * @param resource Any non-null object tied to the abortable operation and held weakly.
382
- * If `resource` is garbage collected before the `signal` aborts, the promise remains pending,
383
- * allowing Node.js to stop tracking it.
384
- * This helps prevent memory leaks in long-running or non-cancelable operations.
385
- */
386
- export function aborted(signal: AbortSignal, resource: any): Promise<void>;
387
- /**
388
- * The `util.inspect()` method returns a string representation of `object` that is
389
- * intended for debugging. The output of `util.inspect` may change at any time
390
- * and should not be depended upon programmatically. Additional `options` may be
391
- * passed that alter the result. `util.inspect()` will use the constructor's name and/or `@@toStringTag` to make
392
- * an identifiable tag for an inspected value.
393
- *
394
- * ```js
395
- * class Foo {
396
- * get [Symbol.toStringTag]() {
397
- * return 'bar';
398
- * }
399
- * }
400
- *
401
- * class Bar {}
402
- *
403
- * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } });
404
- *
405
- * util.inspect(new Foo()); // 'Foo [bar] {}'
406
- * util.inspect(new Bar()); // 'Bar {}'
407
- * util.inspect(baz); // '[foo] {}'
408
- * ```
409
- *
410
- * Circular references point to their anchor by using a reference index:
411
- *
412
- * ```js
413
- * import { inspect } from 'node:util';
414
- *
415
- * const obj = {};
416
- * obj.a = [obj];
417
- * obj.b = {};
418
- * obj.b.inner = obj.b;
419
- * obj.b.obj = obj;
420
- *
421
- * console.log(inspect(obj));
422
- * // <ref *1> {
423
- * // a: [ [Circular *1] ],
424
- * // b: <ref *2> { inner: [Circular *2], obj: [Circular *1] }
425
- * // }
426
- * ```
427
- *
428
- * The following example inspects all properties of the `util` object:
429
- *
430
- * ```js
431
- * import util from 'node:util';
432
- *
433
- * console.log(util.inspect(util, { showHidden: true, depth: null }));
434
- * ```
435
- *
436
- * The following example highlights the effect of the `compact` option:
437
- *
438
- * ```js
439
- * import util from 'node:util';
440
- *
441
- * const o = {
442
- * a: [1, 2, [[
443
- * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' +
444
- * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.',
445
- * 'test',
446
- * 'foo']], 4],
447
- * b: new Map([['za', 1], ['zb', 'test']]),
448
- * };
449
- * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 }));
450
- *
451
- * // { a:
452
- * // [ 1,
453
- * // 2,
454
- * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line
455
- * // 'test',
456
- * // 'foo' ] ],
457
- * // 4 ],
458
- * // b: Map(2) { 'za' => 1, 'zb' => 'test' } }
459
- *
460
- * // Setting `compact` to false or an integer creates more reader friendly output.
461
- * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 }));
462
- *
463
- * // {
464
- * // a: [
465
- * // 1,
466
- * // 2,
467
- * // [
468
- * // [
469
- * // 'Lorem ipsum dolor sit amet,\n' +
470
- * // 'consectetur adipiscing elit, sed do eiusmod \n' +
471
- * // 'tempor incididunt ut labore et dolore magna aliqua.',
472
- * // 'test',
473
- * // 'foo'
474
- * // ]
475
- * // ],
476
- * // 4
477
- * // ],
478
- * // b: Map(2) {
479
- * // 'za' => 1,
480
- * // 'zb' => 'test'
481
- * // }
482
- * // }
483
- *
484
- * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a
485
- * // single line.
486
- * ```
487
- *
488
- * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and
489
- * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be
490
- * inspected. If there are more entries than `maxArrayLength`, there is no
491
- * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may
492
- * result in different output. Furthermore, entries
493
- * with no remaining strong references may be garbage collected at any time.
494
- *
495
- * ```js
496
- * import { inspect } from 'node:util';
497
- *
498
- * const obj = { a: 1 };
499
- * const obj2 = { b: 2 };
500
- * const weakSet = new WeakSet([obj, obj2]);
501
- *
502
- * console.log(inspect(weakSet, { showHidden: true }));
503
- * // WeakSet { { a: 1 }, { b: 2 } }
504
- * ```
505
- *
506
- * The `sorted` option ensures that an object's property insertion order does not
507
- * impact the result of `util.inspect()`.
508
- *
509
- * ```js
510
- * import { inspect } from 'node:util';
511
- * import assert from 'node:assert';
512
- *
513
- * const o1 = {
514
- * b: [2, 3, 1],
515
- * a: '`a` comes before `b`',
516
- * c: new Set([2, 3, 1]),
517
- * };
518
- * console.log(inspect(o1, { sorted: true }));
519
- * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } }
520
- * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));
521
- * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' }
522
- *
523
- * const o2 = {
524
- * c: new Set([2, 1, 3]),
525
- * a: '`a` comes before `b`',
526
- * b: [2, 3, 1],
527
- * };
528
- * assert.strict.equal(
529
- * inspect(o1, { sorted: true }),
530
- * inspect(o2, { sorted: true }),
531
- * );
532
- * ```
533
- *
534
- * The `numericSeparator` option adds an underscore every three digits to all
535
- * numbers.
536
- *
537
- * ```js
538
- * import { inspect } from 'node:util';
539
- *
540
- * const thousand = 1_000;
541
- * const million = 1_000_000;
542
- * const bigNumber = 123_456_789n;
543
- * const bigDecimal = 1_234.123_45;
544
- *
545
- * console.log(inspect(thousand, { numericSeparator: true }));
546
- * // 1_000
547
- * console.log(inspect(million, { numericSeparator: true }));
548
- * // 1_000_000
549
- * console.log(inspect(bigNumber, { numericSeparator: true }));
550
- * // 123_456_789n
551
- * console.log(inspect(bigDecimal, { numericSeparator: true }));
552
- * // 1_234.123_45
553
- * ```
554
- *
555
- * `util.inspect()` is a synchronous method intended for debugging. Its maximum
556
- * output length is approximately 128 MiB. Inputs that result in longer output will
557
- * be truncated.
558
- * @since v0.3.0
559
- * @param object Any JavaScript primitive or `Object`.
560
- * @return The representation of `object`.
561
- */
562
- export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
563
- export function inspect(object: any, options?: InspectOptions): string;
564
- export namespace inspect {
565
- let colors: NodeJS.Dict<[number, number]>;
566
- let styles: {
567
- [K in Style]: string;
568
- };
569
- let defaultOptions: InspectOptions;
570
- /**
571
- * Allows changing inspect settings from the repl.
572
- */
573
- let replDefaults: InspectOptions;
574
- /**
575
- * That can be used to declare custom inspect functions.
576
- */
577
- const custom: unique symbol;
578
- }
579
- /**
580
- * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray).
581
- *
582
- * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`.
583
- *
584
- * ```js
585
- * import util from 'node:util';
586
- *
587
- * util.isArray([]);
588
- * // Returns: true
589
- * util.isArray(new Array());
590
- * // Returns: true
591
- * util.isArray({});
592
- * // Returns: false
593
- * ```
594
- * @since v0.6.0
595
- * @deprecated Since v4.0.0 - Use `isArray` instead.
596
- */
597
- export function isArray(object: unknown): object is unknown[];
598
- /**
599
- * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`.
600
- *
601
- * ```js
602
- * import util from 'node:util';
603
- *
604
- * util.isRegExp(/some regexp/);
605
- * // Returns: true
606
- * util.isRegExp(new RegExp('another regexp'));
607
- * // Returns: true
608
- * util.isRegExp({});
609
- * // Returns: false
610
- * ```
611
- * @since v0.6.0
612
- * @deprecated Since v4.0.0 - Deprecated
613
- */
614
- export function isRegExp(object: unknown): object is RegExp;
615
- /**
616
- * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`.
617
- *
618
- * ```js
619
- * import util from 'node:util';
620
- *
621
- * util.isDate(new Date());
622
- * // Returns: true
623
- * util.isDate(Date());
624
- * // false (without 'new' returns a String)
625
- * util.isDate({});
626
- * // Returns: false
627
- * ```
628
- * @since v0.6.0
629
- * @deprecated Since v4.0.0 - Use {@link types.isDate} instead.
630
- */
631
- export function isDate(object: unknown): object is Date;
632
- /**
633
- * Returns `true` if the given `object` is an `Error`. Otherwise, returns `false`.
634
- *
635
- * ```js
636
- * import util from 'node:util';
637
- *
638
- * util.isError(new Error());
639
- * // Returns: true
640
- * util.isError(new TypeError());
641
- * // Returns: true
642
- * util.isError({ name: 'Error', message: 'an error occurred' });
643
- * // Returns: false
644
- * ```
645
- *
646
- * This method relies on `Object.prototype.toString()` behavior. It is
647
- * possible to obtain an incorrect result when the `object` argument manipulates `@@toStringTag`.
648
- *
649
- * ```js
650
- * import util from 'node:util';
651
- * const obj = { name: 'Error', message: 'an error occurred' };
652
- *
653
- * util.isError(obj);
654
- * // Returns: false
655
- * obj[Symbol.toStringTag] = 'Error';
656
- * util.isError(obj);
657
- * // Returns: true
658
- * ```
659
- * @since v0.6.0
660
- * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead.
661
- */
662
- export function isError(object: unknown): object is Error;
663
- /**
664
- * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and `extends` keywords to get language level inheritance support. Also note
665
- * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179).
666
- *
667
- * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The
668
- * prototype of `constructor` will be set to a new object created from `superConstructor`.
669
- *
670
- * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`.
671
- * As an additional convenience, `superConstructor` will be accessible
672
- * through the `constructor.super_` property.
673
- *
674
- * ```js
675
- * import util from 'node:util';
676
- * import EventEmitter from 'node:events';
677
- *
678
- * function MyStream() {
679
- * EventEmitter.call(this);
680
- * }
681
- *
682
- * util.inherits(MyStream, EventEmitter);
683
- *
684
- * MyStream.prototype.write = function(data) {
685
- * this.emit('data', data);
686
- * };
687
- *
688
- * const stream = new MyStream();
689
- *
690
- * console.log(stream instanceof EventEmitter); // true
691
- * console.log(MyStream.super_ === EventEmitter); // true
692
- *
693
- * stream.on('data', (data) => {
694
- * console.log(`Received data: "${data}"`);
695
- * });
696
- * stream.write('It works!'); // Received data: "It works!"
697
- * ```
698
- *
699
- * ES6 example using `class` and `extends`:
700
- *
701
- * ```js
702
- * import EventEmitter from 'node:events';
703
- *
704
- * class MyStream extends EventEmitter {
705
- * write(data) {
706
- * this.emit('data', data);
707
- * }
708
- * }
709
- *
710
- * const stream = new MyStream();
711
- *
712
- * stream.on('data', (data) => {
713
- * console.log(`Received data: "${data}"`);
714
- * });
715
- * stream.write('With ES6');
716
- * ```
717
- * @since v0.3.0
718
- * @legacy Use ES2015 class syntax and `extends` keyword instead.
719
- */
720
- export function inherits(constructor: unknown, superConstructor: unknown): void;
721
- export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void;
722
- export interface DebugLogger extends DebugLoggerFunction {
723
- enabled: boolean;
724
- }
725
- /**
726
- * The `util.debuglog()` method is used to create a function that conditionally
727
- * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that
728
- * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op.
729
- *
730
- * ```js
731
- * import util from 'node:util';
732
- * const debuglog = util.debuglog('foo');
733
- *
734
- * debuglog('hello from foo [%d]', 123);
735
- * ```
736
- *
737
- * If this program is run with `NODE_DEBUG=foo` in the environment, then
738
- * it will output something like:
739
- *
740
- * ```console
741
- * FOO 3245: hello from foo [123]
742
- * ```
743
- *
744
- * where `3245` is the process id. If it is not run with that
745
- * environment variable set, then it will not print anything.
746
- *
747
- * The `section` supports wildcard also:
748
- *
749
- * ```js
750
- * import util from 'node:util';
751
- * const debuglog = util.debuglog('foo-bar');
752
- *
753
- * debuglog('hi there, it\'s foo-bar [%d]', 2333);
754
- * ```
755
- *
756
- * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output
757
- * something like:
758
- *
759
- * ```console
760
- * FOO-BAR 3257: hi there, it's foo-bar [2333]
761
- * ```
762
- *
763
- * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`.
764
- *
765
- * The optional `callback` argument can be used to replace the logging function
766
- * with a different function that doesn't have any initialization or
767
- * unnecessary wrapping.
768
- *
769
- * ```js
770
- * import util from 'node:util';
771
- * let debuglog = util.debuglog('internals', (debug) => {
772
- * // Replace with a logging function that optimizes out
773
- * // testing if the section is enabled
774
- * debuglog = debug;
775
- * });
776
- * ```
777
- * @since v0.11.3
778
- * @param section A string identifying the portion of the application for which the `debuglog` function is being created.
779
- * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function.
780
- * @return The logging function
781
- */
782
- export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
783
- export const debug: typeof debuglog;
784
- /**
785
- * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`.
786
- *
787
- * ```js
788
- * import util from 'node:util';
789
- *
790
- * util.isBoolean(1);
791
- * // Returns: false
792
- * util.isBoolean(0);
793
- * // Returns: false
794
- * util.isBoolean(false);
795
- * // Returns: true
796
- * ```
797
- * @since v0.11.5
798
- * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead.
799
- */
800
- export function isBoolean(object: unknown): object is boolean;
801
- /**
802
- * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`.
803
- *
804
- * ```js
805
- * import util from 'node:util';
806
- *
807
- * util.isBuffer({ length: 0 });
808
- * // Returns: false
809
- * util.isBuffer([]);
810
- * // Returns: false
811
- * util.isBuffer(Buffer.from('hello world'));
812
- * // Returns: true
813
- * ```
814
- * @since v0.11.5
815
- * @deprecated Since v4.0.0 - Use `isBuffer` instead.
816
- */
817
- export function isBuffer(object: unknown): object is Buffer;
818
- /**
819
- * Returns `true` if the given `object` is a `Function`. Otherwise, returns `false`.
820
- *
821
- * ```js
822
- * import util from 'node:util';
823
- *
824
- * function Foo() {}
825
- * const Bar = () => {};
826
- *
827
- * util.isFunction({});
828
- * // Returns: false
829
- * util.isFunction(Foo);
830
- * // Returns: true
831
- * util.isFunction(Bar);
832
- * // Returns: true
833
- * ```
834
- * @since v0.11.5
835
- * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead.
836
- */
837
- export function isFunction(object: unknown): boolean;
838
- /**
839
- * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`.
840
- *
841
- * ```js
842
- * import util from 'node:util';
843
- *
844
- * util.isNull(0);
845
- * // Returns: false
846
- * util.isNull(undefined);
847
- * // Returns: false
848
- * util.isNull(null);
849
- * // Returns: true
850
- * ```
851
- * @since v0.11.5
852
- * @deprecated Since v4.0.0 - Use `value === null` instead.
853
- */
854
- export function isNull(object: unknown): object is null;
855
- /**
856
- * Returns `true` if the given `object` is `null` or `undefined`. Otherwise,
857
- * returns `false`.
858
- *
859
- * ```js
860
- * import util from 'node:util';
861
- *
862
- * util.isNullOrUndefined(0);
863
- * // Returns: false
864
- * util.isNullOrUndefined(undefined);
865
- * // Returns: true
866
- * util.isNullOrUndefined(null);
867
- * // Returns: true
868
- * ```
869
- * @since v0.11.5
870
- * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead.
871
- */
872
- export function isNullOrUndefined(object: unknown): object is null | undefined;
873
- /**
874
- * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`.
875
- *
876
- * ```js
877
- * import util from 'node:util';
878
- *
879
- * util.isNumber(false);
880
- * // Returns: false
881
- * util.isNumber(Infinity);
882
- * // Returns: true
883
- * util.isNumber(0);
884
- * // Returns: true
885
- * util.isNumber(NaN);
886
- * // Returns: true
887
- * ```
888
- * @since v0.11.5
889
- * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead.
890
- */
891
- export function isNumber(object: unknown): object is number;
892
- /**
893
- * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript).
894
- * Otherwise, returns `false`.
895
- *
896
- * ```js
897
- * import util from 'node:util';
898
- *
899
- * util.isObject(5);
900
- * // Returns: false
901
- * util.isObject(null);
902
- * // Returns: false
903
- * util.isObject({});
904
- * // Returns: true
905
- * util.isObject(() => {});
906
- * // Returns: false
907
- * ```
908
- * @since v0.11.5
909
- * @deprecated Since v4.0.0 - Use `value !== null && typeof value === 'object'` instead.
910
- */
911
- export function isObject(object: unknown): boolean;
912
- /**
913
- * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`.
914
- *
915
- * ```js
916
- * import util from 'node:util';
917
- *
918
- * util.isPrimitive(5);
919
- * // Returns: true
920
- * util.isPrimitive('foo');
921
- * // Returns: true
922
- * util.isPrimitive(false);
923
- * // Returns: true
924
- * util.isPrimitive(null);
925
- * // Returns: true
926
- * util.isPrimitive(undefined);
927
- * // Returns: true
928
- * util.isPrimitive({});
929
- * // Returns: false
930
- * util.isPrimitive(() => {});
931
- * // Returns: false
932
- * util.isPrimitive(/^$/);
933
- * // Returns: false
934
- * util.isPrimitive(new Date());
935
- * // Returns: false
936
- * ```
937
- * @since v0.11.5
938
- * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead.
939
- */
940
- export function isPrimitive(object: unknown): boolean;
941
- /**
942
- * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`.
943
- *
944
- * ```js
945
- * import util from 'node:util';
946
- *
947
- * util.isString('');
948
- * // Returns: true
949
- * util.isString('foo');
950
- * // Returns: true
951
- * util.isString(String('foo'));
952
- * // Returns: true
953
- * util.isString(5);
954
- * // Returns: false
955
- * ```
956
- * @since v0.11.5
957
- * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead.
958
- */
959
- export function isString(object: unknown): object is string;
960
- /**
961
- * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`.
962
- *
963
- * ```js
964
- * import util from 'node:util';
965
- *
966
- * util.isSymbol(5);
967
- * // Returns: false
968
- * util.isSymbol('foo');
969
- * // Returns: false
970
- * util.isSymbol(Symbol('foo'));
971
- * // Returns: true
972
- * ```
973
- * @since v0.11.5
974
- * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead.
975
- */
976
- export function isSymbol(object: unknown): object is symbol;
977
- /**
978
- * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`.
979
- *
980
- * ```js
981
- * import util from 'node:util';
982
- *
983
- * const foo = undefined;
984
- * util.isUndefined(5);
985
- * // Returns: false
986
- * util.isUndefined(foo);
987
- * // Returns: true
988
- * util.isUndefined(null);
989
- * // Returns: false
990
- * ```
991
- * @since v0.11.5
992
- * @deprecated Since v4.0.0 - Use `value === undefined` instead.
993
- */
994
- export function isUndefined(object: unknown): object is undefined;
995
- /**
996
- * The `util.deprecate()` method wraps `fn` (which may be a function or class) in
997
- * such a way that it is marked as deprecated.
998
- *
999
- * ```js
1000
- * import util from 'node:util';
1001
- *
1002
- * exports.obsoleteFunction = util.deprecate(() => {
1003
- * // Do something here.
1004
- * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.');
1005
- * ```
1006
- *
1007
- * When called, `util.deprecate()` will return a function that will emit a `DeprecationWarning` using the `'warning'` event. The warning will
1008
- * be emitted and printed to `stderr` the first time the returned function is
1009
- * called. After the warning is emitted, the wrapped function is called without
1010
- * emitting a warning.
1011
- *
1012
- * If the same optional `code` is supplied in multiple calls to `util.deprecate()`,
1013
- * the warning will be emitted only once for that `code`.
1014
- *
1015
- * ```js
1016
- * import util from 'node:util';
1017
- *
1018
- * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001');
1019
- * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001');
1020
- * fn1(); // Emits a deprecation warning with code DEP0001
1021
- * fn2(); // Does not emit a deprecation warning because it has the same code
1022
- * ```
1023
- *
1024
- * If either the `--no-deprecation` or `--no-warnings` command-line flags are
1025
- * used, or if the `process.noDeprecation` property is set to `true`_prior_ to
1026
- * the first deprecation warning, the `util.deprecate()` method does nothing.
1027
- *
1028
- * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set,
1029
- * or the `process.traceDeprecation` property is set to `true`, a warning and a
1030
- * stack trace are printed to `stderr` the first time the deprecated function is
1031
- * called.
1032
- *
1033
- * If the `--throw-deprecation` command-line flag is set, or the `process.throwDeprecation` property is set to `true`, then an exception will be
1034
- * thrown when the deprecated function is called.
1035
- *
1036
- * The `--throw-deprecation` command-line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation` and `process.traceDeprecation`.
1037
- * @since v0.8.0
1038
- * @param fn The function that is being deprecated.
1039
- * @param msg A warning message to display when the deprecated function is invoked.
1040
- * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes.
1041
- * @return The deprecated function wrapped to emit a warning.
1042
- */
1043
- export function deprecate<T extends Function>(fn: T, msg: string, code?: string): T;
1044
- /**
1045
- * Returns `true` if there is deep strict equality between `val1` and `val2`.
1046
- * Otherwise, returns `false`.
1047
- *
1048
- * See `assert.deepStrictEqual()` for more information about deep strict
1049
- * equality.
1050
- * @since v9.0.0
1051
- */
1052
- export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean;
1053
- /**
1054
- * Returns `str` with any ANSI escape codes removed.
1055
- *
1056
- * ```js
1057
- * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m'));
1058
- * // Prints "value"
1059
- * ```
1060
- * @since v16.11.0
1061
- */
1062
- export function stripVTControlCharacters(str: string): string;
1063
- /**
1064
- * Takes an `async` function (or a function that returns a `Promise`) and returns a
1065
- * function following the error-first callback style, i.e. taking
1066
- * an `(err, value) => ...` callback as the last argument. In the callback, the
1067
- * first argument will be the rejection reason (or `null` if the `Promise` resolved), and the second argument will be the resolved value.
1068
- *
1069
- * ```js
1070
- * import util from 'node:util';
1071
- *
1072
- * async function fn() {
1073
- * return 'hello world';
1074
- * }
1075
- * const callbackFunction = util.callbackify(fn);
1076
- *
1077
- * callbackFunction((err, ret) => {
1078
- * if (err) throw err;
1079
- * console.log(ret);
1080
- * });
1081
- * ```
1082
- *
1083
- * Will print:
1084
- *
1085
- * ```text
1086
- * hello world
1087
- * ```
1088
- *
1089
- * The callback is executed asynchronously, and will have a limited stack trace.
1090
- * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit.
1091
- *
1092
- * Since `null` has a special meaning as the first argument to a callback, if a
1093
- * wrapped function rejects a `Promise` with a falsy value as a reason, the value
1094
- * is wrapped in an `Error` with the original value stored in a field named `reason`.
1095
- *
1096
- * ```js
1097
- * function fn() {
1098
- * return Promise.reject(null);
1099
- * }
1100
- * const callbackFunction = util.callbackify(fn);
1101
- *
1102
- * callbackFunction((err, ret) => {
1103
- * // When the Promise was rejected with `null` it is wrapped with an Error and
1104
- * // the original value is stored in `reason`.
1105
- * err &#x26;&#x26; Object.hasOwn(err, 'reason') &#x26;&#x26; err.reason === null; // true
1106
- * });
1107
- * ```
1108
- * @since v8.2.0
1109
- * @param fn An `async` function
1110
- * @return a callback style function
1111
- */
1112
- export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
1113
- export function callbackify<TResult>(
1114
- fn: () => Promise<TResult>,
1115
- ): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
1116
- export function callbackify<T1>(
1117
- fn: (arg1: T1) => Promise<void>,
1118
- ): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
1119
- export function callbackify<T1, TResult>(
1120
- fn: (arg1: T1) => Promise<TResult>,
1121
- ): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
1122
- export function callbackify<T1, T2>(
1123
- fn: (arg1: T1, arg2: T2) => Promise<void>,
1124
- ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
1125
- export function callbackify<T1, T2, TResult>(
1126
- fn: (arg1: T1, arg2: T2) => Promise<TResult>,
1127
- ): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
1128
- export function callbackify<T1, T2, T3>(
1129
- fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<void>,
1130
- ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void;
1131
- export function callbackify<T1, T2, T3, TResult>(
1132
- fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>,
1133
- ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
1134
- export function callbackify<T1, T2, T3, T4>(
1135
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>,
1136
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
1137
- export function callbackify<T1, T2, T3, T4, TResult>(
1138
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>,
1139
- ): (
1140
- arg1: T1,
1141
- arg2: T2,
1142
- arg3: T3,
1143
- arg4: T4,
1144
- callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
1145
- ) => void;
1146
- export function callbackify<T1, T2, T3, T4, T5>(
1147
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>,
1148
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
1149
- export function callbackify<T1, T2, T3, T4, T5, TResult>(
1150
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>,
1151
- ): (
1152
- arg1: T1,
1153
- arg2: T2,
1154
- arg3: T3,
1155
- arg4: T4,
1156
- arg5: T5,
1157
- callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
1158
- ) => void;
1159
- export function callbackify<T1, T2, T3, T4, T5, T6>(
1160
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>,
1161
- ): (
1162
- arg1: T1,
1163
- arg2: T2,
1164
- arg3: T3,
1165
- arg4: T4,
1166
- arg5: T5,
1167
- arg6: T6,
1168
- callback: (err: NodeJS.ErrnoException) => void,
1169
- ) => void;
1170
- export function callbackify<T1, T2, T3, T4, T5, T6, TResult>(
1171
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>,
1172
- ): (
1173
- arg1: T1,
1174
- arg2: T2,
1175
- arg3: T3,
1176
- arg4: T4,
1177
- arg5: T5,
1178
- arg6: T6,
1179
- callback: (err: NodeJS.ErrnoException | null, result: TResult) => void,
1180
- ) => void;
1181
- export interface CustomPromisifyLegacy<TCustom extends Function> extends Function {
1182
- __promisify__: TCustom;
1183
- }
1184
- export interface CustomPromisifySymbol<TCustom extends Function> extends Function {
1185
- [promisify.custom]: TCustom;
1186
- }
1187
- export type CustomPromisify<TCustom extends Function> =
1188
- | CustomPromisifySymbol<TCustom>
1189
- | CustomPromisifyLegacy<TCustom>;
1190
- /**
1191
- * Takes a function following the common error-first callback style, i.e. taking
1192
- * an `(err, value) => ...` callback as the last argument, and returns a version
1193
- * that returns promises.
1194
- *
1195
- * ```js
1196
- * import util from 'node:util';
1197
- * import fs from 'node:fs';
1198
- *
1199
- * const stat = util.promisify(fs.stat);
1200
- * stat('.').then((stats) => {
1201
- * // Do something with `stats`
1202
- * }).catch((error) => {
1203
- * // Handle the error.
1204
- * });
1205
- * ```
1206
- *
1207
- * Or, equivalently using `async function`s:
1208
- *
1209
- * ```js
1210
- * import util from 'node:util';
1211
- * import fs from 'node:fs';
1212
- *
1213
- * const stat = util.promisify(fs.stat);
1214
- *
1215
- * async function callStat() {
1216
- * const stats = await stat('.');
1217
- * console.log(`This directory is owned by ${stats.uid}`);
1218
- * }
1219
- *
1220
- * callStat();
1221
- * ```
1222
- *
1223
- * If there is an `original[util.promisify.custom]` property present, `promisify` will return its value, see `Custom promisified functions`.
1224
- *
1225
- * `promisify()` assumes that `original` is a function taking a callback as its
1226
- * final argument in all cases. If `original` is not a function, `promisify()` will throw an error. If `original` is a function but its last argument is not
1227
- * an error-first callback, it will still be passed an error-first
1228
- * callback as its last argument.
1229
- *
1230
- * Using `promisify()` on class methods or other methods that use `this` may not
1231
- * work as expected unless handled specially:
1232
- *
1233
- * ```js
1234
- * import util from 'node:util';
1235
- *
1236
- * class Foo {
1237
- * constructor() {
1238
- * this.a = 42;
1239
- * }
1240
- *
1241
- * bar(callback) {
1242
- * callback(null, this.a);
1243
- * }
1244
- * }
1245
- *
1246
- * const foo = new Foo();
1247
- *
1248
- * const naiveBar = util.promisify(foo.bar);
1249
- * // TypeError: Cannot read property 'a' of undefined
1250
- * // naiveBar().then(a => console.log(a));
1251
- *
1252
- * naiveBar.call(foo).then((a) => console.log(a)); // '42'
1253
- *
1254
- * const bindBar = naiveBar.bind(foo);
1255
- * bindBar().then((a) => console.log(a)); // '42'
1256
- * ```
1257
- * @since v8.0.0
1258
- */
1259
- export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
1260
- export function promisify<TResult>(
1261
- fn: (callback: (err: any, result: TResult) => void) => void,
1262
- ): () => Promise<TResult>;
1263
- export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
1264
- export function promisify<T1, TResult>(
1265
- fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void,
1266
- ): (arg1: T1) => Promise<TResult>;
1267
- export function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
1268
- export function promisify<T1, T2, TResult>(
1269
- fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void,
1270
- ): (arg1: T1, arg2: T2) => Promise<TResult>;
1271
- export function promisify<T1, T2>(
1272
- fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void,
1273
- ): (arg1: T1, arg2: T2) => Promise<void>;
1274
- export function promisify<T1, T2, T3, TResult>(
1275
- fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void,
1276
- ): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
1277
- export function promisify<T1, T2, T3>(
1278
- fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void,
1279
- ): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
1280
- export function promisify<T1, T2, T3, T4, TResult>(
1281
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
1282
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
1283
- export function promisify<T1, T2, T3, T4>(
1284
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void,
1285
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
1286
- export function promisify<T1, T2, T3, T4, T5, TResult>(
1287
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
1288
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
1289
- export function promisify<T1, T2, T3, T4, T5>(
1290
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
1291
- ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
1292
- export function promisify(fn: Function): Function;
1293
- export namespace promisify {
1294
- /**
1295
- * That can be used to declare custom promisified variants of functions.
1296
- */
1297
- const custom: unique symbol;
1298
- }
1299
- /**
1300
- * Stability: 1.1 - Active development
1301
- * Given an example `.env` file:
1302
- *
1303
- * ```js
1304
- * import { parseEnv } from 'node:util';
1305
- *
1306
- * parseEnv('HELLO=world\nHELLO=oh my\n');
1307
- * // Returns: { HELLO: 'oh my' }
1308
- * ```
1309
- * @param content The raw contents of a `.env` file.
1310
- * @since v20.12.0
1311
- */
1312
- export function parseEnv(content: string): object;
1313
- // https://nodejs.org/docs/latest/api/util.html#foreground-colors
1314
- type ForegroundColors =
1315
- | "black"
1316
- | "blackBright"
1317
- | "blue"
1318
- | "blueBright"
1319
- | "cyan"
1320
- | "cyanBright"
1321
- | "gray"
1322
- | "green"
1323
- | "greenBright"
1324
- | "grey"
1325
- | "magenta"
1326
- | "magentaBright"
1327
- | "red"
1328
- | "redBright"
1329
- | "white"
1330
- | "whiteBright"
1331
- | "yellow"
1332
- | "yellowBright";
1333
- // https://nodejs.org/docs/latest/api/util.html#background-colors
1334
- type BackgroundColors =
1335
- | "bgBlack"
1336
- | "bgBlackBright"
1337
- | "bgBlue"
1338
- | "bgBlueBright"
1339
- | "bgCyan"
1340
- | "bgCyanBright"
1341
- | "bgGray"
1342
- | "bgGreen"
1343
- | "bgGreenBright"
1344
- | "bgGrey"
1345
- | "bgMagenta"
1346
- | "bgMagentaBright"
1347
- | "bgRed"
1348
- | "bgRedBright"
1349
- | "bgWhite"
1350
- | "bgWhiteBright"
1351
- | "bgYellow"
1352
- | "bgYellowBright";
1353
- // https://nodejs.org/docs/latest/api/util.html#modifiers
1354
- type Modifiers =
1355
- | "blink"
1356
- | "bold"
1357
- | "dim"
1358
- | "doubleunderline"
1359
- | "framed"
1360
- | "hidden"
1361
- | "inverse"
1362
- | "italic"
1363
- | "overlined"
1364
- | "reset"
1365
- | "strikethrough"
1366
- | "underline";
1367
- /**
1368
- * This function returns a formatted text considering the `format` passed.
1369
- *
1370
- * ```js
1371
- * import { styleText } from 'node:util';
1372
- * const errorMessage = styleText('red', 'Error! Error!');
1373
- * console.log(errorMessage);
1374
- * ```
1375
- *
1376
- * `util.inspect.colors` also provides text formats such as `italic`, and `underline` and you can combine both:
1377
- *
1378
- * ```js
1379
- * console.log(
1380
- * util.styleText(['underline', 'italic'], 'My italic underlined message'),
1381
- * );
1382
- * ```
1383
- *
1384
- * When passing an array of formats, the order of the format applied is left to right so the following style
1385
- * might overwrite the previous one.
1386
- *
1387
- * ```js
1388
- * console.log(
1389
- * util.styleText(['red', 'green'], 'text'), // green
1390
- * );
1391
- * ```
1392
- *
1393
- * The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v22.x/api/util.html#modifiers).
1394
- * @param format A text format or an Array of text formats defined in `util.inspect.colors`.
1395
- * @param text The text to to be formatted.
1396
- * @since v20.12.0
1397
- */
1398
- export function styleText(
1399
- format:
1400
- | ForegroundColors
1401
- | BackgroundColors
1402
- | Modifiers
1403
- | Array<ForegroundColors | BackgroundColors | Modifiers>,
1404
- text: string,
1405
- ): string;
1406
- /**
1407
- * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API.
1408
- *
1409
- * ```js
1410
- * const decoder = new TextDecoder();
1411
- * const u8arr = new Uint8Array([72, 101, 108, 108, 111]);
1412
- * console.log(decoder.decode(u8arr)); // Hello
1413
- * ```
1414
- * @since v8.3.0
1415
- */
1416
- export class TextDecoder {
1417
- /**
1418
- * The encoding supported by the `TextDecoder` instance.
1419
- */
1420
- readonly encoding: string;
1421
- /**
1422
- * The value will be `true` if decoding errors result in a `TypeError` being
1423
- * thrown.
1424
- */
1425
- readonly fatal: boolean;
1426
- /**
1427
- * The value will be `true` if the decoding result will include the byte order
1428
- * mark.
1429
- */
1430
- readonly ignoreBOM: boolean;
1431
- constructor(
1432
- encoding?: string,
1433
- options?: {
1434
- fatal?: boolean | undefined;
1435
- ignoreBOM?: boolean | undefined;
1436
- },
1437
- );
1438
- /**
1439
- * Decodes the `input` and returns a string. If `options.stream` is `true`, any
1440
- * incomplete byte sequences occurring at the end of the `input` are buffered
1441
- * internally and emitted after the next call to `textDecoder.decode()`.
1442
- *
1443
- * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a `TypeError` being thrown.
1444
- * @param input An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data.
1445
- */
1446
- decode(
1447
- input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
1448
- options?: {
1449
- stream?: boolean | undefined;
1450
- },
1451
- ): string;
1452
- }
1453
- export interface EncodeIntoResult {
1454
- /**
1455
- * The read Unicode code units of input.
1456
- */
1457
- read: number;
1458
- /**
1459
- * The written UTF-8 bytes of output.
1460
- */
1461
- written: number;
1462
- }
1463
- export { types };
1464
-
1465
- //// TextEncoder/Decoder
1466
- /**
1467
- * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All
1468
- * instances of `TextEncoder` only support UTF-8 encoding.
1469
- *
1470
- * ```js
1471
- * const encoder = new TextEncoder();
1472
- * const uint8array = encoder.encode('this is some data');
1473
- * ```
1474
- *
1475
- * The `TextEncoder` class is also available on the global object.
1476
- * @since v8.3.0
1477
- */
1478
- export class TextEncoder {
1479
- /**
1480
- * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`.
1481
- */
1482
- readonly encoding: string;
1483
- /**
1484
- * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the
1485
- * encoded bytes.
1486
- * @param [input='an empty string'] The text to encode.
1487
- */
1488
- encode(input?: string): Uint8Array;
1489
- /**
1490
- * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object
1491
- * containing the read Unicode code units and written UTF-8 bytes.
1492
- *
1493
- * ```js
1494
- * const encoder = new TextEncoder();
1495
- * const src = 'this is some data';
1496
- * const dest = new Uint8Array(10);
1497
- * const { read, written } = encoder.encodeInto(src, dest);
1498
- * ```
1499
- * @param src The text to encode.
1500
- * @param dest The array to hold the encode result.
1501
- */
1502
- encodeInto(src: string, dest: Uint8Array): EncodeIntoResult;
1503
- }
1504
- import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from "util";
1505
- global {
1506
- /**
1507
- * `TextDecoder` class is a global reference for `import { TextDecoder } from 'node:util'`
1508
- * https://nodejs.org/api/globals.html#textdecoder
1509
- * @since v11.0.0
1510
- */
1511
- var TextDecoder: typeof globalThis extends {
1512
- onmessage: any;
1513
- TextDecoder: infer TextDecoder;
1514
- } ? TextDecoder
1515
- : typeof _TextDecoder;
1516
- /**
1517
- * `TextEncoder` class is a global reference for `import { TextEncoder } from 'node:util'`
1518
- * https://nodejs.org/api/globals.html#textencoder
1519
- * @since v11.0.0
1520
- */
1521
- var TextEncoder: typeof globalThis extends {
1522
- onmessage: any;
1523
- TextEncoder: infer TextEncoder;
1524
- } ? TextEncoder
1525
- : typeof _TextEncoder;
1526
- }
1527
-
1528
- //// parseArgs
1529
- /**
1530
- * Provides a higher level API for command-line argument parsing than interacting
1531
- * with `process.argv` directly. Takes a specification for the expected arguments
1532
- * and returns a structured object with the parsed options and positionals.
1533
- *
1534
- * ```js
1535
- * import { parseArgs } from 'node:util';
1536
- * const args = ['-f', '--bar', 'b'];
1537
- * const options = {
1538
- * foo: {
1539
- * type: 'boolean',
1540
- * short: 'f',
1541
- * },
1542
- * bar: {
1543
- * type: 'string',
1544
- * },
1545
- * };
1546
- * const {
1547
- * values,
1548
- * positionals,
1549
- * } = parseArgs({ args, options });
1550
- * console.log(values, positionals);
1551
- * // Prints: [Object: null prototype] { foo: true, bar: 'b' } []
1552
- * ```
1553
- * @since v18.3.0, v16.17.0
1554
- * @param config Used to provide arguments for parsing and to configure the parser. `config` supports the following properties:
1555
- * @return The parsed command line arguments:
1556
- */
1557
- export function parseArgs<T extends ParseArgsConfig>(config?: T): ParsedResults<T>;
1558
- interface ParseArgsOptionConfig {
1559
- /**
1560
- * Type of argument.
1561
- */
1562
- type: "string" | "boolean";
1563
- /**
1564
- * Whether this option can be provided multiple times.
1565
- * If `true`, all values will be collected in an array.
1566
- * If `false`, values for the option are last-wins.
1567
- * @default false.
1568
- */
1569
- multiple?: boolean | undefined;
1570
- /**
1571
- * A single character alias for the option.
1572
- */
1573
- short?: string | undefined;
1574
- /**
1575
- * The default option value when it is not set by args.
1576
- * It must be of the same type as the the `type` property.
1577
- * When `multiple` is `true`, it must be an array.
1578
- * @since v18.11.0
1579
- */
1580
- default?: string | boolean | string[] | boolean[] | undefined;
1581
- }
1582
- interface ParseArgsOptionsConfig {
1583
- [longOption: string]: ParseArgsOptionConfig;
1584
- }
1585
- export interface ParseArgsConfig {
1586
- /**
1587
- * Array of argument strings.
1588
- */
1589
- args?: string[] | undefined;
1590
- /**
1591
- * Used to describe arguments known to the parser.
1592
- */
1593
- options?: ParseArgsOptionsConfig | undefined;
1594
- /**
1595
- * Should an error be thrown when unknown arguments are encountered,
1596
- * or when arguments are passed that do not match the `type` configured in `options`.
1597
- * @default true
1598
- */
1599
- strict?: boolean | undefined;
1600
- /**
1601
- * Whether this command accepts positional arguments.
1602
- */
1603
- allowPositionals?: boolean | undefined;
1604
- /**
1605
- * If `true`, allows explicitly setting boolean options to `false` by prefixing the option name with `--no-`.
1606
- * @default false
1607
- * @since v22.4.0
1608
- */
1609
- allowNegative?: boolean | undefined;
1610
- /**
1611
- * Return the parsed tokens. This is useful for extending the built-in behavior,
1612
- * from adding additional checks through to reprocessing the tokens in different ways.
1613
- * @default false
1614
- */
1615
- tokens?: boolean | undefined;
1616
- }
1617
- /*
1618
- IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties.
1619
- TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936
1620
- This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present".
1621
- But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present.
1622
- So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value.
1623
- This is technically incorrect but is a much nicer UX for the common case.
1624
- The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false.
1625
- */
1626
- type IfDefaultsTrue<T, IfTrue, IfFalse> = T extends true ? IfTrue
1627
- : T extends false ? IfFalse
1628
- : IfTrue;
1629
-
1630
- // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false`
1631
- type IfDefaultsFalse<T, IfTrue, IfFalse> = T extends false ? IfFalse
1632
- : T extends true ? IfTrue
1633
- : IfFalse;
1634
-
1635
- type ExtractOptionValue<T extends ParseArgsConfig, O extends ParseArgsOptionConfig> = IfDefaultsTrue<
1636
- T["strict"],
1637
- O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean,
1638
- string | boolean
1639
- >;
1640
-
1641
- type ApplyOptionalModifiers<O extends ParseArgsOptionsConfig, V extends Record<keyof O, unknown>> = (
1642
- & { -readonly [LongOption in keyof O]?: V[LongOption] }
1643
- & { [LongOption in keyof O as O[LongOption]["default"] extends {} ? LongOption : never]: V[LongOption] }
1644
- ) extends infer P ? { [K in keyof P]: P[K] } : never; // resolve intersection to object
1645
-
1646
- type ParsedValues<T extends ParseArgsConfig> =
1647
- & IfDefaultsTrue<T["strict"], unknown, { [longOption: string]: undefined | string | boolean }>
1648
- & (T["options"] extends ParseArgsOptionsConfig ? ApplyOptionalModifiers<
1649
- T["options"],
1650
- {
1651
- [LongOption in keyof T["options"]]: IfDefaultsFalse<
1652
- T["options"][LongOption]["multiple"],
1653
- Array<ExtractOptionValue<T, T["options"][LongOption]>>,
1654
- ExtractOptionValue<T, T["options"][LongOption]>
1655
- >;
1656
- }
1657
- >
1658
- : {});
1659
-
1660
- type ParsedPositionals<T extends ParseArgsConfig> = IfDefaultsTrue<
1661
- T["strict"],
1662
- IfDefaultsFalse<T["allowPositionals"], string[], []>,
1663
- IfDefaultsTrue<T["allowPositionals"], string[], []>
1664
- >;
1665
-
1666
- type PreciseTokenForOptions<
1667
- K extends string,
1668
- O extends ParseArgsOptionConfig,
1669
- > = O["type"] extends "string" ? {
1670
- kind: "option";
1671
- index: number;
1672
- name: K;
1673
- rawName: string;
1674
- value: string;
1675
- inlineValue: boolean;
1676
- }
1677
- : O["type"] extends "boolean" ? {
1678
- kind: "option";
1679
- index: number;
1680
- name: K;
1681
- rawName: string;
1682
- value: undefined;
1683
- inlineValue: undefined;
1684
- }
1685
- : OptionToken & { name: K };
1686
-
1687
- type TokenForOptions<
1688
- T extends ParseArgsConfig,
1689
- K extends keyof T["options"] = keyof T["options"],
1690
- > = K extends unknown
1691
- ? T["options"] extends ParseArgsOptionsConfig ? PreciseTokenForOptions<K & string, T["options"][K]>
1692
- : OptionToken
1693
- : never;
1694
-
1695
- type ParsedOptionToken<T extends ParseArgsConfig> = IfDefaultsTrue<T["strict"], TokenForOptions<T>, OptionToken>;
1696
-
1697
- type ParsedPositionalToken<T extends ParseArgsConfig> = IfDefaultsTrue<
1698
- T["strict"],
1699
- IfDefaultsFalse<T["allowPositionals"], { kind: "positional"; index: number; value: string }, never>,
1700
- IfDefaultsTrue<T["allowPositionals"], { kind: "positional"; index: number; value: string }, never>
1701
- >;
1702
-
1703
- type ParsedTokens<T extends ParseArgsConfig> = Array<
1704
- ParsedOptionToken<T> | ParsedPositionalToken<T> | { kind: "option-terminator"; index: number }
1705
- >;
1706
-
1707
- type PreciseParsedResults<T extends ParseArgsConfig> = IfDefaultsFalse<
1708
- T["tokens"],
1709
- {
1710
- values: ParsedValues<T>;
1711
- positionals: ParsedPositionals<T>;
1712
- tokens: ParsedTokens<T>;
1713
- },
1714
- {
1715
- values: ParsedValues<T>;
1716
- positionals: ParsedPositionals<T>;
1717
- }
1718
- >;
1719
-
1720
- type OptionToken =
1721
- | { kind: "option"; index: number; name: string; rawName: string; value: string; inlineValue: boolean }
1722
- | {
1723
- kind: "option";
1724
- index: number;
1725
- name: string;
1726
- rawName: string;
1727
- value: undefined;
1728
- inlineValue: undefined;
1729
- };
1730
-
1731
- type Token =
1732
- | OptionToken
1733
- | { kind: "positional"; index: number; value: string }
1734
- | { kind: "option-terminator"; index: number };
1735
-
1736
- // If ParseArgsConfig extends T, then the user passed config constructed elsewhere.
1737
- // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above.
1738
- type ParsedResults<T extends ParseArgsConfig> = ParseArgsConfig extends T ? {
1739
- values: {
1740
- [longOption: string]: undefined | string | boolean | Array<string | boolean>;
1741
- };
1742
- positionals: string[];
1743
- tokens?: Token[];
1744
- }
1745
- : PreciseParsedResults<T>;
1746
-
1747
- /**
1748
- * An implementation of [the MIMEType class](https://bmeck.github.io/node-proposal-mime-api/).
1749
- *
1750
- * In accordance with browser conventions, all properties of `MIMEType` objects
1751
- * are implemented as getters and setters on the class prototype, rather than as
1752
- * data properties on the object itself.
1753
- *
1754
- * A MIME string is a structured string containing multiple meaningful
1755
- * components. When parsed, a `MIMEType` object is returned containing
1756
- * properties for each of these components.
1757
- * @since v19.1.0, v18.13.0
1758
- * @experimental
1759
- */
1760
- export class MIMEType {
1761
- /**
1762
- * Creates a new MIMEType object by parsing the input.
1763
- *
1764
- * A `TypeError` will be thrown if the `input` is not a valid MIME.
1765
- * Note that an effort will be made to coerce the given values into strings.
1766
- * @param input The input MIME to parse.
1767
- */
1768
- constructor(input: string | { toString: () => string });
1769
-
1770
- /**
1771
- * Gets and sets the type portion of the MIME.
1772
- *
1773
- * ```js
1774
- * import { MIMEType } from 'node:util';
1775
- *
1776
- * const myMIME = new MIMEType('text/javascript');
1777
- * console.log(myMIME.type);
1778
- * // Prints: text
1779
- * myMIME.type = 'application';
1780
- * console.log(myMIME.type);
1781
- * // Prints: application
1782
- * console.log(String(myMIME));
1783
- * // Prints: application/javascript
1784
- * ```
1785
- */
1786
- type: string;
1787
- /**
1788
- * Gets and sets the subtype portion of the MIME.
1789
- *
1790
- * ```js
1791
- * import { MIMEType } from 'node:util';
1792
- *
1793
- * const myMIME = new MIMEType('text/ecmascript');
1794
- * console.log(myMIME.subtype);
1795
- * // Prints: ecmascript
1796
- * myMIME.subtype = 'javascript';
1797
- * console.log(myMIME.subtype);
1798
- * // Prints: javascript
1799
- * console.log(String(myMIME));
1800
- * // Prints: text/javascript
1801
- * ```
1802
- */
1803
- subtype: string;
1804
- /**
1805
- * Gets the essence of the MIME. This property is read only.
1806
- * Use `mime.type` or `mime.subtype` to alter the MIME.
1807
- *
1808
- * ```js
1809
- * import { MIMEType } from 'node:util';
1810
- *
1811
- * const myMIME = new MIMEType('text/javascript;key=value');
1812
- * console.log(myMIME.essence);
1813
- * // Prints: text/javascript
1814
- * myMIME.type = 'application';
1815
- * console.log(myMIME.essence);
1816
- * // Prints: application/javascript
1817
- * console.log(String(myMIME));
1818
- * // Prints: application/javascript;key=value
1819
- * ```
1820
- */
1821
- readonly essence: string;
1822
- /**
1823
- * Gets the `MIMEParams` object representing the
1824
- * parameters of the MIME. This property is read-only. See `MIMEParams` documentation for details.
1825
- */
1826
- readonly params: MIMEParams;
1827
- /**
1828
- * The `toString()` method on the `MIMEType` object returns the serialized MIME.
1829
- *
1830
- * Because of the need for standard compliance, this method does not allow users
1831
- * to customize the serialization process of the MIME.
1832
- */
1833
- toString(): string;
1834
- }
1835
- /**
1836
- * The `MIMEParams` API provides read and write access to the parameters of a `MIMEType`.
1837
- * @since v19.1.0, v18.13.0
1838
- */
1839
- export class MIMEParams {
1840
- /**
1841
- * Remove all name-value pairs whose name is `name`.
1842
- */
1843
- delete(name: string): void;
1844
- /**
1845
- * Returns an iterator over each of the name-value pairs in the parameters.
1846
- * Each item of the iterator is a JavaScript `Array`. The first item of the array
1847
- * is the `name`, the second item of the array is the `value`.
1848
- */
1849
- entries(): NodeJS.Iterator<[name: string, value: string]>;
1850
- /**
1851
- * Returns the value of the first name-value pair whose name is `name`. If there
1852
- * are no such pairs, `null` is returned.
1853
- * @return or `null` if there is no name-value pair with the given `name`.
1854
- */
1855
- get(name: string): string | null;
1856
- /**
1857
- * Returns `true` if there is at least one name-value pair whose name is `name`.
1858
- */
1859
- has(name: string): boolean;
1860
- /**
1861
- * Returns an iterator over the names of each name-value pair.
1862
- *
1863
- * ```js
1864
- * import { MIMEType } from 'node:util';
1865
- *
1866
- * const { params } = new MIMEType('text/plain;foo=0;bar=1');
1867
- * for (const name of params.keys()) {
1868
- * console.log(name);
1869
- * }
1870
- * // Prints:
1871
- * // foo
1872
- * // bar
1873
- * ```
1874
- */
1875
- keys(): NodeJS.Iterator<string>;
1876
- /**
1877
- * Sets the value in the `MIMEParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`,
1878
- * set the first such pair's value to `value`.
1879
- *
1880
- * ```js
1881
- * import { MIMEType } from 'node:util';
1882
- *
1883
- * const { params } = new MIMEType('text/plain;foo=0;bar=1');
1884
- * params.set('foo', 'def');
1885
- * params.set('baz', 'xyz');
1886
- * console.log(params.toString());
1887
- * // Prints: foo=def;bar=1;baz=xyz
1888
- * ```
1889
- */
1890
- set(name: string, value: string): void;
1891
- /**
1892
- * Returns an iterator over the values of each name-value pair.
1893
- */
1894
- values(): NodeJS.Iterator<string>;
1895
- /**
1896
- * Returns an iterator over each of the name-value pairs in the parameters.
1897
- */
1898
- [Symbol.iterator](): NodeJS.Iterator<[name: string, value: string]>;
1899
- }
1900
- }
1901
- declare module "util/types" {
1902
- import { KeyObject, webcrypto } from "node:crypto";
1903
- /**
1904
- * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or
1905
- * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
1906
- *
1907
- * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`.
1908
- *
1909
- * ```js
1910
- * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true
1911
- * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true
1912
- * ```
1913
- * @since v10.0.0
1914
- */
1915
- function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike;
1916
- /**
1917
- * Returns `true` if the value is an `arguments` object.
1918
- *
1919
- * ```js
1920
- * function foo() {
1921
- * util.types.isArgumentsObject(arguments); // Returns true
1922
- * }
1923
- * ```
1924
- * @since v10.0.0
1925
- */
1926
- function isArgumentsObject(object: unknown): object is IArguments;
1927
- /**
1928
- * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance.
1929
- * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is
1930
- * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
1931
- *
1932
- * ```js
1933
- * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true
1934
- * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false
1935
- * ```
1936
- * @since v10.0.0
1937
- */
1938
- function isArrayBuffer(object: unknown): object is ArrayBuffer;
1939
- /**
1940
- * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed
1941
- * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to
1942
- * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
1943
- *
1944
- * ```js
1945
- * util.types.isArrayBufferView(new Int8Array()); // true
1946
- * util.types.isArrayBufferView(Buffer.from('hello world')); // true
1947
- * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true
1948
- * util.types.isArrayBufferView(new ArrayBuffer()); // false
1949
- * ```
1950
- * @since v10.0.0
1951
- */
1952
- function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView;
1953
- /**
1954
- * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function).
1955
- * This only reports back what the JavaScript engine is seeing;
1956
- * in particular, the return value may not match the original source code if
1957
- * a transpilation tool was used.
1958
- *
1959
- * ```js
1960
- * util.types.isAsyncFunction(function foo() {}); // Returns false
1961
- * util.types.isAsyncFunction(async function foo() {}); // Returns true
1962
- * ```
1963
- * @since v10.0.0
1964
- */
1965
- function isAsyncFunction(object: unknown): boolean;
1966
- /**
1967
- * Returns `true` if the value is a `BigInt64Array` instance.
1968
- *
1969
- * ```js
1970
- * util.types.isBigInt64Array(new BigInt64Array()); // Returns true
1971
- * util.types.isBigInt64Array(new BigUint64Array()); // Returns false
1972
- * ```
1973
- * @since v10.0.0
1974
- */
1975
- function isBigInt64Array(value: unknown): value is BigInt64Array;
1976
- /**
1977
- * Returns `true` if the value is a BigInt object, e.g. created
1978
- * by `Object(BigInt(123))`.
1979
- *
1980
- * ```js
1981
- * util.types.isBigIntObject(Object(BigInt(123))); // Returns true
1982
- * util.types.isBigIntObject(BigInt(123)); // Returns false
1983
- * util.types.isBigIntObject(123); // Returns false
1984
- * ```
1985
- * @since v10.4.0
1986
- */
1987
- function isBigIntObject(object: unknown): object is BigInt;
1988
- /**
1989
- * Returns `true` if the value is a `BigUint64Array` instance.
1990
- *
1991
- * ```js
1992
- * util.types.isBigUint64Array(new BigInt64Array()); // Returns false
1993
- * util.types.isBigUint64Array(new BigUint64Array()); // Returns true
1994
- * ```
1995
- * @since v10.0.0
1996
- */
1997
- function isBigUint64Array(value: unknown): value is BigUint64Array;
1998
- /**
1999
- * Returns `true` if the value is a boolean object, e.g. created
2000
- * by `new Boolean()`.
2001
- *
2002
- * ```js
2003
- * util.types.isBooleanObject(false); // Returns false
2004
- * util.types.isBooleanObject(true); // Returns false
2005
- * util.types.isBooleanObject(new Boolean(false)); // Returns true
2006
- * util.types.isBooleanObject(new Boolean(true)); // Returns true
2007
- * util.types.isBooleanObject(Boolean(false)); // Returns false
2008
- * util.types.isBooleanObject(Boolean(true)); // Returns false
2009
- * ```
2010
- * @since v10.0.0
2011
- */
2012
- function isBooleanObject(object: unknown): object is Boolean;
2013
- /**
2014
- * Returns `true` if the value is any boxed primitive object, e.g. created
2015
- * by `new Boolean()`, `new String()` or `Object(Symbol())`.
2016
- *
2017
- * For example:
2018
- *
2019
- * ```js
2020
- * util.types.isBoxedPrimitive(false); // Returns false
2021
- * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true
2022
- * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false
2023
- * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true
2024
- * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true
2025
- * ```
2026
- * @since v10.11.0
2027
- */
2028
- function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol;
2029
- /**
2030
- * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance.
2031
- *
2032
- * ```js
2033
- * const ab = new ArrayBuffer(20);
2034
- * util.types.isDataView(new DataView(ab)); // Returns true
2035
- * util.types.isDataView(new Float64Array()); // Returns false
2036
- * ```
2037
- *
2038
- * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
2039
- * @since v10.0.0
2040
- */
2041
- function isDataView(object: unknown): object is DataView;
2042
- /**
2043
- * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
2044
- *
2045
- * ```js
2046
- * util.types.isDate(new Date()); // Returns true
2047
- * ```
2048
- * @since v10.0.0
2049
- */
2050
- function isDate(object: unknown): object is Date;
2051
- /**
2052
- * Returns `true` if the value is a native `External` value.
2053
- *
2054
- * A native `External` value is a special type of object that contains a
2055
- * raw C++ pointer (`void*`) for access from native code, and has no other
2056
- * properties. Such objects are created either by Node.js internals or native
2057
- * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype.
2058
- *
2059
- * ```c
2060
- * #include <js_native_api.h>
2061
- * #include <stdlib.h>
2062
- * napi_value result;
2063
- * static napi_value MyNapi(napi_env env, napi_callback_info info) {
2064
- * int* raw = (int*) malloc(1024);
2065
- * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &#x26;result);
2066
- * if (status != napi_ok) {
2067
- * napi_throw_error(env, NULL, "napi_create_external failed");
2068
- * return NULL;
2069
- * }
2070
- * return result;
2071
- * }
2072
- * ...
2073
- * DECLARE_NAPI_PROPERTY("myNapi", MyNapi)
2074
- * ...
2075
- * ```
2076
- *
2077
- * ```js
2078
- * const native = require('napi_addon.node');
2079
- * const data = native.myNapi();
2080
- * util.types.isExternal(data); // returns true
2081
- * util.types.isExternal(0); // returns false
2082
- * util.types.isExternal(new String('foo')); // returns false
2083
- * ```
2084
- *
2085
- * For further information on `napi_create_external`, refer to `napi_create_external()`.
2086
- * @since v10.0.0
2087
- */
2088
- function isExternal(object: unknown): boolean;
2089
- /**
2090
- * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance.
2091
- *
2092
- * ```js
2093
- * util.types.isFloat32Array(new ArrayBuffer()); // Returns false
2094
- * util.types.isFloat32Array(new Float32Array()); // Returns true
2095
- * util.types.isFloat32Array(new Float64Array()); // Returns false
2096
- * ```
2097
- * @since v10.0.0
2098
- */
2099
- function isFloat32Array(object: unknown): object is Float32Array;
2100
- /**
2101
- * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance.
2102
- *
2103
- * ```js
2104
- * util.types.isFloat64Array(new ArrayBuffer()); // Returns false
2105
- * util.types.isFloat64Array(new Uint8Array()); // Returns false
2106
- * util.types.isFloat64Array(new Float64Array()); // Returns true
2107
- * ```
2108
- * @since v10.0.0
2109
- */
2110
- function isFloat64Array(object: unknown): object is Float64Array;
2111
- /**
2112
- * Returns `true` if the value is a generator function.
2113
- * This only reports back what the JavaScript engine is seeing;
2114
- * in particular, the return value may not match the original source code if
2115
- * a transpilation tool was used.
2116
- *
2117
- * ```js
2118
- * util.types.isGeneratorFunction(function foo() {}); // Returns false
2119
- * util.types.isGeneratorFunction(function* foo() {}); // Returns true
2120
- * ```
2121
- * @since v10.0.0
2122
- */
2123
- function isGeneratorFunction(object: unknown): object is GeneratorFunction;
2124
- /**
2125
- * Returns `true` if the value is a generator object as returned from a
2126
- * built-in generator function.
2127
- * This only reports back what the JavaScript engine is seeing;
2128
- * in particular, the return value may not match the original source code if
2129
- * a transpilation tool was used.
2130
- *
2131
- * ```js
2132
- * function* foo() {}
2133
- * const generator = foo();
2134
- * util.types.isGeneratorObject(generator); // Returns true
2135
- * ```
2136
- * @since v10.0.0
2137
- */
2138
- function isGeneratorObject(object: unknown): object is Generator;
2139
- /**
2140
- * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance.
2141
- *
2142
- * ```js
2143
- * util.types.isInt8Array(new ArrayBuffer()); // Returns false
2144
- * util.types.isInt8Array(new Int8Array()); // Returns true
2145
- * util.types.isInt8Array(new Float64Array()); // Returns false
2146
- * ```
2147
- * @since v10.0.0
2148
- */
2149
- function isInt8Array(object: unknown): object is Int8Array;
2150
- /**
2151
- * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance.
2152
- *
2153
- * ```js
2154
- * util.types.isInt16Array(new ArrayBuffer()); // Returns false
2155
- * util.types.isInt16Array(new Int16Array()); // Returns true
2156
- * util.types.isInt16Array(new Float64Array()); // Returns false
2157
- * ```
2158
- * @since v10.0.0
2159
- */
2160
- function isInt16Array(object: unknown): object is Int16Array;
2161
- /**
2162
- * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance.
2163
- *
2164
- * ```js
2165
- * util.types.isInt32Array(new ArrayBuffer()); // Returns false
2166
- * util.types.isInt32Array(new Int32Array()); // Returns true
2167
- * util.types.isInt32Array(new Float64Array()); // Returns false
2168
- * ```
2169
- * @since v10.0.0
2170
- */
2171
- function isInt32Array(object: unknown): object is Int32Array;
2172
- /**
2173
- * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
2174
- *
2175
- * ```js
2176
- * util.types.isMap(new Map()); // Returns true
2177
- * ```
2178
- * @since v10.0.0
2179
- */
2180
- function isMap<T>(
2181
- object: T | {},
2182
- ): object is T extends ReadonlyMap<any, any> ? (unknown extends T ? never : ReadonlyMap<any, any>)
2183
- : Map<unknown, unknown>;
2184
- /**
2185
- * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
2186
- *
2187
- * ```js
2188
- * const map = new Map();
2189
- * util.types.isMapIterator(map.keys()); // Returns true
2190
- * util.types.isMapIterator(map.values()); // Returns true
2191
- * util.types.isMapIterator(map.entries()); // Returns true
2192
- * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true
2193
- * ```
2194
- * @since v10.0.0
2195
- */
2196
- function isMapIterator(object: unknown): boolean;
2197
- /**
2198
- * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects).
2199
- *
2200
- * ```js
2201
- * import * as ns from './a.js';
2202
- *
2203
- * util.types.isModuleNamespaceObject(ns); // Returns true
2204
- * ```
2205
- * @since v10.0.0
2206
- */
2207
- function isModuleNamespaceObject(value: unknown): boolean;
2208
- /**
2209
- * Returns `true` if the value was returned by the constructor of a [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects).
2210
- *
2211
- * ```js
2212
- * console.log(util.types.isNativeError(new Error())); // true
2213
- * console.log(util.types.isNativeError(new TypeError())); // true
2214
- * console.log(util.types.isNativeError(new RangeError())); // true
2215
- * ```
2216
- *
2217
- * Subclasses of the native error types are also native errors:
2218
- *
2219
- * ```js
2220
- * class MyError extends Error {}
2221
- * console.log(util.types.isNativeError(new MyError())); // true
2222
- * ```
2223
- *
2224
- * A value being `instanceof` a native error class is not equivalent to `isNativeError()` returning `true` for that value. `isNativeError()` returns `true` for errors
2225
- * which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false` for these errors:
2226
- *
2227
- * ```js
2228
- * import vm from 'node:vm';
2229
- * const context = vm.createContext({});
2230
- * const myError = vm.runInContext('new Error()', context);
2231
- * console.log(util.types.isNativeError(myError)); // true
2232
- * console.log(myError instanceof Error); // false
2233
- * ```
2234
- *
2235
- * Conversely, `isNativeError()` returns `false` for all objects which were not
2236
- * returned by the constructor of a native error. That includes values
2237
- * which are `instanceof` native errors:
2238
- *
2239
- * ```js
2240
- * const myError = { __proto__: Error.prototype };
2241
- * console.log(util.types.isNativeError(myError)); // false
2242
- * console.log(myError instanceof Error); // true
2243
- * ```
2244
- * @since v10.0.0
2245
- */
2246
- function isNativeError(object: unknown): object is Error;
2247
- /**
2248
- * Returns `true` if the value is a number object, e.g. created
2249
- * by `new Number()`.
2250
- *
2251
- * ```js
2252
- * util.types.isNumberObject(0); // Returns false
2253
- * util.types.isNumberObject(new Number(0)); // Returns true
2254
- * ```
2255
- * @since v10.0.0
2256
- */
2257
- function isNumberObject(object: unknown): object is Number;
2258
- /**
2259
- * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
2260
- *
2261
- * ```js
2262
- * util.types.isPromise(Promise.resolve(42)); // Returns true
2263
- * ```
2264
- * @since v10.0.0
2265
- */
2266
- function isPromise(object: unknown): object is Promise<unknown>;
2267
- /**
2268
- * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance.
2269
- *
2270
- * ```js
2271
- * const target = {};
2272
- * const proxy = new Proxy(target, {});
2273
- * util.types.isProxy(target); // Returns false
2274
- * util.types.isProxy(proxy); // Returns true
2275
- * ```
2276
- * @since v10.0.0
2277
- */
2278
- function isProxy(object: unknown): boolean;
2279
- /**
2280
- * Returns `true` if the value is a regular expression object.
2281
- *
2282
- * ```js
2283
- * util.types.isRegExp(/abc/); // Returns true
2284
- * util.types.isRegExp(new RegExp('abc')); // Returns true
2285
- * ```
2286
- * @since v10.0.0
2287
- */
2288
- function isRegExp(object: unknown): object is RegExp;
2289
- /**
2290
- * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
2291
- *
2292
- * ```js
2293
- * util.types.isSet(new Set()); // Returns true
2294
- * ```
2295
- * @since v10.0.0
2296
- */
2297
- function isSet<T>(
2298
- object: T | {},
2299
- ): object is T extends ReadonlySet<any> ? (unknown extends T ? never : ReadonlySet<any>) : Set<unknown>;
2300
- /**
2301
- * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
2302
- *
2303
- * ```js
2304
- * const set = new Set();
2305
- * util.types.isSetIterator(set.keys()); // Returns true
2306
- * util.types.isSetIterator(set.values()); // Returns true
2307
- * util.types.isSetIterator(set.entries()); // Returns true
2308
- * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true
2309
- * ```
2310
- * @since v10.0.0
2311
- */
2312
- function isSetIterator(object: unknown): boolean;
2313
- /**
2314
- * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
2315
- * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is
2316
- * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
2317
- *
2318
- * ```js
2319
- * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false
2320
- * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true
2321
- * ```
2322
- * @since v10.0.0
2323
- */
2324
- function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer;
2325
- /**
2326
- * Returns `true` if the value is a string object, e.g. created
2327
- * by `new String()`.
2328
- *
2329
- * ```js
2330
- * util.types.isStringObject('foo'); // Returns false
2331
- * util.types.isStringObject(new String('foo')); // Returns true
2332
- * ```
2333
- * @since v10.0.0
2334
- */
2335
- function isStringObject(object: unknown): object is String;
2336
- /**
2337
- * Returns `true` if the value is a symbol object, created
2338
- * by calling `Object()` on a `Symbol` primitive.
2339
- *
2340
- * ```js
2341
- * const symbol = Symbol('foo');
2342
- * util.types.isSymbolObject(symbol); // Returns false
2343
- * util.types.isSymbolObject(Object(symbol)); // Returns true
2344
- * ```
2345
- * @since v10.0.0
2346
- */
2347
- function isSymbolObject(object: unknown): object is Symbol;
2348
- /**
2349
- * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance.
2350
- *
2351
- * ```js
2352
- * util.types.isTypedArray(new ArrayBuffer()); // Returns false
2353
- * util.types.isTypedArray(new Uint8Array()); // Returns true
2354
- * util.types.isTypedArray(new Float64Array()); // Returns true
2355
- * ```
2356
- *
2357
- * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
2358
- * @since v10.0.0
2359
- */
2360
- function isTypedArray(object: unknown): object is NodeJS.TypedArray;
2361
- /**
2362
- * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance.
2363
- *
2364
- * ```js
2365
- * util.types.isUint8Array(new ArrayBuffer()); // Returns false
2366
- * util.types.isUint8Array(new Uint8Array()); // Returns true
2367
- * util.types.isUint8Array(new Float64Array()); // Returns false
2368
- * ```
2369
- * @since v10.0.0
2370
- */
2371
- function isUint8Array(object: unknown): object is Uint8Array;
2372
- /**
2373
- * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance.
2374
- *
2375
- * ```js
2376
- * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false
2377
- * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true
2378
- * util.types.isUint8ClampedArray(new Float64Array()); // Returns false
2379
- * ```
2380
- * @since v10.0.0
2381
- */
2382
- function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray;
2383
- /**
2384
- * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance.
2385
- *
2386
- * ```js
2387
- * util.types.isUint16Array(new ArrayBuffer()); // Returns false
2388
- * util.types.isUint16Array(new Uint16Array()); // Returns true
2389
- * util.types.isUint16Array(new Float64Array()); // Returns false
2390
- * ```
2391
- * @since v10.0.0
2392
- */
2393
- function isUint16Array(object: unknown): object is Uint16Array;
2394
- /**
2395
- * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance.
2396
- *
2397
- * ```js
2398
- * util.types.isUint32Array(new ArrayBuffer()); // Returns false
2399
- * util.types.isUint32Array(new Uint32Array()); // Returns true
2400
- * util.types.isUint32Array(new Float64Array()); // Returns false
2401
- * ```
2402
- * @since v10.0.0
2403
- */
2404
- function isUint32Array(object: unknown): object is Uint32Array;
2405
- /**
2406
- * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance.
2407
- *
2408
- * ```js
2409
- * util.types.isWeakMap(new WeakMap()); // Returns true
2410
- * ```
2411
- * @since v10.0.0
2412
- */
2413
- function isWeakMap(object: unknown): object is WeakMap<object, unknown>;
2414
- /**
2415
- * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance.
2416
- *
2417
- * ```js
2418
- * util.types.isWeakSet(new WeakSet()); // Returns true
2419
- * ```
2420
- * @since v10.0.0
2421
- */
2422
- function isWeakSet(object: unknown): object is WeakSet<object>;
2423
- /**
2424
- * Returns `true` if `value` is a `KeyObject`, `false` otherwise.
2425
- * @since v16.2.0
2426
- */
2427
- function isKeyObject(object: unknown): object is KeyObject;
2428
- /**
2429
- * Returns `true` if `value` is a `CryptoKey`, `false` otherwise.
2430
- * @since v16.2.0
2431
- */
2432
- function isCryptoKey(object: unknown): object is webcrypto.CryptoKey;
2433
- }
2434
- declare module "node:util" {
2435
- export * from "util";
2436
- }
2437
- declare module "node:util/types" {
2438
- export * from "util/types";
2439
- }