cdk-ecr-deployment 2.5.6 → 2.5.21

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