cloudstructs 0.1.38 → 0.1.42

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 (396) hide show
  1. package/.gitattributes +19 -19
  2. package/.jsii +75 -31
  3. package/lib/codecommit-mirror/index.js +2 -2
  4. package/lib/ecs-service-roller/index.js +2 -2
  5. package/lib/email-receiver/receiver.js +1 -1
  6. package/lib/saml-identity-provider/index.js +2 -2
  7. package/lib/slack-events/index.js +1 -1
  8. package/lib/slack-textract/index.js +1 -1
  9. package/lib/state-machine-cr-provider/index.js +1 -1
  10. package/lib/static-website/index.js +1 -1
  11. package/lib/url-shortener/index.handler.js +2 -1
  12. package/lib/url-shortener/index.js +1 -1
  13. package/node_modules/@sindresorhus/is/dist/index.d.ts +9 -4
  14. package/node_modules/@sindresorhus/is/dist/index.js +9 -0
  15. package/node_modules/@sindresorhus/is/package.json +1 -1
  16. package/node_modules/@sindresorhus/is/readme.md +26 -0
  17. package/node_modules/@slack/logger/node_modules/@types/node/README.md +3 -3
  18. package/node_modules/@slack/logger/node_modules/@types/node/assert/strict.d.ts +0 -1
  19. package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +823 -40
  20. package/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +359 -90
  21. package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +1895 -113
  22. package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +1080 -247
  23. package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +327 -101
  24. package/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +310 -32
  25. package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +2454 -742
  26. package/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +463 -63
  27. package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  28. package/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +303 -36
  29. package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +425 -97
  30. package/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +154 -10
  31. package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +559 -34
  32. package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +812 -269
  33. package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +2408 -874
  34. package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +24 -14
  35. package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +1031 -98
  36. package/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +1579 -459
  37. package/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +363 -12
  38. package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +88 -15
  39. package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +360 -661
  40. package/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +52 -11
  41. package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +557 -142
  42. package/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +236 -26
  43. package/node_modules/@slack/logger/node_modules/@types/node/package.json +23 -25
  44. package/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +9 -5
  45. package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +289 -91
  46. package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +1173 -155
  47. package/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +64 -26
  48. package/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +107 -8
  49. package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +426 -79
  50. package/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +135 -110
  51. package/node_modules/@slack/logger/node_modules/@types/node/stream/consumers.d.ts +24 -0
  52. package/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +15 -44
  53. package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +391 -0
  54. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +998 -225
  55. package/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +57 -1
  56. package/node_modules/@slack/logger/node_modules/@types/node/timers/promises.d.ts +52 -9
  57. package/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +30 -11
  58. package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +447 -225
  59. package/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +107 -11
  60. package/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +157 -23
  61. package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +724 -30
  62. package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +1399 -73
  63. package/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +254 -78
  64. package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +384 -33
  65. package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +92 -24
  66. package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +494 -131
  67. package/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +215 -63
  68. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +3 -3
  69. package/node_modules/@slack/web-api/node_modules/@types/node/assert/strict.d.ts +0 -1
  70. package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +823 -40
  71. package/node_modules/@slack/web-api/node_modules/@types/node/async_hooks.d.ts +359 -90
  72. package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +1895 -113
  73. package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +1080 -247
  74. package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +327 -101
  75. package/node_modules/@slack/web-api/node_modules/@types/node/console.d.ts +310 -32
  76. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +2454 -742
  77. package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +463 -63
  78. package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  79. package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +303 -36
  80. package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +425 -97
  81. package/node_modules/@slack/web-api/node_modules/@types/node/domain.d.ts +154 -10
  82. package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +559 -34
  83. package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +812 -269
  84. package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +2408 -874
  85. package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +24 -14
  86. package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +1031 -98
  87. package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +1579 -459
  88. package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +363 -12
  89. package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +88 -15
  90. package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +360 -661
  91. package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +52 -11
  92. package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +557 -142
  93. package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +236 -26
  94. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +23 -25
  95. package/node_modules/@slack/web-api/node_modules/@types/node/path.d.ts +9 -5
  96. package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +289 -91
  97. package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +1173 -155
  98. package/node_modules/@slack/web-api/node_modules/@types/node/punycode.d.ts +64 -26
  99. package/node_modules/@slack/web-api/node_modules/@types/node/querystring.d.ts +107 -8
  100. package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +426 -79
  101. package/node_modules/@slack/web-api/node_modules/@types/node/repl.d.ts +135 -110
  102. package/node_modules/@slack/web-api/node_modules/@types/node/stream/consumers.d.ts +24 -0
  103. package/node_modules/@slack/web-api/node_modules/@types/node/stream/promises.d.ts +15 -44
  104. package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +391 -0
  105. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +998 -225
  106. package/node_modules/@slack/web-api/node_modules/@types/node/string_decoder.d.ts +57 -1
  107. package/node_modules/@slack/web-api/node_modules/@types/node/timers/promises.d.ts +52 -9
  108. package/node_modules/@slack/web-api/node_modules/@types/node/timers.d.ts +30 -11
  109. package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +447 -225
  110. package/node_modules/@slack/web-api/node_modules/@types/node/trace_events.d.ts +107 -11
  111. package/node_modules/@slack/web-api/node_modules/@types/node/tty.d.ts +157 -23
  112. package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +724 -30
  113. package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +1399 -73
  114. package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +254 -78
  115. package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +384 -33
  116. package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +92 -24
  117. package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +494 -131
  118. package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +215 -63
  119. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +3 -3
  120. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +0 -1
  121. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +823 -40
  122. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +359 -90
  123. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +1895 -113
  124. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +1080 -247
  125. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +327 -101
  126. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +310 -32
  127. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +2454 -742
  128. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +463 -63
  129. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  130. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +303 -36
  131. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +425 -97
  132. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +154 -10
  133. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +559 -34
  134. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +812 -269
  135. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +2408 -874
  136. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +24 -14
  137. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +1031 -98
  138. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +1579 -459
  139. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +363 -12
  140. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +88 -15
  141. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +360 -661
  142. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +52 -11
  143. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +557 -142
  144. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +236 -26
  145. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +23 -25
  146. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +9 -5
  147. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +289 -91
  148. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1173 -155
  149. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +64 -26
  150. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +107 -8
  151. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +426 -79
  152. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +135 -110
  153. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +24 -0
  154. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +15 -44
  155. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +391 -0
  156. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +998 -225
  157. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +57 -1
  158. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +52 -9
  159. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +30 -11
  160. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +447 -225
  161. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +107 -11
  162. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +157 -23
  163. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +724 -30
  164. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1399 -73
  165. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +254 -78
  166. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +384 -33
  167. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +92 -24
  168. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +494 -131
  169. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +215 -63
  170. package/node_modules/@types/is-stream/node_modules/@types/node/README.md +3 -3
  171. package/node_modules/@types/is-stream/node_modules/@types/node/assert/strict.d.ts +0 -1
  172. package/node_modules/@types/is-stream/node_modules/@types/node/assert.d.ts +823 -40
  173. package/node_modules/@types/is-stream/node_modules/@types/node/async_hooks.d.ts +359 -90
  174. package/node_modules/@types/is-stream/node_modules/@types/node/buffer.d.ts +1895 -113
  175. package/node_modules/@types/is-stream/node_modules/@types/node/child_process.d.ts +1080 -247
  176. package/node_modules/@types/is-stream/node_modules/@types/node/cluster.d.ts +327 -101
  177. package/node_modules/@types/is-stream/node_modules/@types/node/console.d.ts +310 -32
  178. package/node_modules/@types/is-stream/node_modules/@types/node/crypto.d.ts +2454 -742
  179. package/node_modules/@types/is-stream/node_modules/@types/node/dgram.d.ts +463 -63
  180. package/node_modules/@types/is-stream/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  181. package/node_modules/@types/is-stream/node_modules/@types/node/dns/promises.d.ts +303 -36
  182. package/node_modules/@types/is-stream/node_modules/@types/node/dns.d.ts +425 -97
  183. package/node_modules/@types/is-stream/node_modules/@types/node/domain.d.ts +154 -10
  184. package/node_modules/@types/is-stream/node_modules/@types/node/events.d.ts +559 -34
  185. package/node_modules/@types/is-stream/node_modules/@types/node/fs/promises.d.ts +812 -269
  186. package/node_modules/@types/is-stream/node_modules/@types/node/fs.d.ts +2408 -874
  187. package/node_modules/@types/is-stream/node_modules/@types/node/globals.d.ts +24 -14
  188. package/node_modules/@types/is-stream/node_modules/@types/node/http.d.ts +1031 -98
  189. package/node_modules/@types/is-stream/node_modules/@types/node/http2.d.ts +1579 -459
  190. package/node_modules/@types/is-stream/node_modules/@types/node/https.d.ts +363 -12
  191. package/node_modules/@types/is-stream/node_modules/@types/node/index.d.ts +88 -15
  192. package/node_modules/@types/is-stream/node_modules/@types/node/inspector.d.ts +360 -661
  193. package/node_modules/@types/is-stream/node_modules/@types/node/module.d.ts +52 -11
  194. package/node_modules/@types/is-stream/node_modules/@types/node/net.d.ts +557 -142
  195. package/node_modules/@types/is-stream/node_modules/@types/node/os.d.ts +236 -26
  196. package/node_modules/@types/is-stream/node_modules/@types/node/package.json +23 -25
  197. package/node_modules/@types/is-stream/node_modules/@types/node/path.d.ts +9 -5
  198. package/node_modules/@types/is-stream/node_modules/@types/node/perf_hooks.d.ts +289 -91
  199. package/node_modules/@types/is-stream/node_modules/@types/node/process.d.ts +1173 -155
  200. package/node_modules/@types/is-stream/node_modules/@types/node/punycode.d.ts +64 -26
  201. package/node_modules/@types/is-stream/node_modules/@types/node/querystring.d.ts +107 -8
  202. package/node_modules/@types/is-stream/node_modules/@types/node/readline.d.ts +426 -79
  203. package/node_modules/@types/is-stream/node_modules/@types/node/repl.d.ts +135 -110
  204. package/node_modules/@types/is-stream/node_modules/@types/node/stream/consumers.d.ts +24 -0
  205. package/node_modules/@types/is-stream/node_modules/@types/node/stream/promises.d.ts +15 -44
  206. package/node_modules/@types/is-stream/node_modules/@types/node/stream/web.d.ts +391 -0
  207. package/node_modules/@types/is-stream/node_modules/@types/node/stream.d.ts +998 -225
  208. package/node_modules/@types/is-stream/node_modules/@types/node/string_decoder.d.ts +57 -1
  209. package/node_modules/@types/is-stream/node_modules/@types/node/timers/promises.d.ts +52 -9
  210. package/node_modules/@types/is-stream/node_modules/@types/node/timers.d.ts +30 -11
  211. package/node_modules/@types/is-stream/node_modules/@types/node/tls.d.ts +447 -225
  212. package/node_modules/@types/is-stream/node_modules/@types/node/trace_events.d.ts +107 -11
  213. package/node_modules/@types/is-stream/node_modules/@types/node/tty.d.ts +157 -23
  214. package/node_modules/@types/is-stream/node_modules/@types/node/url.d.ts +724 -30
  215. package/node_modules/@types/is-stream/node_modules/@types/node/util.d.ts +1399 -73
  216. package/node_modules/@types/is-stream/node_modules/@types/node/v8.d.ts +254 -78
  217. package/node_modules/@types/is-stream/node_modules/@types/node/vm.d.ts +384 -33
  218. package/node_modules/@types/is-stream/node_modules/@types/node/wasi.d.ts +92 -24
  219. package/node_modules/@types/is-stream/node_modules/@types/node/worker_threads.d.ts +494 -131
  220. package/node_modules/@types/is-stream/node_modules/@types/node/zlib.d.ts +215 -63
  221. package/node_modules/@types/keyv/README.md +1 -1
  222. package/node_modules/@types/keyv/index.d.ts +10 -3
  223. package/node_modules/@types/keyv/node_modules/@types/node/README.md +3 -3
  224. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +0 -1
  225. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +823 -40
  226. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +359 -90
  227. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +1895 -113
  228. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1080 -247
  229. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +327 -101
  230. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +310 -32
  231. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +2454 -742
  232. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +463 -63
  233. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  234. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +303 -36
  235. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +425 -97
  236. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +154 -10
  237. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +559 -34
  238. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +812 -269
  239. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +2408 -874
  240. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +24 -14
  241. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1031 -98
  242. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +1579 -459
  243. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +363 -12
  244. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +88 -15
  245. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +360 -661
  246. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +52 -11
  247. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +557 -142
  248. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +236 -26
  249. package/node_modules/@types/keyv/node_modules/@types/node/package.json +23 -25
  250. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +9 -5
  251. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +289 -91
  252. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1173 -155
  253. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +64 -26
  254. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +107 -8
  255. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +426 -79
  256. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +135 -110
  257. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +24 -0
  258. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +15 -44
  259. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +391 -0
  260. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +998 -225
  261. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +57 -1
  262. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +52 -9
  263. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +30 -11
  264. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +447 -225
  265. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +107 -11
  266. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +157 -23
  267. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +724 -30
  268. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1399 -73
  269. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +254 -78
  270. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +384 -33
  271. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +92 -24
  272. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +494 -131
  273. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +215 -63
  274. package/node_modules/@types/keyv/package.json +3 -3
  275. package/node_modules/@types/responselike/node_modules/@types/node/README.md +3 -3
  276. package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +0 -1
  277. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +823 -40
  278. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +359 -90
  279. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +1895 -113
  280. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +1080 -247
  281. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +327 -101
  282. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +310 -32
  283. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +2454 -742
  284. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +463 -63
  285. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  286. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +303 -36
  287. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +425 -97
  288. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +154 -10
  289. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +559 -34
  290. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +812 -269
  291. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +2408 -874
  292. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +24 -14
  293. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +1031 -98
  294. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +1579 -459
  295. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +363 -12
  296. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +88 -15
  297. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +360 -661
  298. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +52 -11
  299. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +557 -142
  300. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +236 -26
  301. package/node_modules/@types/responselike/node_modules/@types/node/package.json +23 -25
  302. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +9 -5
  303. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +289 -91
  304. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1173 -155
  305. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +64 -26
  306. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +107 -8
  307. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +426 -79
  308. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +135 -110
  309. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +24 -0
  310. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +15 -44
  311. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +391 -0
  312. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +998 -225
  313. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +57 -1
  314. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +52 -9
  315. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +30 -11
  316. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +447 -225
  317. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +107 -11
  318. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +157 -23
  319. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +724 -30
  320. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1399 -73
  321. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +254 -78
  322. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +384 -33
  323. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +92 -24
  324. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +494 -131
  325. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +215 -63
  326. package/node_modules/axios/CHANGELOG.md +98 -8
  327. package/node_modules/axios/README.md +74 -6
  328. package/node_modules/axios/SECURITY.md +5 -0
  329. package/node_modules/axios/dist/axios.js +2028 -1591
  330. package/node_modules/axios/dist/axios.map +1 -1
  331. package/node_modules/axios/dist/axios.min.js +2 -2
  332. package/node_modules/axios/dist/axios.min.map +1 -1
  333. package/node_modules/axios/index.d.ts +8 -1
  334. package/node_modules/axios/lib/adapters/http.js +33 -5
  335. package/node_modules/axios/lib/adapters/xhr.js +35 -25
  336. package/node_modules/axios/lib/core/Axios.js +60 -7
  337. package/node_modules/axios/lib/core/InterceptorManager.js +4 -2
  338. package/node_modules/axios/lib/core/README.md +1 -0
  339. package/node_modules/axios/lib/core/dispatchRequest.js +6 -3
  340. package/node_modules/axios/lib/core/transformData.js +3 -1
  341. package/node_modules/axios/lib/defaults.js +43 -7
  342. package/node_modules/axios/lib/helpers/validator.js +105 -0
  343. package/node_modules/axios/lib/utils.js +1 -3
  344. package/node_modules/axios/package.json +19 -21
  345. package/node_modules/follow-redirects/debug.js +2 -1
  346. package/node_modules/follow-redirects/index.js +59 -21
  347. package/node_modules/follow-redirects/package.json +1 -1
  348. package/node_modules/got/dist/source/as-promise/parse-body.d.ts +1 -1
  349. package/node_modules/got/dist/source/as-promise/types.js +2 -0
  350. package/node_modules/got/dist/source/core/index.d.ts +1 -1
  351. package/node_modules/got/dist/source/core/index.js +9 -3
  352. package/node_modules/got/dist/source/types.d.ts +14 -12
  353. package/node_modules/got/package.json +2 -2
  354. package/node_modules/got/readme.md +11 -10
  355. package/node_modules/keyv/LICENSE +1 -1
  356. package/node_modules/keyv/README.md +12 -10
  357. package/node_modules/keyv/package.json +17 -12
  358. package/node_modules/keyv/src/index.js +14 -16
  359. package/node_modules/mime-db/HISTORY.md +19 -0
  360. package/node_modules/mime-db/db.json +93 -1
  361. package/node_modules/mime-db/package.json +7 -7
  362. package/node_modules/mime-types/HISTORY.md +20 -3
  363. package/node_modules/mime-types/package.json +7 -7
  364. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/index.d.ts +0 -0
  365. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/index.js +0 -0
  366. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/license +0 -0
  367. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/package.json +0 -0
  368. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/readme.md +0 -0
  369. package/node_modules/resolve-alpn/README.md +8 -1
  370. package/node_modules/resolve-alpn/index.js +14 -4
  371. package/node_modules/resolve-alpn/package.json +1 -1
  372. package/package.json +33 -34
  373. package/node_modules/@slack/logger/node_modules/@types/node/base.d.ts +0 -19
  374. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  375. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  376. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  377. package/node_modules/@slack/web-api/node_modules/@types/node/base.d.ts +0 -19
  378. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  379. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  380. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  381. package/node_modules/@types/cacheable-request/node_modules/@types/node/base.d.ts +0 -19
  382. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  383. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  384. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  385. package/node_modules/@types/is-stream/node_modules/@types/node/base.d.ts +0 -19
  386. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  387. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  388. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  389. package/node_modules/@types/keyv/node_modules/@types/node/base.d.ts +0 -19
  390. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  391. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  392. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  393. package/node_modules/@types/responselike/node_modules/@types/node/base.d.ts +0 -19
  394. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  395. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  396. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/index.d.ts +0 -7
@@ -1,6 +1,15 @@
1
+ /**
2
+ * The `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('util');
8
+ * ```
9
+ * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/util.js)
10
+ */
1
11
  declare module 'util' {
2
12
  import * as types from 'node:util/types';
3
-
4
13
  export interface InspectOptions {
5
14
  /**
6
15
  * If set to `true`, getters are going to be
@@ -41,67 +50,822 @@ declare module 'util' {
41
50
  compact?: boolean | number | undefined;
42
51
  sorted?: boolean | ((a: string, b: string) => number) | undefined;
43
52
  }
44
-
45
53
  export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module';
46
54
  export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string;
47
55
  export interface InspectOptionsStylized extends InspectOptions {
48
56
  stylize(text: string, styleType: Style): string;
49
57
  }
58
+ /**
59
+ * The `util.format()` method returns a formatted string using the first argument
60
+ * as a `printf`\-like format string which can contain zero or more format
61
+ * specifiers. Each specifier is replaced with the converted value from the
62
+ * corresponding argument. Supported specifiers are:
63
+ *
64
+ * If a specifier does not have a corresponding argument, it is not replaced:
65
+ *
66
+ * ```js
67
+ * util.format('%s:%s', 'foo');
68
+ * // Returns: 'foo:%s'
69
+ * ```
70
+ *
71
+ * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`.
72
+ *
73
+ * If there are more arguments passed to the `util.format()` method than the
74
+ * number of specifiers, the extra arguments are concatenated to the returned
75
+ * string, separated by spaces:
76
+ *
77
+ * ```js
78
+ * util.format('%s:%s', 'foo', 'bar', 'baz');
79
+ * // Returns: 'foo:bar baz'
80
+ * ```
81
+ *
82
+ * 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:
83
+ *
84
+ * ```js
85
+ * util.format(1, 2, 3);
86
+ * // Returns: '1 2 3'
87
+ * ```
88
+ *
89
+ * If only one argument is passed to `util.format()`, it is returned as it is
90
+ * without any formatting:
91
+ *
92
+ * ```js
93
+ * util.format('%% %s');
94
+ * // Returns: '%% %s'
95
+ * ```
96
+ *
97
+ * `util.format()` is a synchronous method that is intended as a debugging tool.
98
+ * Some input values can have a significant performance overhead that can block the
99
+ * event loop. Use this function with care and never in a hot code path.
100
+ * @since v0.5.3
101
+ * @param format A `printf`-like format string.
102
+ */
50
103
  export function format(format?: any, ...param: any[]): string;
104
+ /**
105
+ * This function is identical to {@link format}, except in that it takes
106
+ * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}.
107
+ *
108
+ * ```js
109
+ * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 });
110
+ * // Returns 'See object { foo: 42 }', where `42` is colored as a number
111
+ * // when printed to a terminal.
112
+ * ```
113
+ * @since v10.0.0
114
+ */
51
115
  export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
116
+ /**
117
+ * Returns the string name for a numeric error code that comes from a Node.js API.
118
+ * The mapping between error codes and error names is platform-dependent.
119
+ * See `Common System Errors` for the names of common errors.
120
+ *
121
+ * ```js
122
+ * fs.access('file/that/does/not/exist', (err) => {
123
+ * const name = util.getSystemErrorName(err.errno);
124
+ * console.error(name); // ENOENT
125
+ * });
126
+ * ```
127
+ * @since v9.7.0
128
+ */
129
+ export function getSystemErrorName(err: number): string;
130
+ /**
131
+ * Returns a Map of all system error codes available from the Node.js API.
132
+ * The mapping between error codes and error names is platform-dependent.
133
+ * See `Common System Errors` for the names of common errors.
134
+ *
135
+ * ```js
136
+ * fs.access('file/that/does/not/exist', (err) => {
137
+ * const errorMap = util.getSystemErrorMap();
138
+ * const name = errorMap.get(err.errno);
139
+ * console.error(name); // ENOENT
140
+ * });
141
+ * ```
142
+ * @since v16.0.0
143
+ */
52
144
  export function getSystemErrorMap(): Map<number, [string, string]>;
53
-
54
- /** @deprecated since v0.11.3 - use a third party module instead. */
145
+ /**
146
+ * The `util.log()` method prints the given `string` to `stdout` with an included
147
+ * timestamp.
148
+ *
149
+ * ```js
150
+ * const util = require('util');
151
+ *
152
+ * util.log('Timestamped message.');
153
+ * ```
154
+ * @since v0.3.0
155
+ * @deprecated Since v6.0.0 - Use a third party module instead.
156
+ */
55
157
  export function log(string: string): void;
158
+ /**
159
+ * Returns the `string` after replacing any surrogate code points
160
+ * (or equivalently, any unpaired surrogate code units) with the
161
+ * Unicode "replacement character" U+FFFD.
162
+ * @since v16.8.0
163
+ */
164
+ export function toUSVString(string: string): string;
165
+ /**
166
+ * The `util.inspect()` method returns a string representation of `object` that is
167
+ * intended for debugging. The output of `util.inspect` may change at any time
168
+ * and should not be depended upon programmatically. Additional `options` may be
169
+ * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make
170
+ * an identifiable tag for an inspected value.
171
+ *
172
+ * ```js
173
+ * class Foo {
174
+ * get [Symbol.toStringTag]() {
175
+ * return 'bar';
176
+ * }
177
+ * }
178
+ *
179
+ * class Bar {}
180
+ *
181
+ * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } });
182
+ *
183
+ * util.inspect(new Foo()); // 'Foo [bar] {}'
184
+ * util.inspect(new Bar()); // 'Bar {}'
185
+ * util.inspect(baz); // '[foo] {}'
186
+ * ```
187
+ *
188
+ * Circular references point to their anchor by using a reference index:
189
+ *
190
+ * ```js
191
+ * const { inspect } = require('util');
192
+ *
193
+ * const obj = {};
194
+ * obj.a = [obj];
195
+ * obj.b = {};
196
+ * obj.b.inner = obj.b;
197
+ * obj.b.obj = obj;
198
+ *
199
+ * console.log(inspect(obj));
200
+ * // <ref *1> {
201
+ * // a: [ [Circular *1] ],
202
+ * // b: <ref *2> { inner: [Circular *2], obj: [Circular *1] }
203
+ * // }
204
+ * ```
205
+ *
206
+ * The following example inspects all properties of the `util` object:
207
+ *
208
+ * ```js
209
+ * const util = require('util');
210
+ *
211
+ * console.log(util.inspect(util, { showHidden: true, depth: null }));
212
+ * ```
213
+ *
214
+ * The following example highlights the effect of the `compact` option:
215
+ *
216
+ * ```js
217
+ * const util = require('util');
218
+ *
219
+ * const o = {
220
+ * a: [1, 2, [[
221
+ * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' +
222
+ * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.',
223
+ * 'test',
224
+ * 'foo']], 4],
225
+ * b: new Map([['za', 1], ['zb', 'test']])
226
+ * };
227
+ * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 }));
228
+ *
229
+ * // { a:
230
+ * // [ 1,
231
+ * // 2,
232
+ * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line
233
+ * // 'test',
234
+ * // 'foo' ] ],
235
+ * // 4 ],
236
+ * // b: Map(2) { 'za' => 1, 'zb' => 'test' } }
237
+ *
238
+ * // Setting `compact` to false or an integer creates more reader friendly output.
239
+ * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 }));
240
+ *
241
+ * // {
242
+ * // a: [
243
+ * // 1,
244
+ * // 2,
245
+ * // [
246
+ * // [
247
+ * // 'Lorem ipsum dolor sit amet,\n' +
248
+ * // 'consectetur adipiscing elit, sed do eiusmod \n' +
249
+ * // 'tempor incididunt ut labore et dolore magna aliqua.',
250
+ * // 'test',
251
+ * // 'foo'
252
+ * // ]
253
+ * // ],
254
+ * // 4
255
+ * // ],
256
+ * // b: Map(2) {
257
+ * // 'za' => 1,
258
+ * // 'zb' => 'test'
259
+ * // }
260
+ * // }
261
+ *
262
+ * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a
263
+ * // single line.
264
+ * ```
265
+ *
266
+ * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and
267
+ * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be
268
+ * inspected. If there are more entries than `maxArrayLength`, there is no
269
+ * 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
270
+ * result in different output. Furthermore, entries
271
+ * with no remaining strong references may be garbage collected at any time.
272
+ *
273
+ * ```js
274
+ * const { inspect } = require('util');
275
+ *
276
+ * const obj = { a: 1 };
277
+ * const obj2 = { b: 2 };
278
+ * const weakSet = new WeakSet([obj, obj2]);
279
+ *
280
+ * console.log(inspect(weakSet, { showHidden: true }));
281
+ * // WeakSet { { a: 1 }, { b: 2 } }
282
+ * ```
283
+ *
284
+ * The `sorted` option ensures that an object's property insertion order does not
285
+ * impact the result of `util.inspect()`.
286
+ *
287
+ * ```js
288
+ * const { inspect } = require('util');
289
+ * const assert = require('assert');
290
+ *
291
+ * const o1 = {
292
+ * b: [2, 3, 1],
293
+ * a: '`a` comes before `b`',
294
+ * c: new Set([2, 3, 1])
295
+ * };
296
+ * console.log(inspect(o1, { sorted: true }));
297
+ * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } }
298
+ * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));
299
+ * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' }
300
+ *
301
+ * const o2 = {
302
+ * c: new Set([2, 1, 3]),
303
+ * a: '`a` comes before `b`',
304
+ * b: [2, 3, 1]
305
+ * };
306
+ * assert.strict.equal(
307
+ * inspect(o1, { sorted: true }),
308
+ * inspect(o2, { sorted: true })
309
+ * );
310
+ * ```
311
+ *
312
+ * `util.inspect()` is a synchronous method intended for debugging. Its maximum
313
+ * output length is approximately 128 MB. Inputs that result in longer output will
314
+ * be truncated.
315
+ * @since v0.3.0
316
+ * @param object Any JavaScript primitive or `Object`.
317
+ * @return The representation of `object`.
318
+ */
56
319
  export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
57
320
  export function inspect(object: any, options: InspectOptions): string;
58
321
  export namespace inspect {
59
322
  let colors: NodeJS.Dict<[number, number]>;
60
323
  let styles: {
61
- [K in Style]: string
324
+ [K in Style]: string;
62
325
  };
63
326
  let defaultOptions: InspectOptions;
64
327
  /**
65
328
  * Allows changing inspect settings from the repl.
66
329
  */
67
330
  let replDefaults: InspectOptions;
331
+ /**
332
+ * That can be used to declare custom inspect functions.
333
+ */
68
334
  const custom: unique symbol;
69
335
  }
70
- /** @deprecated since v4.0.0 - use `Array.isArray()` instead. */
336
+ /**
337
+ * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray).
338
+ *
339
+ * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`.
340
+ *
341
+ * ```js
342
+ * const util = require('util');
343
+ *
344
+ * util.isArray([]);
345
+ * // Returns: true
346
+ * util.isArray(new Array());
347
+ * // Returns: true
348
+ * util.isArray({});
349
+ * // Returns: false
350
+ * ```
351
+ * @since v0.6.0
352
+ * @deprecated Since v4.0.0 - Use `isArray` instead.
353
+ */
71
354
  export function isArray(object: unknown): object is unknown[];
72
- /** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */
355
+ /**
356
+ * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`.
357
+ *
358
+ * ```js
359
+ * const util = require('util');
360
+ *
361
+ * util.isRegExp(/some regexp/);
362
+ * // Returns: true
363
+ * util.isRegExp(new RegExp('another regexp'));
364
+ * // Returns: true
365
+ * util.isRegExp({});
366
+ * // Returns: false
367
+ * ```
368
+ * @since v0.6.0
369
+ * @deprecated Since v4.0.0 - Deprecated
370
+ */
73
371
  export function isRegExp(object: unknown): object is RegExp;
74
- /** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */
372
+ /**
373
+ * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`.
374
+ *
375
+ * ```js
376
+ * const util = require('util');
377
+ *
378
+ * util.isDate(new Date());
379
+ * // Returns: true
380
+ * util.isDate(Date());
381
+ * // false (without 'new' returns a String)
382
+ * util.isDate({});
383
+ * // Returns: false
384
+ * ```
385
+ * @since v0.6.0
386
+ * @deprecated Since v4.0.0 - Use {@link types.isDate} instead.
387
+ */
75
388
  export function isDate(object: unknown): object is Date;
76
- /** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */
389
+ /**
390
+ * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`.
391
+ *
392
+ * ```js
393
+ * const util = require('util');
394
+ *
395
+ * util.isError(new Error());
396
+ * // Returns: true
397
+ * util.isError(new TypeError());
398
+ * // Returns: true
399
+ * util.isError({ name: 'Error', message: 'an error occurred' });
400
+ * // Returns: false
401
+ * ```
402
+ *
403
+ * This method relies on `Object.prototype.toString()` behavior. It is
404
+ * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`.
405
+ *
406
+ * ```js
407
+ * const util = require('util');
408
+ * const obj = { name: 'Error', message: 'an error occurred' };
409
+ *
410
+ * util.isError(obj);
411
+ * // Returns: false
412
+ * obj[Symbol.toStringTag] = 'Error';
413
+ * util.isError(obj);
414
+ * // Returns: true
415
+ * ```
416
+ * @since v0.6.0
417
+ * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead.
418
+ */
77
419
  export function isError(object: unknown): object is Error;
420
+ /**
421
+ * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and`extends` keywords to get language level inheritance support. Also note
422
+ * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179).
423
+ *
424
+ * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The
425
+ * prototype of `constructor` will be set to a new object created from`superConstructor`.
426
+ *
427
+ * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`.
428
+ * As an additional convenience, `superConstructor` will be accessible
429
+ * through the `constructor.super_` property.
430
+ *
431
+ * ```js
432
+ * const util = require('util');
433
+ * const EventEmitter = require('events');
434
+ *
435
+ * function MyStream() {
436
+ * EventEmitter.call(this);
437
+ * }
438
+ *
439
+ * util.inherits(MyStream, EventEmitter);
440
+ *
441
+ * MyStream.prototype.write = function(data) {
442
+ * this.emit('data', data);
443
+ * };
444
+ *
445
+ * const stream = new MyStream();
446
+ *
447
+ * console.log(stream instanceof EventEmitter); // true
448
+ * console.log(MyStream.super_ === EventEmitter); // true
449
+ *
450
+ * stream.on('data', (data) => {
451
+ * console.log(`Received data: "${data}"`);
452
+ * });
453
+ * stream.write('It works!'); // Received data: "It works!"
454
+ * ```
455
+ *
456
+ * ES6 example using `class` and `extends`:
457
+ *
458
+ * ```js
459
+ * const EventEmitter = require('events');
460
+ *
461
+ * class MyStream extends EventEmitter {
462
+ * write(data) {
463
+ * this.emit('data', data);
464
+ * }
465
+ * }
466
+ *
467
+ * const stream = new MyStream();
468
+ *
469
+ * stream.on('data', (data) => {
470
+ * console.log(`Received data: "${data}"`);
471
+ * });
472
+ * stream.write('With ES6');
473
+ * ```
474
+ * @since v0.3.0
475
+ * @deprecated Legacy: Use ES2015 class syntax and `extends` keyword instead.
476
+ */
78
477
  export function inherits(constructor: unknown, superConstructor: unknown): void;
79
- export function debuglog(key: string): (msg: string, ...param: unknown[]) => void;
80
- /** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */
478
+ export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void;
479
+ export interface DebugLogger extends DebugLoggerFunction {
480
+ enabled: boolean;
481
+ }
482
+ /**
483
+ * The `util.debuglog()` method is used to create a function that conditionally
484
+ * 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
485
+ * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op.
486
+ *
487
+ * ```js
488
+ * const util = require('util');
489
+ * const debuglog = util.debuglog('foo');
490
+ *
491
+ * debuglog('hello from foo [%d]', 123);
492
+ * ```
493
+ *
494
+ * If this program is run with `NODE_DEBUG=foo` in the environment, then
495
+ * it will output something like:
496
+ *
497
+ * ```console
498
+ * FOO 3245: hello from foo [123]
499
+ * ```
500
+ *
501
+ * where `3245` is the process id. If it is not run with that
502
+ * environment variable set, then it will not print anything.
503
+ *
504
+ * The `section` supports wildcard also:
505
+ *
506
+ * ```js
507
+ * const util = require('util');
508
+ * const debuglog = util.debuglog('foo-bar');
509
+ *
510
+ * debuglog('hi there, it\'s foo-bar [%d]', 2333);
511
+ * ```
512
+ *
513
+ * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output
514
+ * something like:
515
+ *
516
+ * ```console
517
+ * FOO-BAR 3257: hi there, it's foo-bar [2333]
518
+ * ```
519
+ *
520
+ * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`.
521
+ *
522
+ * The optional `callback` argument can be used to replace the logging function
523
+ * with a different function that doesn't have any initialization or
524
+ * unnecessary wrapping.
525
+ *
526
+ * ```js
527
+ * const util = require('util');
528
+ * let debuglog = util.debuglog('internals', (debug) => {
529
+ * // Replace with a logging function that optimizes out
530
+ * // testing if the section is enabled
531
+ * debuglog = debug;
532
+ * });
533
+ * ```
534
+ * @since v0.11.3
535
+ * @param section A string identifying the portion of the application for which the `debuglog` function is being created.
536
+ * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function.
537
+ * @return The logging function
538
+ */
539
+ export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
540
+ export const debug: typeof debuglog;
541
+ /**
542
+ * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`.
543
+ *
544
+ * ```js
545
+ * const util = require('util');
546
+ *
547
+ * util.isBoolean(1);
548
+ * // Returns: false
549
+ * util.isBoolean(0);
550
+ * // Returns: false
551
+ * util.isBoolean(false);
552
+ * // Returns: true
553
+ * ```
554
+ * @since v0.11.5
555
+ * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead.
556
+ */
81
557
  export function isBoolean(object: unknown): object is boolean;
82
- /** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */
558
+ /**
559
+ * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`.
560
+ *
561
+ * ```js
562
+ * const util = require('util');
563
+ *
564
+ * util.isBuffer({ length: 0 });
565
+ * // Returns: false
566
+ * util.isBuffer([]);
567
+ * // Returns: false
568
+ * util.isBuffer(Buffer.from('hello world'));
569
+ * // Returns: true
570
+ * ```
571
+ * @since v0.11.5
572
+ * @deprecated Since v4.0.0 - Use `isBuffer` instead.
573
+ */
83
574
  export function isBuffer(object: unknown): object is Buffer;
84
- /** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */
575
+ /**
576
+ * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`.
577
+ *
578
+ * ```js
579
+ * const util = require('util');
580
+ *
581
+ * function Foo() {}
582
+ * const Bar = () => {};
583
+ *
584
+ * util.isFunction({});
585
+ * // Returns: false
586
+ * util.isFunction(Foo);
587
+ * // Returns: true
588
+ * util.isFunction(Bar);
589
+ * // Returns: true
590
+ * ```
591
+ * @since v0.11.5
592
+ * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead.
593
+ */
85
594
  export function isFunction(object: unknown): boolean;
86
- /** @deprecated since v4.0.0 - use `value === null` instead. */
595
+ /**
596
+ * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`.
597
+ *
598
+ * ```js
599
+ * const util = require('util');
600
+ *
601
+ * util.isNull(0);
602
+ * // Returns: false
603
+ * util.isNull(undefined);
604
+ * // Returns: false
605
+ * util.isNull(null);
606
+ * // Returns: true
607
+ * ```
608
+ * @since v0.11.5
609
+ * @deprecated Since v4.0.0 - Use `value === null` instead.
610
+ */
87
611
  export function isNull(object: unknown): object is null;
88
- /** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */
612
+ /**
613
+ * Returns `true` if the given `object` is `null` or `undefined`. Otherwise,
614
+ * returns `false`.
615
+ *
616
+ * ```js
617
+ * const util = require('util');
618
+ *
619
+ * util.isNullOrUndefined(0);
620
+ * // Returns: false
621
+ * util.isNullOrUndefined(undefined);
622
+ * // Returns: true
623
+ * util.isNullOrUndefined(null);
624
+ * // Returns: true
625
+ * ```
626
+ * @since v0.11.5
627
+ * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead.
628
+ */
89
629
  export function isNullOrUndefined(object: unknown): object is null | undefined;
90
- /** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */
630
+ /**
631
+ * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`.
632
+ *
633
+ * ```js
634
+ * const util = require('util');
635
+ *
636
+ * util.isNumber(false);
637
+ * // Returns: false
638
+ * util.isNumber(Infinity);
639
+ * // Returns: true
640
+ * util.isNumber(0);
641
+ * // Returns: true
642
+ * util.isNumber(NaN);
643
+ * // Returns: true
644
+ * ```
645
+ * @since v0.11.5
646
+ * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead.
647
+ */
91
648
  export function isNumber(object: unknown): object is number;
92
- /** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */
649
+ /**
650
+ * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript).
651
+ * Otherwise, returns `false`.
652
+ *
653
+ * ```js
654
+ * const util = require('util');
655
+ *
656
+ * util.isObject(5);
657
+ * // Returns: false
658
+ * util.isObject(null);
659
+ * // Returns: false
660
+ * util.isObject({});
661
+ * // Returns: true
662
+ * util.isObject(() => {});
663
+ * // Returns: false
664
+ * ```
665
+ * @since v0.11.5
666
+ * @deprecated Since v4.0.0 - Deprecated: Use `value !== null && typeof value === 'object'` instead.
667
+ */
93
668
  export function isObject(object: unknown): boolean;
94
- /** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */
669
+ /**
670
+ * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`.
671
+ *
672
+ * ```js
673
+ * const util = require('util');
674
+ *
675
+ * util.isPrimitive(5);
676
+ * // Returns: true
677
+ * util.isPrimitive('foo');
678
+ * // Returns: true
679
+ * util.isPrimitive(false);
680
+ * // Returns: true
681
+ * util.isPrimitive(null);
682
+ * // Returns: true
683
+ * util.isPrimitive(undefined);
684
+ * // Returns: true
685
+ * util.isPrimitive({});
686
+ * // Returns: false
687
+ * util.isPrimitive(() => {});
688
+ * // Returns: false
689
+ * util.isPrimitive(/^$/);
690
+ * // Returns: false
691
+ * util.isPrimitive(new Date());
692
+ * // Returns: false
693
+ * ```
694
+ * @since v0.11.5
695
+ * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead.
696
+ */
95
697
  export function isPrimitive(object: unknown): boolean;
96
- /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */
698
+ /**
699
+ * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`.
700
+ *
701
+ * ```js
702
+ * const util = require('util');
703
+ *
704
+ * util.isString('');
705
+ * // Returns: true
706
+ * util.isString('foo');
707
+ * // Returns: true
708
+ * util.isString(String('foo'));
709
+ * // Returns: true
710
+ * util.isString(5);
711
+ * // Returns: false
712
+ * ```
713
+ * @since v0.11.5
714
+ * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead.
715
+ */
97
716
  export function isString(object: unknown): object is string;
98
- /** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */
717
+ /**
718
+ * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`.
719
+ *
720
+ * ```js
721
+ * const util = require('util');
722
+ *
723
+ * util.isSymbol(5);
724
+ * // Returns: false
725
+ * util.isSymbol('foo');
726
+ * // Returns: false
727
+ * util.isSymbol(Symbol('foo'));
728
+ * // Returns: true
729
+ * ```
730
+ * @since v0.11.5
731
+ * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead.
732
+ */
99
733
  export function isSymbol(object: unknown): object is symbol;
100
- /** @deprecated since v4.0.0 - use `value === undefined` instead. */
734
+ /**
735
+ * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`.
736
+ *
737
+ * ```js
738
+ * const util = require('util');
739
+ *
740
+ * const foo = undefined;
741
+ * util.isUndefined(5);
742
+ * // Returns: false
743
+ * util.isUndefined(foo);
744
+ * // Returns: true
745
+ * util.isUndefined(null);
746
+ * // Returns: false
747
+ * ```
748
+ * @since v0.11.5
749
+ * @deprecated Since v4.0.0 - Use `value === undefined` instead.
750
+ */
101
751
  export function isUndefined(object: unknown): object is undefined;
102
- export function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
752
+ /**
753
+ * The `util.deprecate()` method wraps `fn` (which may be a function or class) in
754
+ * such a way that it is marked as deprecated.
755
+ *
756
+ * ```js
757
+ * const util = require('util');
758
+ *
759
+ * exports.obsoleteFunction = util.deprecate(() => {
760
+ * // Do something here.
761
+ * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.');
762
+ * ```
763
+ *
764
+ * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will
765
+ * be emitted and printed to `stderr` the first time the returned function is
766
+ * called. After the warning is emitted, the wrapped function is called without
767
+ * emitting a warning.
768
+ *
769
+ * If the same optional `code` is supplied in multiple calls to `util.deprecate()`,
770
+ * the warning will be emitted only once for that `code`.
771
+ *
772
+ * ```js
773
+ * const util = require('util');
774
+ *
775
+ * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001');
776
+ * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001');
777
+ * fn1(); // Emits a deprecation warning with code DEP0001
778
+ * fn2(); // Does not emit a deprecation warning because it has the same code
779
+ * ```
780
+ *
781
+ * If either the `--no-deprecation` or `--no-warnings` command-line flags are
782
+ * used, or if the `process.noDeprecation` property is set to `true`_prior_ to
783
+ * the first deprecation warning, the `util.deprecate()` method does nothing.
784
+ *
785
+ * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set,
786
+ * or the `process.traceDeprecation` property is set to `true`, a warning and a
787
+ * stack trace are printed to `stderr` the first time the deprecated function is
788
+ * called.
789
+ *
790
+ * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be
791
+ * thrown when the deprecated function is called.
792
+ *
793
+ * The `--throw-deprecation` command-line flag and `process.throwDeprecation`property take precedence over `--trace-deprecation` and`process.traceDeprecation`.
794
+ * @since v0.8.0
795
+ * @param fn The function that is being deprecated.
796
+ * @param msg A warning message to display when the deprecated function is invoked.
797
+ * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes.
798
+ * @return The deprecated function wrapped to emit a warning.
799
+ */
800
+ export function deprecate<T extends Function>(fn: T, msg: string, code?: string): T;
801
+ /**
802
+ * Returns `true` if there is deep strict equality between `val1` and `val2`.
803
+ * Otherwise, returns `false`.
804
+ *
805
+ * See `assert.deepStrictEqual()` for more information about deep strict
806
+ * equality.
807
+ * @since v9.0.0
808
+ */
103
809
  export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean;
104
-
810
+ /**
811
+ * Returns `str` with any ANSI escape codes removed.
812
+ *
813
+ * ```js
814
+ * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m'));
815
+ * // Prints "value"
816
+ * ```
817
+ * @since v16.11.0
818
+ */
819
+ export function stripVTControlCharacters(str: string): string;
820
+ /**
821
+ * Takes an `async` function (or a function that returns a `Promise`) and returns a
822
+ * function following the error-first callback style, i.e. taking
823
+ * an `(err, value) => ...` callback as the last argument. In the callback, the
824
+ * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value.
825
+ *
826
+ * ```js
827
+ * const util = require('util');
828
+ *
829
+ * async function fn() {
830
+ * return 'hello world';
831
+ * }
832
+ * const callbackFunction = util.callbackify(fn);
833
+ *
834
+ * callbackFunction((err, ret) => {
835
+ * if (err) throw err;
836
+ * console.log(ret);
837
+ * });
838
+ * ```
839
+ *
840
+ * Will print:
841
+ *
842
+ * ```text
843
+ * hello world
844
+ * ```
845
+ *
846
+ * The callback is executed asynchronously, and will have a limited stack trace.
847
+ * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit.
848
+ *
849
+ * Since `null` has a special meaning as the first argument to a callback, if a
850
+ * wrapped function rejects a `Promise` with a falsy value as a reason, the value
851
+ * is wrapped in an `Error` with the original value stored in a field named`reason`.
852
+ *
853
+ * ```js
854
+ * function fn() {
855
+ * return Promise.reject(null);
856
+ * }
857
+ * const callbackFunction = util.callbackify(fn);
858
+ *
859
+ * callbackFunction((err, ret) => {
860
+ * // When the Promise was rejected with `null` it is wrapped with an Error and
861
+ * // the original value is stored in `reason`.
862
+ * err &#x26;&#x26; err.hasOwnProperty('reason') &#x26;&#x26; err.reason === null; // true
863
+ * });
864
+ * ```
865
+ * @since v8.2.0
866
+ * @param original An `async` function
867
+ * @return a callback style function
868
+ */
105
869
  export function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
106
870
  export function callbackify<TResult>(fn: () => Promise<TResult>): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
107
871
  export function callbackify<T1>(fn: (arg1: T1) => Promise<void>): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
@@ -110,33 +874,100 @@ declare module 'util' {
110
874
  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;
111
875
  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;
112
876
  export function callbackify<T1, T2, T3, TResult>(
113
- fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
114
- export function callbackify<T1, T2, T3, T4>(
115
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
116
- export function callbackify<T1, T2, T3, T4, TResult>(
117
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
118
- export function callbackify<T1, T2, T3, T4, T5>(
119
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
120
- export function callbackify<T1, T2, T3, T4, T5, TResult>(
121
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>,
877
+ fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>
878
+ ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
879
+ export function callbackify<T1, T2, T3, T4>(
880
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>
881
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
882
+ export function callbackify<T1, T2, T3, T4, TResult>(
883
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>
884
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
885
+ export function callbackify<T1, T2, T3, T4, T5>(
886
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>
887
+ ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
888
+ export function callbackify<T1, T2, T3, T4, T5, TResult>(
889
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>
122
890
  ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
123
891
  export function callbackify<T1, T2, T3, T4, T5, T6>(
124
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>,
892
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>
125
893
  ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void;
126
894
  export function callbackify<T1, T2, T3, T4, T5, T6, TResult>(
127
895
  fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>
128
896
  ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
129
-
130
897
  export interface CustomPromisifyLegacy<TCustom extends Function> extends Function {
131
898
  __promisify__: TCustom;
132
899
  }
133
-
134
900
  export interface CustomPromisifySymbol<TCustom extends Function> extends Function {
135
901
  [promisify.custom]: TCustom;
136
902
  }
137
-
138
903
  export type CustomPromisify<TCustom extends Function> = CustomPromisifySymbol<TCustom> | CustomPromisifyLegacy<TCustom>;
139
-
904
+ /**
905
+ * Takes a function following the common error-first callback style, i.e. taking
906
+ * an `(err, value) => ...` callback as the last argument, and returns a version
907
+ * that returns promises.
908
+ *
909
+ * ```js
910
+ * const util = require('util');
911
+ * const fs = require('fs');
912
+ *
913
+ * const stat = util.promisify(fs.stat);
914
+ * stat('.').then((stats) => {
915
+ * // Do something with `stats`
916
+ * }).catch((error) => {
917
+ * // Handle the error.
918
+ * });
919
+ * ```
920
+ *
921
+ * Or, equivalently using `async function`s:
922
+ *
923
+ * ```js
924
+ * const util = require('util');
925
+ * const fs = require('fs');
926
+ *
927
+ * const stat = util.promisify(fs.stat);
928
+ *
929
+ * async function callStat() {
930
+ * const stats = await stat('.');
931
+ * console.log(`This directory is owned by ${stats.uid}`);
932
+ * }
933
+ * ```
934
+ *
935
+ * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`.
936
+ *
937
+ * `promisify()` assumes that `original` is a function taking a callback as its
938
+ * 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
939
+ * an error-first callback, it will still be passed an error-first
940
+ * callback as its last argument.
941
+ *
942
+ * Using `promisify()` on class methods or other methods that use `this` may not
943
+ * work as expected unless handled specially:
944
+ *
945
+ * ```js
946
+ * const util = require('util');
947
+ *
948
+ * class Foo {
949
+ * constructor() {
950
+ * this.a = 42;
951
+ * }
952
+ *
953
+ * bar(callback) {
954
+ * callback(null, this.a);
955
+ * }
956
+ * }
957
+ *
958
+ * const foo = new Foo();
959
+ *
960
+ * const naiveBar = util.promisify(foo.bar);
961
+ * // TypeError: Cannot read property 'a' of undefined
962
+ * // naiveBar().then(a => console.log(a));
963
+ *
964
+ * naiveBar.call(foo).then((a) => console.log(a)); // '42'
965
+ *
966
+ * const bindBar = naiveBar.bind(foo);
967
+ * bindBar().then((a) => console.log(a)); // '42'
968
+ * ```
969
+ * @since v8.0.0
970
+ */
140
971
  export function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
141
972
  export function promisify<TResult>(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise<TResult>;
142
973
  export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
@@ -144,125 +975,620 @@ declare module 'util' {
144
975
  export function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
145
976
  export function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
146
977
  export function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
147
- export function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void):
148
- (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
978
+ 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>;
149
979
  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>;
150
980
  export function promisify<T1, T2, T3, T4, TResult>(
151
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
981
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void
152
982
  ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
153
- export function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void):
154
- (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
155
- export function promisify<T1, T2, T3, T4, T5, TResult>(
156
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
983
+ 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>;
984
+ export function promisify<T1, T2, T3, T4, T5, TResult>(
985
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void
157
986
  ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
158
987
  export function promisify<T1, T2, T3, T4, T5>(
159
- fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
988
+ fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void
160
989
  ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
161
990
  export function promisify(fn: Function): Function;
162
991
  export namespace promisify {
992
+ /**
993
+ * That can be used to declare custom promisified variants of functions.
994
+ */
163
995
  const custom: unique symbol;
164
996
  }
997
+ /**
998
+ * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API.
999
+ *
1000
+ * ```js
1001
+ * const decoder = new TextDecoder('shift_jis');
1002
+ * let string = '';
1003
+ * let buffer;
1004
+ * while (buffer = getNextChunkSomehow()) {
1005
+ * string += decoder.decode(buffer, { stream: true });
1006
+ * }
1007
+ * string += decoder.decode(); // end-of-stream
1008
+ * ```
1009
+ * @since v8.3.0
1010
+ */
165
1011
  export class TextDecoder {
1012
+ /**
1013
+ * The encoding supported by the `TextDecoder` instance.
1014
+ */
166
1015
  readonly encoding: string;
1016
+ /**
1017
+ * The value will be `true` if decoding errors result in a `TypeError` being
1018
+ * thrown.
1019
+ */
167
1020
  readonly fatal: boolean;
1021
+ /**
1022
+ * The value will be `true` if the decoding result will include the byte order
1023
+ * mark.
1024
+ */
168
1025
  readonly ignoreBOM: boolean;
169
1026
  constructor(
170
- encoding?: string,
171
- options?: { fatal?: boolean | undefined; ignoreBOM?: boolean | undefined }
1027
+ encoding?: string,
1028
+ options?: {
1029
+ fatal?: boolean | undefined;
1030
+ ignoreBOM?: boolean | undefined;
1031
+ }
172
1032
  );
1033
+ /**
1034
+ * Decodes the `input` and returns a string. If `options.stream` is `true`, any
1035
+ * incomplete byte sequences occurring at the end of the `input` are buffered
1036
+ * internally and emitted after the next call to `textDecoder.decode()`.
1037
+ *
1038
+ * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown.
1039
+ * @param input An `ArrayBuffer`, `DataView` or `TypedArray` instance containing the encoded data.
1040
+ */
173
1041
  decode(
174
- input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
175
- options?: { stream?: boolean | undefined }
1042
+ input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
1043
+ options?: {
1044
+ stream?: boolean | undefined;
1045
+ }
176
1046
  ): string;
177
1047
  }
178
-
179
1048
  export interface EncodeIntoResult {
180
1049
  /**
181
1050
  * The read Unicode code units of input.
182
1051
  */
183
-
184
1052
  read: number;
185
1053
  /**
186
1054
  * The written UTF-8 bytes of output.
187
1055
  */
188
1056
  written: number;
189
1057
  }
190
-
191
1058
  export { types };
192
-
1059
+ /**
1060
+ * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All
1061
+ * instances of `TextEncoder` only support UTF-8 encoding.
1062
+ *
1063
+ * ```js
1064
+ * const encoder = new TextEncoder();
1065
+ * const uint8array = encoder.encode('this is some data');
1066
+ * ```
1067
+ *
1068
+ * The `TextEncoder` class is also available on the global object.
1069
+ * @since v8.3.0
1070
+ */
193
1071
  export class TextEncoder {
1072
+ /**
1073
+ * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`.
1074
+ */
194
1075
  readonly encoding: string;
1076
+ /**
1077
+ * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the
1078
+ * encoded bytes.
1079
+ * @param [input='an empty string'] The text to encode.
1080
+ */
195
1081
  encode(input?: string): Uint8Array;
196
- encodeInto(input: string, output: Uint8Array): EncodeIntoResult;
1082
+ /**
1083
+ * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object
1084
+ * containing the read Unicode code units and written UTF-8 bytes.
1085
+ *
1086
+ * ```js
1087
+ * const encoder = new TextEncoder();
1088
+ * const src = 'this is some data';
1089
+ * const dest = new Uint8Array(10);
1090
+ * const { read, written } = encoder.encodeInto(src, dest);
1091
+ * ```
1092
+ * @param src The text to encode.
1093
+ * @param dest The array to hold the encode result.
1094
+ */
1095
+ encodeInto(src: string, dest: Uint8Array): EncodeIntoResult;
197
1096
  }
198
1097
  }
199
-
200
1098
  declare module 'util/types' {
201
1099
  export * from 'util/types';
202
1100
  }
203
-
204
1101
  declare module 'util/types' {
205
1102
  import { KeyObject, webcrypto } from 'node:crypto';
206
-
1103
+ /**
1104
+ * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or
1105
+ * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
1106
+ *
1107
+ * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`.
1108
+ *
1109
+ * ```js
1110
+ * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true
1111
+ * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true
1112
+ * ```
1113
+ * @since v10.0.0
1114
+ */
207
1115
  function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike;
1116
+ /**
1117
+ * Returns `true` if the value is an `arguments` object.
1118
+ *
1119
+ * ```js
1120
+ * function foo() {
1121
+ * util.types.isArgumentsObject(arguments); // Returns true
1122
+ * }
1123
+ * ```
1124
+ * @since v10.0.0
1125
+ */
208
1126
  function isArgumentsObject(object: unknown): object is IArguments;
1127
+ /**
1128
+ * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance.
1129
+ * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is
1130
+ * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
1131
+ *
1132
+ * ```js
1133
+ * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true
1134
+ * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false
1135
+ * ```
1136
+ * @since v10.0.0
1137
+ */
209
1138
  function isArrayBuffer(object: unknown): object is ArrayBuffer;
1139
+ /**
1140
+ * 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
1141
+ * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to
1142
+ * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
1143
+ *
1144
+ * ```js
1145
+ * util.types.isArrayBufferView(new Int8Array()); // true
1146
+ * util.types.isArrayBufferView(Buffer.from('hello world')); // true
1147
+ * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true
1148
+ * util.types.isArrayBufferView(new ArrayBuffer()); // false
1149
+ * ```
1150
+ * @since v10.0.0
1151
+ */
210
1152
  function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView;
1153
+ /**
1154
+ * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function).
1155
+ * This only reports back what the JavaScript engine is seeing;
1156
+ * in particular, the return value may not match the original source code if
1157
+ * a transpilation tool was used.
1158
+ *
1159
+ * ```js
1160
+ * util.types.isAsyncFunction(function foo() {}); // Returns false
1161
+ * util.types.isAsyncFunction(async function foo() {}); // Returns true
1162
+ * ```
1163
+ * @since v10.0.0
1164
+ */
211
1165
  function isAsyncFunction(object: unknown): boolean;
1166
+ /**
1167
+ * Returns `true` if the value is a `BigInt64Array` instance.
1168
+ *
1169
+ * ```js
1170
+ * util.types.isBigInt64Array(new BigInt64Array()); // Returns true
1171
+ * util.types.isBigInt64Array(new BigUint64Array()); // Returns false
1172
+ * ```
1173
+ * @since v10.0.0
1174
+ */
212
1175
  function isBigInt64Array(value: unknown): value is BigInt64Array;
1176
+ /**
1177
+ * Returns `true` if the value is a `BigUint64Array` instance.
1178
+ *
1179
+ * ```js
1180
+ * util.types.isBigUint64Array(new BigInt64Array()); // Returns false
1181
+ * util.types.isBigUint64Array(new BigUint64Array()); // Returns true
1182
+ * ```
1183
+ * @since v10.0.0
1184
+ */
213
1185
  function isBigUint64Array(value: unknown): value is BigUint64Array;
1186
+ /**
1187
+ * Returns `true` if the value is a boolean object, e.g. created
1188
+ * by `new Boolean()`.
1189
+ *
1190
+ * ```js
1191
+ * util.types.isBooleanObject(false); // Returns false
1192
+ * util.types.isBooleanObject(true); // Returns false
1193
+ * util.types.isBooleanObject(new Boolean(false)); // Returns true
1194
+ * util.types.isBooleanObject(new Boolean(true)); // Returns true
1195
+ * util.types.isBooleanObject(Boolean(false)); // Returns false
1196
+ * util.types.isBooleanObject(Boolean(true)); // Returns false
1197
+ * ```
1198
+ * @since v10.0.0
1199
+ */
214
1200
  function isBooleanObject(object: unknown): object is Boolean;
1201
+ /**
1202
+ * Returns `true` if the value is any boxed primitive object, e.g. created
1203
+ * by `new Boolean()`, `new String()` or `Object(Symbol())`.
1204
+ *
1205
+ * For example:
1206
+ *
1207
+ * ```js
1208
+ * util.types.isBoxedPrimitive(false); // Returns false
1209
+ * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true
1210
+ * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false
1211
+ * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true
1212
+ * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true
1213
+ * ```
1214
+ * @since v10.11.0
1215
+ */
215
1216
  function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol;
1217
+ /**
1218
+ * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance.
1219
+ *
1220
+ * ```js
1221
+ * const ab = new ArrayBuffer(20);
1222
+ * util.types.isDataView(new DataView(ab)); // Returns true
1223
+ * util.types.isDataView(new Float64Array()); // Returns false
1224
+ * ```
1225
+ *
1226
+ * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
1227
+ * @since v10.0.0
1228
+ */
216
1229
  function isDataView(object: unknown): object is DataView;
1230
+ /**
1231
+ * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance.
1232
+ *
1233
+ * ```js
1234
+ * util.types.isDate(new Date()); // Returns true
1235
+ * ```
1236
+ * @since v10.0.0
1237
+ */
217
1238
  function isDate(object: unknown): object is Date;
1239
+ /**
1240
+ * Returns `true` if the value is a native `External` value.
1241
+ *
1242
+ * A native `External` value is a special type of object that contains a
1243
+ * raw C++ pointer (`void*`) for access from native code, and has no other
1244
+ * properties. Such objects are created either by Node.js internals or native
1245
+ * 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.
1246
+ *
1247
+ * ```c
1248
+ * #include <js_native_api.h>
1249
+ * #include <stdlib.h>
1250
+ * napi_value result;
1251
+ * static napi_value MyNapi(napi_env env, napi_callback_info info) {
1252
+ * int* raw = (int*) malloc(1024);
1253
+ * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &#x26;result);
1254
+ * if (status != napi_ok) {
1255
+ * napi_throw_error(env, NULL, "napi_create_external failed");
1256
+ * return NULL;
1257
+ * }
1258
+ * return result;
1259
+ * }
1260
+ * ...
1261
+ * DECLARE_NAPI_PROPERTY("myNapi", MyNapi)
1262
+ * ...
1263
+ * ```
1264
+ *
1265
+ * ```js
1266
+ * const native = require('napi_addon.node');
1267
+ * const data = native.myNapi();
1268
+ * util.types.isExternal(data); // returns true
1269
+ * util.types.isExternal(0); // returns false
1270
+ * util.types.isExternal(new String('foo')); // returns false
1271
+ * ```
1272
+ *
1273
+ * For further information on `napi_create_external`, refer to `napi_create_external()`.
1274
+ * @since v10.0.0
1275
+ */
218
1276
  function isExternal(object: unknown): boolean;
1277
+ /**
1278
+ * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance.
1279
+ *
1280
+ * ```js
1281
+ * util.types.isFloat32Array(new ArrayBuffer()); // Returns false
1282
+ * util.types.isFloat32Array(new Float32Array()); // Returns true
1283
+ * util.types.isFloat32Array(new Float64Array()); // Returns false
1284
+ * ```
1285
+ * @since v10.0.0
1286
+ */
219
1287
  function isFloat32Array(object: unknown): object is Float32Array;
1288
+ /**
1289
+ * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance.
1290
+ *
1291
+ * ```js
1292
+ * util.types.isFloat64Array(new ArrayBuffer()); // Returns false
1293
+ * util.types.isFloat64Array(new Uint8Array()); // Returns false
1294
+ * util.types.isFloat64Array(new Float64Array()); // Returns true
1295
+ * ```
1296
+ * @since v10.0.0
1297
+ */
220
1298
  function isFloat64Array(object: unknown): object is Float64Array;
1299
+ /**
1300
+ * Returns `true` if the value is a generator function.
1301
+ * This only reports back what the JavaScript engine is seeing;
1302
+ * in particular, the return value may not match the original source code if
1303
+ * a transpilation tool was used.
1304
+ *
1305
+ * ```js
1306
+ * util.types.isGeneratorFunction(function foo() {}); // Returns false
1307
+ * util.types.isGeneratorFunction(function* foo() {}); // Returns true
1308
+ * ```
1309
+ * @since v10.0.0
1310
+ */
221
1311
  function isGeneratorFunction(object: unknown): object is GeneratorFunction;
1312
+ /**
1313
+ * Returns `true` if the value is a generator object as returned from a
1314
+ * built-in generator function.
1315
+ * This only reports back what the JavaScript engine is seeing;
1316
+ * in particular, the return value may not match the original source code if
1317
+ * a transpilation tool was used.
1318
+ *
1319
+ * ```js
1320
+ * function* foo() {}
1321
+ * const generator = foo();
1322
+ * util.types.isGeneratorObject(generator); // Returns true
1323
+ * ```
1324
+ * @since v10.0.0
1325
+ */
222
1326
  function isGeneratorObject(object: unknown): object is Generator;
1327
+ /**
1328
+ * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance.
1329
+ *
1330
+ * ```js
1331
+ * util.types.isInt8Array(new ArrayBuffer()); // Returns false
1332
+ * util.types.isInt8Array(new Int8Array()); // Returns true
1333
+ * util.types.isInt8Array(new Float64Array()); // Returns false
1334
+ * ```
1335
+ * @since v10.0.0
1336
+ */
223
1337
  function isInt8Array(object: unknown): object is Int8Array;
1338
+ /**
1339
+ * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance.
1340
+ *
1341
+ * ```js
1342
+ * util.types.isInt16Array(new ArrayBuffer()); // Returns false
1343
+ * util.types.isInt16Array(new Int16Array()); // Returns true
1344
+ * util.types.isInt16Array(new Float64Array()); // Returns false
1345
+ * ```
1346
+ * @since v10.0.0
1347
+ */
224
1348
  function isInt16Array(object: unknown): object is Int16Array;
1349
+ /**
1350
+ * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance.
1351
+ *
1352
+ * ```js
1353
+ * util.types.isInt32Array(new ArrayBuffer()); // Returns false
1354
+ * util.types.isInt32Array(new Int32Array()); // Returns true
1355
+ * util.types.isInt32Array(new Float64Array()); // Returns false
1356
+ * ```
1357
+ * @since v10.0.0
1358
+ */
225
1359
  function isInt32Array(object: unknown): object is Int32Array;
226
- function isMap<T>(
227
- object: T | {},
228
- ): object is T extends ReadonlyMap<any, any>
229
- ? unknown extends T
230
- ? never
231
- : ReadonlyMap<any, any>
232
- : Map<unknown, unknown>;
1360
+ /**
1361
+ * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
1362
+ *
1363
+ * ```js
1364
+ * util.types.isMap(new Map()); // Returns true
1365
+ * ```
1366
+ * @since v10.0.0
1367
+ */
1368
+ function isMap<T>(object: T | {}): object is T extends ReadonlyMap<any, any> ? (unknown extends T ? never : ReadonlyMap<any, any>) : Map<unknown, unknown>;
1369
+ /**
1370
+ * 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.
1371
+ *
1372
+ * ```js
1373
+ * const map = new Map();
1374
+ * util.types.isMapIterator(map.keys()); // Returns true
1375
+ * util.types.isMapIterator(map.values()); // Returns true
1376
+ * util.types.isMapIterator(map.entries()); // Returns true
1377
+ * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true
1378
+ * ```
1379
+ * @since v10.0.0
1380
+ */
233
1381
  function isMapIterator(object: unknown): boolean;
1382
+ /**
1383
+ * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects).
1384
+ *
1385
+ * ```js
1386
+ * import * as ns from './a.js';
1387
+ *
1388
+ * util.types.isModuleNamespaceObject(ns); // Returns true
1389
+ * ```
1390
+ * @since v10.0.0
1391
+ */
234
1392
  function isModuleNamespaceObject(value: unknown): boolean;
1393
+ /**
1394
+ * Returns `true` if the value is an instance of a built-in `Error` type.
1395
+ *
1396
+ * ```js
1397
+ * util.types.isNativeError(new Error()); // Returns true
1398
+ * util.types.isNativeError(new TypeError()); // Returns true
1399
+ * util.types.isNativeError(new RangeError()); // Returns true
1400
+ * ```
1401
+ * @since v10.0.0
1402
+ */
235
1403
  function isNativeError(object: unknown): object is Error;
1404
+ /**
1405
+ * Returns `true` if the value is a number object, e.g. created
1406
+ * by `new Number()`.
1407
+ *
1408
+ * ```js
1409
+ * util.types.isNumberObject(0); // Returns false
1410
+ * util.types.isNumberObject(new Number(0)); // Returns true
1411
+ * ```
1412
+ * @since v10.0.0
1413
+ */
236
1414
  function isNumberObject(object: unknown): object is Number;
1415
+ /**
1416
+ * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
1417
+ *
1418
+ * ```js
1419
+ * util.types.isPromise(Promise.resolve(42)); // Returns true
1420
+ * ```
1421
+ * @since v10.0.0
1422
+ */
237
1423
  function isPromise(object: unknown): object is Promise<unknown>;
1424
+ /**
1425
+ * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance.
1426
+ *
1427
+ * ```js
1428
+ * const target = {};
1429
+ * const proxy = new Proxy(target, {});
1430
+ * util.types.isProxy(target); // Returns false
1431
+ * util.types.isProxy(proxy); // Returns true
1432
+ * ```
1433
+ * @since v10.0.0
1434
+ */
238
1435
  function isProxy(object: unknown): boolean;
1436
+ /**
1437
+ * Returns `true` if the value is a regular expression object.
1438
+ *
1439
+ * ```js
1440
+ * util.types.isRegExp(/abc/); // Returns true
1441
+ * util.types.isRegExp(new RegExp('abc')); // Returns true
1442
+ * ```
1443
+ * @since v10.0.0
1444
+ */
239
1445
  function isRegExp(object: unknown): object is RegExp;
240
- function isSet<T>(
241
- object: T | {},
242
- ): object is T extends ReadonlySet<any>
243
- ? unknown extends T
244
- ? never
245
- : ReadonlySet<any>
246
- : Set<unknown>;
1446
+ /**
1447
+ * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
1448
+ *
1449
+ * ```js
1450
+ * util.types.isSet(new Set()); // Returns true
1451
+ * ```
1452
+ * @since v10.0.0
1453
+ */
1454
+ function isSet<T>(object: T | {}): object is T extends ReadonlySet<any> ? (unknown extends T ? never : ReadonlySet<any>) : Set<unknown>;
1455
+ /**
1456
+ * 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.
1457
+ *
1458
+ * ```js
1459
+ * const set = new Set();
1460
+ * util.types.isSetIterator(set.keys()); // Returns true
1461
+ * util.types.isSetIterator(set.values()); // Returns true
1462
+ * util.types.isSetIterator(set.entries()); // Returns true
1463
+ * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true
1464
+ * ```
1465
+ * @since v10.0.0
1466
+ */
247
1467
  function isSetIterator(object: unknown): boolean;
1468
+ /**
1469
+ * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
1470
+ * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is
1471
+ * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that.
1472
+ *
1473
+ * ```js
1474
+ * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false
1475
+ * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true
1476
+ * ```
1477
+ * @since v10.0.0
1478
+ */
248
1479
  function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer;
1480
+ /**
1481
+ * Returns `true` if the value is a string object, e.g. created
1482
+ * by `new String()`.
1483
+ *
1484
+ * ```js
1485
+ * util.types.isStringObject('foo'); // Returns false
1486
+ * util.types.isStringObject(new String('foo')); // Returns true
1487
+ * ```
1488
+ * @since v10.0.0
1489
+ */
249
1490
  function isStringObject(object: unknown): object is String;
1491
+ /**
1492
+ * Returns `true` if the value is a symbol object, created
1493
+ * by calling `Object()` on a `Symbol` primitive.
1494
+ *
1495
+ * ```js
1496
+ * const symbol = Symbol('foo');
1497
+ * util.types.isSymbolObject(symbol); // Returns false
1498
+ * util.types.isSymbolObject(Object(symbol)); // Returns true
1499
+ * ```
1500
+ * @since v10.0.0
1501
+ */
250
1502
  function isSymbolObject(object: unknown): object is Symbol;
1503
+ /**
1504
+ * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance.
1505
+ *
1506
+ * ```js
1507
+ * util.types.isTypedArray(new ArrayBuffer()); // Returns false
1508
+ * util.types.isTypedArray(new Uint8Array()); // Returns true
1509
+ * util.types.isTypedArray(new Float64Array()); // Returns true
1510
+ * ```
1511
+ *
1512
+ * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
1513
+ * @since v10.0.0
1514
+ */
251
1515
  function isTypedArray(object: unknown): object is NodeJS.TypedArray;
1516
+ /**
1517
+ * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance.
1518
+ *
1519
+ * ```js
1520
+ * util.types.isUint8Array(new ArrayBuffer()); // Returns false
1521
+ * util.types.isUint8Array(new Uint8Array()); // Returns true
1522
+ * util.types.isUint8Array(new Float64Array()); // Returns false
1523
+ * ```
1524
+ * @since v10.0.0
1525
+ */
252
1526
  function isUint8Array(object: unknown): object is Uint8Array;
1527
+ /**
1528
+ * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance.
1529
+ *
1530
+ * ```js
1531
+ * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false
1532
+ * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true
1533
+ * util.types.isUint8ClampedArray(new Float64Array()); // Returns false
1534
+ * ```
1535
+ * @since v10.0.0
1536
+ */
253
1537
  function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray;
1538
+ /**
1539
+ * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance.
1540
+ *
1541
+ * ```js
1542
+ * util.types.isUint16Array(new ArrayBuffer()); // Returns false
1543
+ * util.types.isUint16Array(new Uint16Array()); // Returns true
1544
+ * util.types.isUint16Array(new Float64Array()); // Returns false
1545
+ * ```
1546
+ * @since v10.0.0
1547
+ */
254
1548
  function isUint16Array(object: unknown): object is Uint16Array;
1549
+ /**
1550
+ * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance.
1551
+ *
1552
+ * ```js
1553
+ * util.types.isUint32Array(new ArrayBuffer()); // Returns false
1554
+ * util.types.isUint32Array(new Uint32Array()); // Returns true
1555
+ * util.types.isUint32Array(new Float64Array()); // Returns false
1556
+ * ```
1557
+ * @since v10.0.0
1558
+ */
255
1559
  function isUint32Array(object: unknown): object is Uint32Array;
1560
+ /**
1561
+ * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance.
1562
+ *
1563
+ * ```js
1564
+ * util.types.isWeakMap(new WeakMap()); // Returns true
1565
+ * ```
1566
+ * @since v10.0.0
1567
+ */
256
1568
  function isWeakMap(object: unknown): object is WeakMap<object, unknown>;
1569
+ /**
1570
+ * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance.
1571
+ *
1572
+ * ```js
1573
+ * util.types.isWeakSet(new WeakSet()); // Returns true
1574
+ * ```
1575
+ * @since v10.0.0
1576
+ */
257
1577
  function isWeakSet(object: unknown): object is WeakSet<object>;
1578
+ /**
1579
+ * Returns `true` if `value` is a `KeyObject`, `false` otherwise.
1580
+ * @since v16.2.0
1581
+ */
258
1582
  function isKeyObject(object: unknown): object is KeyObject;
1583
+ /**
1584
+ * Returns `true` if `value` is a `CryptoKey`, `false` otherwise.
1585
+ * @since v16.2.0
1586
+ */
259
1587
  function isCryptoKey(object: unknown): object is webcrypto.CryptoKey;
260
1588
  }
261
-
262
1589
  declare module 'node:util' {
263
1590
  export * from 'util';
264
1591
  }
265
-
266
1592
  declare module 'node:util/types' {
267
1593
  export * from 'util/types';
268
1594
  }