css-variable-lsp 1.0.0 → 1.0.2

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