@alanszp/express-common-fn 12.0.2 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (954) hide show
  1. package/dist/commonErrorsHandler.d.ts +3 -0
  2. package/dist/commonErrorsHandler.js +3 -0
  3. package/dist/commonErrorsHandler.js.map +1 -1
  4. package/package.json +6 -9
  5. package/.gitignore +0 -3
  6. package/.npmignore +0 -3
  7. package/node_modules/@alanszp/audit/.gitignore +0 -3
  8. package/node_modules/@alanszp/audit/.npmignore +0 -3
  9. package/node_modules/@alanszp/audit/LICENSE +0 -21
  10. package/node_modules/@alanszp/audit/dist/audit.d.ts +0 -9
  11. package/node_modules/@alanszp/audit/dist/audit.js +0 -25
  12. package/node_modules/@alanszp/audit/dist/audit.js.map +0 -1
  13. package/node_modules/@alanszp/audit/dist/auditWithState.d.ts +0 -10
  14. package/node_modules/@alanszp/audit/dist/auditWithState.js +0 -22
  15. package/node_modules/@alanszp/audit/dist/auditWithState.js.map +0 -1
  16. package/node_modules/@alanszp/audit/dist/errors/AuditError.d.ts +0 -3
  17. package/node_modules/@alanszp/audit/dist/errors/AuditError.js +0 -8
  18. package/node_modules/@alanszp/audit/dist/errors/AuditError.js.map +0 -1
  19. package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.d.ts +0 -9
  20. package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.js +0 -23
  21. package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.js.map +0 -1
  22. package/node_modules/@alanszp/audit/dist/errors/index.d.ts +0 -2
  23. package/node_modules/@alanszp/audit/dist/errors/index.js +0 -19
  24. package/node_modules/@alanszp/audit/dist/errors/index.js.map +0 -1
  25. package/node_modules/@alanszp/audit/dist/factory.d.ts +0 -4
  26. package/node_modules/@alanszp/audit/dist/factory.js +0 -16
  27. package/node_modules/@alanszp/audit/dist/factory.js.map +0 -1
  28. package/node_modules/@alanszp/audit/dist/index.d.ts +0 -5
  29. package/node_modules/@alanszp/audit/dist/index.js +0 -22
  30. package/node_modules/@alanszp/audit/dist/index.js.map +0 -1
  31. package/node_modules/@alanszp/audit/dist/interfaces.d.ts +0 -22
  32. package/node_modules/@alanszp/audit/dist/interfaces.js +0 -18
  33. package/node_modules/@alanszp/audit/dist/interfaces.js.map +0 -1
  34. package/node_modules/@alanszp/audit/node_modules/@types/node/LICENSE +0 -21
  35. package/node_modules/@alanszp/audit/node_modules/@types/node/README.md +0 -15
  36. package/node_modules/@alanszp/audit/node_modules/@types/node/assert/strict.d.ts +0 -8
  37. package/node_modules/@alanszp/audit/node_modules/@types/node/assert.d.ts +0 -996
  38. package/node_modules/@alanszp/audit/node_modules/@types/node/async_hooks.d.ts +0 -539
  39. package/node_modules/@alanszp/audit/node_modules/@types/node/buffer.d.ts +0 -2362
  40. package/node_modules/@alanszp/audit/node_modules/@types/node/child_process.d.ts +0 -1540
  41. package/node_modules/@alanszp/audit/node_modules/@types/node/cluster.d.ts +0 -432
  42. package/node_modules/@alanszp/audit/node_modules/@types/node/console.d.ts +0 -415
  43. package/node_modules/@alanszp/audit/node_modules/@types/node/constants.d.ts +0 -19
  44. package/node_modules/@alanszp/audit/node_modules/@types/node/crypto.d.ts +0 -4487
  45. package/node_modules/@alanszp/audit/node_modules/@types/node/dgram.d.ts +0 -596
  46. package/node_modules/@alanszp/audit/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  47. package/node_modules/@alanszp/audit/node_modules/@types/node/dns/promises.d.ts +0 -425
  48. package/node_modules/@alanszp/audit/node_modules/@types/node/dns.d.ts +0 -809
  49. package/node_modules/@alanszp/audit/node_modules/@types/node/dom-events.d.ts +0 -122
  50. package/node_modules/@alanszp/audit/node_modules/@types/node/domain.d.ts +0 -170
  51. package/node_modules/@alanszp/audit/node_modules/@types/node/events.d.ts +0 -879
  52. package/node_modules/@alanszp/audit/node_modules/@types/node/fs/promises.d.ts +0 -1239
  53. package/node_modules/@alanszp/audit/node_modules/@types/node/fs.d.ts +0 -4311
  54. package/node_modules/@alanszp/audit/node_modules/@types/node/globals.d.ts +0 -411
  55. package/node_modules/@alanszp/audit/node_modules/@types/node/globals.global.d.ts +0 -1
  56. package/node_modules/@alanszp/audit/node_modules/@types/node/http.d.ts +0 -1887
  57. package/node_modules/@alanszp/audit/node_modules/@types/node/http2.d.ts +0 -2382
  58. package/node_modules/@alanszp/audit/node_modules/@types/node/https.d.ts +0 -550
  59. package/node_modules/@alanszp/audit/node_modules/@types/node/index.d.ts +0 -88
  60. package/node_modules/@alanszp/audit/node_modules/@types/node/inspector.d.ts +0 -2747
  61. package/node_modules/@alanszp/audit/node_modules/@types/node/module.d.ts +0 -315
  62. package/node_modules/@alanszp/audit/node_modules/@types/node/net.d.ts +0 -949
  63. package/node_modules/@alanszp/audit/node_modules/@types/node/os.d.ts +0 -478
  64. package/node_modules/@alanszp/audit/node_modules/@types/node/package.json +0 -229
  65. package/node_modules/@alanszp/audit/node_modules/@types/node/path.d.ts +0 -191
  66. package/node_modules/@alanszp/audit/node_modules/@types/node/perf_hooks.d.ts +0 -645
  67. package/node_modules/@alanszp/audit/node_modules/@types/node/process.d.ts +0 -1561
  68. package/node_modules/@alanszp/audit/node_modules/@types/node/punycode.d.ts +0 -117
  69. package/node_modules/@alanszp/audit/node_modules/@types/node/querystring.d.ts +0 -141
  70. package/node_modules/@alanszp/audit/node_modules/@types/node/readline/promises.d.ts +0 -150
  71. package/node_modules/@alanszp/audit/node_modules/@types/node/readline.d.ts +0 -539
  72. package/node_modules/@alanszp/audit/node_modules/@types/node/repl.d.ts +0 -430
  73. package/node_modules/@alanszp/audit/node_modules/@types/node/stream/consumers.d.ts +0 -12
  74. package/node_modules/@alanszp/audit/node_modules/@types/node/stream/promises.d.ts +0 -83
  75. package/node_modules/@alanszp/audit/node_modules/@types/node/stream/web.d.ts +0 -366
  76. package/node_modules/@alanszp/audit/node_modules/@types/node/stream.d.ts +0 -1701
  77. package/node_modules/@alanszp/audit/node_modules/@types/node/string_decoder.d.ts +0 -67
  78. package/node_modules/@alanszp/audit/node_modules/@types/node/test.d.ts +0 -1465
  79. package/node_modules/@alanszp/audit/node_modules/@types/node/timers/promises.d.ts +0 -93
  80. package/node_modules/@alanszp/audit/node_modules/@types/node/timers.d.ts +0 -240
  81. package/node_modules/@alanszp/audit/node_modules/@types/node/tls.d.ts +0 -1210
  82. package/node_modules/@alanszp/audit/node_modules/@types/node/trace_events.d.ts +0 -182
  83. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  84. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  85. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  86. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  87. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  88. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  89. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  90. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  91. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  92. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  93. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  94. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  95. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  96. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  97. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  98. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  99. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  100. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  101. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  102. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  103. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  104. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  105. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  106. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  107. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  108. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  109. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  110. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  111. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  112. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  113. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  114. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  115. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  116. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  117. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  118. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  119. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  120. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  121. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  122. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  123. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  124. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  125. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  126. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  127. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  128. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  129. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  130. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  131. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  132. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  133. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  134. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  135. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  136. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  137. package/node_modules/@alanszp/audit/node_modules/@types/node/tty.d.ts +0 -208
  138. package/node_modules/@alanszp/audit/node_modules/@types/node/url.d.ts +0 -927
  139. package/node_modules/@alanszp/audit/node_modules/@types/node/util.d.ts +0 -2183
  140. package/node_modules/@alanszp/audit/node_modules/@types/node/v8.d.ts +0 -764
  141. package/node_modules/@alanszp/audit/node_modules/@types/node/vm.d.ts +0 -903
  142. package/node_modules/@alanszp/audit/node_modules/@types/node/wasi.d.ts +0 -179
  143. package/node_modules/@alanszp/audit/node_modules/@types/node/worker_threads.d.ts +0 -691
  144. package/node_modules/@alanszp/audit/node_modules/@types/node/zlib.d.ts +0 -517
  145. package/node_modules/@alanszp/audit/package.json +0 -32
  146. package/node_modules/@alanszp/audit/src/audit.ts +0 -31
  147. package/node_modules/@alanszp/audit/src/auditWithState.ts +0 -27
  148. package/node_modules/@alanszp/audit/src/errors/AuditError.ts +0 -3
  149. package/node_modules/@alanszp/audit/src/errors/MissingAuditFieldsError.ts +0 -25
  150. package/node_modules/@alanszp/audit/src/errors/index.ts +0 -2
  151. package/node_modules/@alanszp/audit/src/factory.ts +0 -16
  152. package/node_modules/@alanszp/audit/src/index.ts +0 -5
  153. package/node_modules/@alanszp/audit/src/interfaces.ts +0 -38
  154. package/node_modules/@alanszp/audit/tsconfig.json +0 -15
  155. package/node_modules/@alanszp/errors/.gitignore +0 -3
  156. package/node_modules/@alanszp/errors/.npmignore +0 -3
  157. package/node_modules/@alanszp/errors/LICENSE +0 -21
  158. package/node_modules/@alanszp/errors/dist/BaseError.d.ts +0 -3
  159. package/node_modules/@alanszp/errors/dist/BaseError.js +0 -18
  160. package/node_modules/@alanszp/errors/dist/BaseError.js.map +0 -1
  161. package/node_modules/@alanszp/errors/dist/HttpRenderableError.d.ts +0 -4
  162. package/node_modules/@alanszp/errors/dist/HttpRenderableError.js +0 -8
  163. package/node_modules/@alanszp/errors/dist/HttpRenderableError.js.map +0 -1
  164. package/node_modules/@alanszp/errors/dist/InternalServerError.d.ts +0 -8
  165. package/node_modules/@alanszp/errors/dist/InternalServerError.js +0 -24
  166. package/node_modules/@alanszp/errors/dist/InternalServerError.js.map +0 -1
  167. package/node_modules/@alanszp/errors/dist/RenderableError.d.ts +0 -15
  168. package/node_modules/@alanszp/errors/dist/RenderableError.js +0 -27
  169. package/node_modules/@alanszp/errors/dist/RenderableError.js.map +0 -1
  170. package/node_modules/@alanszp/errors/dist/index.d.ts +0 -4
  171. package/node_modules/@alanszp/errors/dist/index.js +0 -17
  172. package/node_modules/@alanszp/errors/dist/index.js.map +0 -1
  173. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/.gitignore +0 -3
  174. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/.npmignore +0 -3
  175. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/LICENSE +0 -21
  176. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.d.ts +0 -1
  177. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.js +0 -10
  178. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.js.map +0 -1
  179. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.d.ts +0 -1
  180. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.js +0 -18
  181. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.js.map +0 -1
  182. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.d.ts +0 -2
  183. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.js +0 -20
  184. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.js.map +0 -1
  185. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.d.ts +0 -2
  186. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.js +0 -19
  187. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.js.map +0 -1
  188. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.d.ts +0 -3
  189. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.js +0 -26
  190. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.js.map +0 -1
  191. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.d.ts +0 -6
  192. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.js +0 -3
  193. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.js.map +0 -1
  194. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.d.ts +0 -4
  195. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.js +0 -21
  196. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.js.map +0 -1
  197. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.d.ts +0 -7
  198. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.js +0 -8
  199. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.js.map +0 -1
  200. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.d.ts +0 -11
  201. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.js +0 -13
  202. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.js.map +0 -1
  203. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.d.ts +0 -14
  204. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.js +0 -22
  205. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.js.map +0 -1
  206. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.d.ts +0 -3
  207. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.js +0 -20
  208. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.js.map +0 -1
  209. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/package.json +0 -25
  210. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/tsconfig.json +0 -15
  211. package/node_modules/@alanszp/errors/node_modules/@types/node/LICENSE +0 -21
  212. package/node_modules/@alanszp/errors/node_modules/@types/node/README.md +0 -15
  213. package/node_modules/@alanszp/errors/node_modules/@types/node/assert/strict.d.ts +0 -8
  214. package/node_modules/@alanszp/errors/node_modules/@types/node/assert.d.ts +0 -996
  215. package/node_modules/@alanszp/errors/node_modules/@types/node/async_hooks.d.ts +0 -539
  216. package/node_modules/@alanszp/errors/node_modules/@types/node/buffer.d.ts +0 -2362
  217. package/node_modules/@alanszp/errors/node_modules/@types/node/child_process.d.ts +0 -1540
  218. package/node_modules/@alanszp/errors/node_modules/@types/node/cluster.d.ts +0 -432
  219. package/node_modules/@alanszp/errors/node_modules/@types/node/console.d.ts +0 -415
  220. package/node_modules/@alanszp/errors/node_modules/@types/node/constants.d.ts +0 -19
  221. package/node_modules/@alanszp/errors/node_modules/@types/node/crypto.d.ts +0 -4487
  222. package/node_modules/@alanszp/errors/node_modules/@types/node/dgram.d.ts +0 -596
  223. package/node_modules/@alanszp/errors/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  224. package/node_modules/@alanszp/errors/node_modules/@types/node/dns/promises.d.ts +0 -425
  225. package/node_modules/@alanszp/errors/node_modules/@types/node/dns.d.ts +0 -809
  226. package/node_modules/@alanszp/errors/node_modules/@types/node/dom-events.d.ts +0 -122
  227. package/node_modules/@alanszp/errors/node_modules/@types/node/domain.d.ts +0 -170
  228. package/node_modules/@alanszp/errors/node_modules/@types/node/events.d.ts +0 -879
  229. package/node_modules/@alanszp/errors/node_modules/@types/node/fs/promises.d.ts +0 -1239
  230. package/node_modules/@alanszp/errors/node_modules/@types/node/fs.d.ts +0 -4311
  231. package/node_modules/@alanszp/errors/node_modules/@types/node/globals.d.ts +0 -411
  232. package/node_modules/@alanszp/errors/node_modules/@types/node/globals.global.d.ts +0 -1
  233. package/node_modules/@alanszp/errors/node_modules/@types/node/http.d.ts +0 -1887
  234. package/node_modules/@alanszp/errors/node_modules/@types/node/http2.d.ts +0 -2382
  235. package/node_modules/@alanszp/errors/node_modules/@types/node/https.d.ts +0 -550
  236. package/node_modules/@alanszp/errors/node_modules/@types/node/index.d.ts +0 -88
  237. package/node_modules/@alanszp/errors/node_modules/@types/node/inspector.d.ts +0 -2747
  238. package/node_modules/@alanszp/errors/node_modules/@types/node/module.d.ts +0 -315
  239. package/node_modules/@alanszp/errors/node_modules/@types/node/net.d.ts +0 -949
  240. package/node_modules/@alanszp/errors/node_modules/@types/node/os.d.ts +0 -478
  241. package/node_modules/@alanszp/errors/node_modules/@types/node/package.json +0 -229
  242. package/node_modules/@alanszp/errors/node_modules/@types/node/path.d.ts +0 -191
  243. package/node_modules/@alanszp/errors/node_modules/@types/node/perf_hooks.d.ts +0 -645
  244. package/node_modules/@alanszp/errors/node_modules/@types/node/process.d.ts +0 -1561
  245. package/node_modules/@alanszp/errors/node_modules/@types/node/punycode.d.ts +0 -117
  246. package/node_modules/@alanszp/errors/node_modules/@types/node/querystring.d.ts +0 -141
  247. package/node_modules/@alanszp/errors/node_modules/@types/node/readline/promises.d.ts +0 -150
  248. package/node_modules/@alanszp/errors/node_modules/@types/node/readline.d.ts +0 -539
  249. package/node_modules/@alanszp/errors/node_modules/@types/node/repl.d.ts +0 -430
  250. package/node_modules/@alanszp/errors/node_modules/@types/node/stream/consumers.d.ts +0 -12
  251. package/node_modules/@alanszp/errors/node_modules/@types/node/stream/promises.d.ts +0 -83
  252. package/node_modules/@alanszp/errors/node_modules/@types/node/stream/web.d.ts +0 -366
  253. package/node_modules/@alanszp/errors/node_modules/@types/node/stream.d.ts +0 -1701
  254. package/node_modules/@alanszp/errors/node_modules/@types/node/string_decoder.d.ts +0 -67
  255. package/node_modules/@alanszp/errors/node_modules/@types/node/test.d.ts +0 -1465
  256. package/node_modules/@alanszp/errors/node_modules/@types/node/timers/promises.d.ts +0 -93
  257. package/node_modules/@alanszp/errors/node_modules/@types/node/timers.d.ts +0 -240
  258. package/node_modules/@alanszp/errors/node_modules/@types/node/tls.d.ts +0 -1210
  259. package/node_modules/@alanszp/errors/node_modules/@types/node/trace_events.d.ts +0 -182
  260. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  261. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  262. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  263. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  264. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  265. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  266. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  267. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  268. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  269. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  270. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  271. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  272. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  273. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  274. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  275. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  276. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  277. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  278. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  279. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  280. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  281. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  282. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  283. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  284. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  285. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  286. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  287. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  288. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  289. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  290. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  291. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  292. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  293. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  294. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  295. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  296. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  297. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  298. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  299. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  300. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  301. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  302. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  303. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  304. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  305. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  306. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  307. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  308. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  309. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  310. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  311. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  312. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  313. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  314. package/node_modules/@alanszp/errors/node_modules/@types/node/tty.d.ts +0 -208
  315. package/node_modules/@alanszp/errors/node_modules/@types/node/url.d.ts +0 -927
  316. package/node_modules/@alanszp/errors/node_modules/@types/node/util.d.ts +0 -2183
  317. package/node_modules/@alanszp/errors/node_modules/@types/node/v8.d.ts +0 -764
  318. package/node_modules/@alanszp/errors/node_modules/@types/node/vm.d.ts +0 -903
  319. package/node_modules/@alanszp/errors/node_modules/@types/node/wasi.d.ts +0 -179
  320. package/node_modules/@alanszp/errors/node_modules/@types/node/worker_threads.d.ts +0 -691
  321. package/node_modules/@alanszp/errors/node_modules/@types/node/zlib.d.ts +0 -517
  322. package/node_modules/@alanszp/errors/package.json +0 -33
  323. package/node_modules/@alanszp/errors/src/BaseError.ts +0 -14
  324. package/node_modules/@alanszp/errors/src/HttpRenderableError.ts +0 -5
  325. package/node_modules/@alanszp/errors/src/InternalServerError.ts +0 -32
  326. package/node_modules/@alanszp/errors/src/RenderableError.ts +0 -37
  327. package/node_modules/@alanszp/errors/src/index.ts +0 -4
  328. package/node_modules/@alanszp/errors/tsconfig.json +0 -15
  329. package/node_modules/@alanszp/express/.gitignore +0 -3
  330. package/node_modules/@alanszp/express/.npmignore +0 -3
  331. package/node_modules/@alanszp/express/LICENSE +0 -21
  332. package/node_modules/@alanszp/express/babel.config.js +0 -7
  333. package/node_modules/@alanszp/express/dist/helpers/getIp.d.ts +0 -2
  334. package/node_modules/@alanszp/express/dist/helpers/getIp.js +0 -9
  335. package/node_modules/@alanszp/express/dist/helpers/getIp.js.map +0 -1
  336. package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.d.ts +0 -2
  337. package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.js +0 -10
  338. package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.js.map +0 -1
  339. package/node_modules/@alanszp/express/dist/helpers/now.d.ts +0 -1
  340. package/node_modules/@alanszp/express/dist/helpers/now.js +0 -8
  341. package/node_modules/@alanszp/express/dist/helpers/now.js.map +0 -1
  342. package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.d.ts +0 -4
  343. package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.js +0 -32
  344. package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.js.map +0 -1
  345. package/node_modules/@alanszp/express/dist/index.d.ts +0 -10
  346. package/node_modules/@alanszp/express/dist/index.js +0 -23
  347. package/node_modules/@alanszp/express/dist/index.js.map +0 -1
  348. package/node_modules/@alanszp/express/dist/middlewares/accessLogger.d.ts +0 -3
  349. package/node_modules/@alanszp/express/dist/middlewares/accessLogger.js +0 -30
  350. package/node_modules/@alanszp/express/dist/middlewares/accessLogger.js.map +0 -1
  351. package/node_modules/@alanszp/express/dist/middlewares/auditLog.d.ts +0 -8
  352. package/node_modules/@alanszp/express/dist/middlewares/auditLog.js +0 -44
  353. package/node_modules/@alanszp/express/dist/middlewares/auditLog.js.map +0 -1
  354. package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.d.ts +0 -3
  355. package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.js +0 -45
  356. package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.js.map +0 -1
  357. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.d.ts +0 -25
  358. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.js +0 -115
  359. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.js.map +0 -1
  360. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.d.ts +0 -1
  361. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.js +0 -308
  362. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.js.map +0 -1
  363. package/node_modules/@alanszp/express/dist/middlewares/createContext.d.ts +0 -6
  364. package/node_modules/@alanszp/express/dist/middlewares/createContext.js +0 -35
  365. package/node_modules/@alanszp/express/dist/middlewares/createContext.js.map +0 -1
  366. package/node_modules/@alanszp/express/dist/middlewares/createContext.test.d.ts +0 -1
  367. package/node_modules/@alanszp/express/dist/middlewares/createContext.test.js +0 -50
  368. package/node_modules/@alanszp/express/dist/middlewares/createContext.test.js.map +0 -1
  369. package/node_modules/@alanszp/express/dist/middlewares/hasRoles.d.ts +0 -3
  370. package/node_modules/@alanszp/express/dist/middlewares/hasRoles.js +0 -21
  371. package/node_modules/@alanszp/express/dist/middlewares/hasRoles.js.map +0 -1
  372. package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.d.ts +0 -4
  373. package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.js +0 -22
  374. package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.js.map +0 -1
  375. package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.d.ts +0 -4
  376. package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.js +0 -10
  377. package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.js.map +0 -1
  378. package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.d.ts +0 -3
  379. package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.js +0 -9
  380. package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.js.map +0 -1
  381. package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.d.ts +0 -8
  382. package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.js +0 -30
  383. package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.js.map +0 -1
  384. package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.d.ts +0 -6
  385. package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.js +0 -26
  386. package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.js.map +0 -1
  387. package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.d.ts +0 -3
  388. package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.js +0 -21
  389. package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.js.map +0 -1
  390. package/node_modules/@alanszp/express/dist/test/setup.d.ts +0 -1
  391. package/node_modules/@alanszp/express/dist/test/setup.js +0 -5
  392. package/node_modules/@alanszp/express/dist/test/setup.js.map +0 -1
  393. package/node_modules/@alanszp/express/dist/test/setup.test.d.ts +0 -1
  394. package/node_modules/@alanszp/express/dist/test/setup.test.js +0 -14
  395. package/node_modules/@alanszp/express/dist/test/setup.test.js.map +0 -1
  396. package/node_modules/@alanszp/express/dist/types/AuthMethod.d.ts +0 -10
  397. package/node_modules/@alanszp/express/dist/types/AuthMethod.js +0 -3
  398. package/node_modules/@alanszp/express/dist/types/AuthMethod.js.map +0 -1
  399. package/node_modules/@alanszp/express/dist/types/GenericRequest.d.ts +0 -2
  400. package/node_modules/@alanszp/express/dist/types/GenericRequest.js +0 -3
  401. package/node_modules/@alanszp/express/dist/types/GenericRequest.js.map +0 -1
  402. package/node_modules/@alanszp/express/jest.config.js +0 -10
  403. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/LICENSE +0 -21
  404. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/README.md +0 -5
  405. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/index.d.ts +0 -93
  406. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/index.js +0 -37
  407. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/jasmineUtils.js +0 -282
  408. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/types.js +0 -1
  409. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/utils.js +0 -457
  410. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/package.json +0 -33
  411. package/node_modules/@alanszp/express/node_modules/@jest/types/LICENSE +0 -21
  412. package/node_modules/@alanszp/express/node_modules/@jest/types/README.md +0 -30
  413. package/node_modules/@alanszp/express/node_modules/@jest/types/build/Circus.js +0 -1
  414. package/node_modules/@alanszp/express/node_modules/@jest/types/build/Config.js +0 -1
  415. package/node_modules/@alanszp/express/node_modules/@jest/types/build/Global.js +0 -1
  416. package/node_modules/@alanszp/express/node_modules/@jest/types/build/TestResult.js +0 -1
  417. package/node_modules/@alanszp/express/node_modules/@jest/types/build/Transform.js +0 -1
  418. package/node_modules/@alanszp/express/node_modules/@jest/types/build/index.d.ts +0 -1166
  419. package/node_modules/@alanszp/express/node_modules/@jest/types/build/index.js +0 -1
  420. package/node_modules/@alanszp/express/node_modules/@jest/types/package.json +0 -38
  421. package/node_modules/@alanszp/express/node_modules/@types/jest/LICENSE +0 -21
  422. package/node_modules/@alanszp/express/node_modules/@types/jest/README.md +0 -17
  423. package/node_modules/@alanszp/express/node_modules/@types/jest/index.d.ts +0 -1608
  424. package/node_modules/@alanszp/express/node_modules/@types/jest/package.json +0 -159
  425. package/node_modules/@alanszp/express/node_modules/@types/node/LICENSE +0 -21
  426. package/node_modules/@alanszp/express/node_modules/@types/node/README.md +0 -15
  427. package/node_modules/@alanszp/express/node_modules/@types/node/assert/strict.d.ts +0 -8
  428. package/node_modules/@alanszp/express/node_modules/@types/node/assert.d.ts +0 -996
  429. package/node_modules/@alanszp/express/node_modules/@types/node/async_hooks.d.ts +0 -539
  430. package/node_modules/@alanszp/express/node_modules/@types/node/buffer.d.ts +0 -2362
  431. package/node_modules/@alanszp/express/node_modules/@types/node/child_process.d.ts +0 -1540
  432. package/node_modules/@alanszp/express/node_modules/@types/node/cluster.d.ts +0 -432
  433. package/node_modules/@alanszp/express/node_modules/@types/node/console.d.ts +0 -415
  434. package/node_modules/@alanszp/express/node_modules/@types/node/constants.d.ts +0 -19
  435. package/node_modules/@alanszp/express/node_modules/@types/node/crypto.d.ts +0 -4487
  436. package/node_modules/@alanszp/express/node_modules/@types/node/dgram.d.ts +0 -596
  437. package/node_modules/@alanszp/express/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  438. package/node_modules/@alanszp/express/node_modules/@types/node/dns/promises.d.ts +0 -425
  439. package/node_modules/@alanszp/express/node_modules/@types/node/dns.d.ts +0 -809
  440. package/node_modules/@alanszp/express/node_modules/@types/node/dom-events.d.ts +0 -122
  441. package/node_modules/@alanszp/express/node_modules/@types/node/domain.d.ts +0 -170
  442. package/node_modules/@alanszp/express/node_modules/@types/node/events.d.ts +0 -879
  443. package/node_modules/@alanszp/express/node_modules/@types/node/fs/promises.d.ts +0 -1239
  444. package/node_modules/@alanszp/express/node_modules/@types/node/fs.d.ts +0 -4311
  445. package/node_modules/@alanszp/express/node_modules/@types/node/globals.d.ts +0 -411
  446. package/node_modules/@alanszp/express/node_modules/@types/node/globals.global.d.ts +0 -1
  447. package/node_modules/@alanszp/express/node_modules/@types/node/http.d.ts +0 -1887
  448. package/node_modules/@alanszp/express/node_modules/@types/node/http2.d.ts +0 -2382
  449. package/node_modules/@alanszp/express/node_modules/@types/node/https.d.ts +0 -550
  450. package/node_modules/@alanszp/express/node_modules/@types/node/index.d.ts +0 -88
  451. package/node_modules/@alanszp/express/node_modules/@types/node/inspector.d.ts +0 -2747
  452. package/node_modules/@alanszp/express/node_modules/@types/node/module.d.ts +0 -315
  453. package/node_modules/@alanszp/express/node_modules/@types/node/net.d.ts +0 -949
  454. package/node_modules/@alanszp/express/node_modules/@types/node/os.d.ts +0 -478
  455. package/node_modules/@alanszp/express/node_modules/@types/node/package.json +0 -229
  456. package/node_modules/@alanszp/express/node_modules/@types/node/path.d.ts +0 -191
  457. package/node_modules/@alanszp/express/node_modules/@types/node/perf_hooks.d.ts +0 -645
  458. package/node_modules/@alanszp/express/node_modules/@types/node/process.d.ts +0 -1561
  459. package/node_modules/@alanszp/express/node_modules/@types/node/punycode.d.ts +0 -117
  460. package/node_modules/@alanszp/express/node_modules/@types/node/querystring.d.ts +0 -141
  461. package/node_modules/@alanszp/express/node_modules/@types/node/readline/promises.d.ts +0 -150
  462. package/node_modules/@alanszp/express/node_modules/@types/node/readline.d.ts +0 -539
  463. package/node_modules/@alanszp/express/node_modules/@types/node/repl.d.ts +0 -430
  464. package/node_modules/@alanszp/express/node_modules/@types/node/stream/consumers.d.ts +0 -12
  465. package/node_modules/@alanszp/express/node_modules/@types/node/stream/promises.d.ts +0 -83
  466. package/node_modules/@alanszp/express/node_modules/@types/node/stream/web.d.ts +0 -366
  467. package/node_modules/@alanszp/express/node_modules/@types/node/stream.d.ts +0 -1701
  468. package/node_modules/@alanszp/express/node_modules/@types/node/string_decoder.d.ts +0 -67
  469. package/node_modules/@alanszp/express/node_modules/@types/node/test.d.ts +0 -1465
  470. package/node_modules/@alanszp/express/node_modules/@types/node/timers/promises.d.ts +0 -93
  471. package/node_modules/@alanszp/express/node_modules/@types/node/timers.d.ts +0 -240
  472. package/node_modules/@alanszp/express/node_modules/@types/node/tls.d.ts +0 -1210
  473. package/node_modules/@alanszp/express/node_modules/@types/node/trace_events.d.ts +0 -182
  474. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  475. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  476. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  477. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  478. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  479. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  480. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  481. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  482. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  483. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  484. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  485. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  486. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  487. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  488. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  489. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  490. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  491. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  492. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  493. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  494. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  495. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  496. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  497. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  498. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  499. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  500. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  501. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  502. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  503. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  504. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  505. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  506. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  507. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  508. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  509. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  510. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  511. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  512. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  513. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  514. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  515. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  516. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  517. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  518. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  519. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  520. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  521. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  522. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  523. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  524. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  525. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  526. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  527. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  528. package/node_modules/@alanszp/express/node_modules/@types/node/tty.d.ts +0 -208
  529. package/node_modules/@alanszp/express/node_modules/@types/node/url.d.ts +0 -927
  530. package/node_modules/@alanszp/express/node_modules/@types/node/util.d.ts +0 -2183
  531. package/node_modules/@alanszp/express/node_modules/@types/node/v8.d.ts +0 -764
  532. package/node_modules/@alanszp/express/node_modules/@types/node/vm.d.ts +0 -903
  533. package/node_modules/@alanszp/express/node_modules/@types/node/wasi.d.ts +0 -179
  534. package/node_modules/@alanszp/express/node_modules/@types/node/worker_threads.d.ts +0 -691
  535. package/node_modules/@alanszp/express/node_modules/@types/node/zlib.d.ts +0 -517
  536. package/node_modules/@alanszp/express/package.json +0 -49
  537. package/node_modules/@alanszp/express/src/helpers/getIp.ts +0 -5
  538. package/node_modules/@alanszp/express/src/helpers/getRequestLogger.ts +0 -6
  539. package/node_modules/@alanszp/express/src/helpers/now.ts +0 -3
  540. package/node_modules/@alanszp/express/src/helpers/renderErrorJson.ts +0 -29
  541. package/node_modules/@alanszp/express/src/index.ts +0 -10
  542. package/node_modules/@alanszp/express/src/middlewares/accessLogger.ts +0 -34
  543. package/node_modules/@alanszp/express/src/middlewares/auditLog.ts +0 -52
  544. package/node_modules/@alanszp/express/src/middlewares/authedForOrg.ts +0 -50
  545. package/node_modules/@alanszp/express/src/middlewares/authenticateUser.test.ts +0 -403
  546. package/node_modules/@alanszp/express/src/middlewares/authenticateUser.ts +0 -171
  547. package/node_modules/@alanszp/express/src/middlewares/createContext.test.ts +0 -85
  548. package/node_modules/@alanszp/express/src/middlewares/createContext.ts +0 -49
  549. package/node_modules/@alanszp/express/src/middlewares/hasRoles.ts +0 -24
  550. package/node_modules/@alanszp/express/src/middlewares/jsonBodyParser.ts +0 -22
  551. package/node_modules/@alanszp/express/src/middlewares/returnInternalServerError.ts +0 -15
  552. package/node_modules/@alanszp/express/src/middlewares/returnNotFound.ts +0 -11
  553. package/node_modules/@alanszp/express/src/test/mocks/authOptionsMocks.ts +0 -35
  554. package/node_modules/@alanszp/express/src/test/mocks/expressMocks.ts +0 -33
  555. package/node_modules/@alanszp/express/src/test/mocks/jwtUserMocks.ts +0 -19
  556. package/node_modules/@alanszp/express/src/test/setup.test.ts +0 -15
  557. package/node_modules/@alanszp/express/src/test/setup.ts +0 -3
  558. package/node_modules/@alanszp/express/src/types/AuthMethod.ts +0 -27
  559. package/node_modules/@alanszp/express/src/types/GenericRequest.ts +0 -3
  560. package/node_modules/@alanszp/express/src/types/custom.d.ts +0 -20
  561. package/node_modules/@alanszp/express/tsconfig.json +0 -18
  562. package/node_modules/@alanszp/jwt/.gitignore +0 -3
  563. package/node_modules/@alanszp/jwt/.npmignore +0 -3
  564. package/node_modules/@alanszp/jwt/LICENSE +0 -21
  565. package/node_modules/@alanszp/jwt/dist/JWTUser.d.ts +0 -31
  566. package/node_modules/@alanszp/jwt/dist/JWTUser.js +0 -62
  567. package/node_modules/@alanszp/jwt/dist/JWTUser.js.map +0 -1
  568. package/node_modules/@alanszp/jwt/dist/index.d.ts +0 -3
  569. package/node_modules/@alanszp/jwt/dist/index.js +0 -16
  570. package/node_modules/@alanszp/jwt/dist/index.js.map +0 -1
  571. package/node_modules/@alanszp/jwt/dist/jwt.d.ts +0 -11
  572. package/node_modules/@alanszp/jwt/dist/jwt.js +0 -67
  573. package/node_modules/@alanszp/jwt/dist/jwt.js.map +0 -1
  574. package/node_modules/@alanszp/jwt/dist/types.d.ts +0 -26
  575. package/node_modules/@alanszp/jwt/dist/types.js +0 -3
  576. package/node_modules/@alanszp/jwt/dist/types.js.map +0 -1
  577. package/node_modules/@alanszp/jwt/node_modules/@types/node/LICENSE +0 -21
  578. package/node_modules/@alanszp/jwt/node_modules/@types/node/README.md +0 -15
  579. package/node_modules/@alanszp/jwt/node_modules/@types/node/assert/strict.d.ts +0 -8
  580. package/node_modules/@alanszp/jwt/node_modules/@types/node/assert.d.ts +0 -996
  581. package/node_modules/@alanszp/jwt/node_modules/@types/node/async_hooks.d.ts +0 -539
  582. package/node_modules/@alanszp/jwt/node_modules/@types/node/buffer.d.ts +0 -2362
  583. package/node_modules/@alanszp/jwt/node_modules/@types/node/child_process.d.ts +0 -1540
  584. package/node_modules/@alanszp/jwt/node_modules/@types/node/cluster.d.ts +0 -432
  585. package/node_modules/@alanszp/jwt/node_modules/@types/node/console.d.ts +0 -415
  586. package/node_modules/@alanszp/jwt/node_modules/@types/node/constants.d.ts +0 -19
  587. package/node_modules/@alanszp/jwt/node_modules/@types/node/crypto.d.ts +0 -4487
  588. package/node_modules/@alanszp/jwt/node_modules/@types/node/dgram.d.ts +0 -596
  589. package/node_modules/@alanszp/jwt/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  590. package/node_modules/@alanszp/jwt/node_modules/@types/node/dns/promises.d.ts +0 -425
  591. package/node_modules/@alanszp/jwt/node_modules/@types/node/dns.d.ts +0 -809
  592. package/node_modules/@alanszp/jwt/node_modules/@types/node/dom-events.d.ts +0 -122
  593. package/node_modules/@alanszp/jwt/node_modules/@types/node/domain.d.ts +0 -170
  594. package/node_modules/@alanszp/jwt/node_modules/@types/node/events.d.ts +0 -879
  595. package/node_modules/@alanszp/jwt/node_modules/@types/node/fs/promises.d.ts +0 -1239
  596. package/node_modules/@alanszp/jwt/node_modules/@types/node/fs.d.ts +0 -4311
  597. package/node_modules/@alanszp/jwt/node_modules/@types/node/globals.d.ts +0 -411
  598. package/node_modules/@alanszp/jwt/node_modules/@types/node/globals.global.d.ts +0 -1
  599. package/node_modules/@alanszp/jwt/node_modules/@types/node/http.d.ts +0 -1887
  600. package/node_modules/@alanszp/jwt/node_modules/@types/node/http2.d.ts +0 -2382
  601. package/node_modules/@alanszp/jwt/node_modules/@types/node/https.d.ts +0 -550
  602. package/node_modules/@alanszp/jwt/node_modules/@types/node/index.d.ts +0 -88
  603. package/node_modules/@alanszp/jwt/node_modules/@types/node/inspector.d.ts +0 -2747
  604. package/node_modules/@alanszp/jwt/node_modules/@types/node/module.d.ts +0 -315
  605. package/node_modules/@alanszp/jwt/node_modules/@types/node/net.d.ts +0 -949
  606. package/node_modules/@alanszp/jwt/node_modules/@types/node/os.d.ts +0 -478
  607. package/node_modules/@alanszp/jwt/node_modules/@types/node/package.json +0 -229
  608. package/node_modules/@alanszp/jwt/node_modules/@types/node/path.d.ts +0 -191
  609. package/node_modules/@alanszp/jwt/node_modules/@types/node/perf_hooks.d.ts +0 -645
  610. package/node_modules/@alanszp/jwt/node_modules/@types/node/process.d.ts +0 -1561
  611. package/node_modules/@alanszp/jwt/node_modules/@types/node/punycode.d.ts +0 -117
  612. package/node_modules/@alanszp/jwt/node_modules/@types/node/querystring.d.ts +0 -141
  613. package/node_modules/@alanszp/jwt/node_modules/@types/node/readline/promises.d.ts +0 -150
  614. package/node_modules/@alanszp/jwt/node_modules/@types/node/readline.d.ts +0 -539
  615. package/node_modules/@alanszp/jwt/node_modules/@types/node/repl.d.ts +0 -430
  616. package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/consumers.d.ts +0 -12
  617. package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/promises.d.ts +0 -83
  618. package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/web.d.ts +0 -366
  619. package/node_modules/@alanszp/jwt/node_modules/@types/node/stream.d.ts +0 -1701
  620. package/node_modules/@alanszp/jwt/node_modules/@types/node/string_decoder.d.ts +0 -67
  621. package/node_modules/@alanszp/jwt/node_modules/@types/node/test.d.ts +0 -1465
  622. package/node_modules/@alanszp/jwt/node_modules/@types/node/timers/promises.d.ts +0 -93
  623. package/node_modules/@alanszp/jwt/node_modules/@types/node/timers.d.ts +0 -240
  624. package/node_modules/@alanszp/jwt/node_modules/@types/node/tls.d.ts +0 -1210
  625. package/node_modules/@alanszp/jwt/node_modules/@types/node/trace_events.d.ts +0 -182
  626. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  627. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  628. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  629. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  630. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  631. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  632. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  633. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  634. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  635. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  636. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  637. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  638. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  639. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  640. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  641. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  642. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  643. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  644. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  645. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  646. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  647. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  648. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  649. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  650. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  651. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  652. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  653. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  654. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  655. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  656. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  657. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  658. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  659. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  660. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  661. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  662. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  663. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  664. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  665. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  666. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  667. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  668. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  669. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  670. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  671. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  672. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  673. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  674. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  675. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  676. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  677. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  678. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  679. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  680. package/node_modules/@alanszp/jwt/node_modules/@types/node/tty.d.ts +0 -208
  681. package/node_modules/@alanszp/jwt/node_modules/@types/node/url.d.ts +0 -927
  682. package/node_modules/@alanszp/jwt/node_modules/@types/node/util.d.ts +0 -2183
  683. package/node_modules/@alanszp/jwt/node_modules/@types/node/v8.d.ts +0 -764
  684. package/node_modules/@alanszp/jwt/node_modules/@types/node/vm.d.ts +0 -903
  685. package/node_modules/@alanszp/jwt/node_modules/@types/node/wasi.d.ts +0 -179
  686. package/node_modules/@alanszp/jwt/node_modules/@types/node/worker_threads.d.ts +0 -691
  687. package/node_modules/@alanszp/jwt/node_modules/@types/node/zlib.d.ts +0 -517
  688. package/node_modules/@alanszp/jwt/package.json +0 -29
  689. package/node_modules/@alanszp/jwt/src/JWTUser.ts +0 -85
  690. package/node_modules/@alanszp/jwt/src/index.ts +0 -3
  691. package/node_modules/@alanszp/jwt/src/jwt.ts +0 -81
  692. package/node_modules/@alanszp/jwt/src/types.ts +0 -31
  693. package/node_modules/@alanszp/jwt/tsconfig.json +0 -15
  694. package/node_modules/@alanszp/logger/.gitignore +0 -3
  695. package/node_modules/@alanszp/logger/.npmignore +0 -3
  696. package/node_modules/@alanszp/logger/LICENSE +0 -21
  697. package/node_modules/@alanszp/logger/dist/config.d.ts +0 -28
  698. package/node_modules/@alanszp/logger/dist/config.js +0 -3
  699. package/node_modules/@alanszp/logger/dist/config.js.map +0 -1
  700. package/node_modules/@alanszp/logger/dist/factory.d.ts +0 -5
  701. package/node_modules/@alanszp/logger/dist/factory.js +0 -55
  702. package/node_modules/@alanszp/logger/dist/factory.js.map +0 -1
  703. package/node_modules/@alanszp/logger/dist/index.d.ts +0 -5
  704. package/node_modules/@alanszp/logger/dist/index.js +0 -20
  705. package/node_modules/@alanszp/logger/dist/index.js.map +0 -1
  706. package/node_modules/@alanszp/logger/dist/interfaces.d.ts +0 -23
  707. package/node_modules/@alanszp/logger/dist/interfaces.js +0 -18
  708. package/node_modules/@alanszp/logger/dist/interfaces.js.map +0 -1
  709. package/node_modules/@alanszp/logger/dist/logger.d.ts +0 -14
  710. package/node_modules/@alanszp/logger/dist/logger.js +0 -45
  711. package/node_modules/@alanszp/logger/dist/logger.js.map +0 -1
  712. package/node_modules/@alanszp/logger/dist/mock.d.ts +0 -11
  713. package/node_modules/@alanszp/logger/dist/mock.js +0 -32
  714. package/node_modules/@alanszp/logger/dist/mock.js.map +0 -1
  715. package/node_modules/@alanszp/logger/dist/serializer.d.ts +0 -5
  716. package/node_modules/@alanszp/logger/dist/serializer.js +0 -67
  717. package/node_modules/@alanszp/logger/dist/serializer.js.map +0 -1
  718. package/node_modules/@alanszp/logger/dist/slackBunyan.d.ts +0 -16
  719. package/node_modules/@alanszp/logger/dist/slackBunyan.js +0 -108
  720. package/node_modules/@alanszp/logger/dist/slackBunyan.js.map +0 -1
  721. package/node_modules/@alanszp/logger/node_modules/@types/node/LICENSE +0 -21
  722. package/node_modules/@alanszp/logger/node_modules/@types/node/README.md +0 -15
  723. package/node_modules/@alanszp/logger/node_modules/@types/node/assert/strict.d.ts +0 -8
  724. package/node_modules/@alanszp/logger/node_modules/@types/node/assert.d.ts +0 -996
  725. package/node_modules/@alanszp/logger/node_modules/@types/node/async_hooks.d.ts +0 -539
  726. package/node_modules/@alanszp/logger/node_modules/@types/node/buffer.d.ts +0 -2362
  727. package/node_modules/@alanszp/logger/node_modules/@types/node/child_process.d.ts +0 -1540
  728. package/node_modules/@alanszp/logger/node_modules/@types/node/cluster.d.ts +0 -432
  729. package/node_modules/@alanszp/logger/node_modules/@types/node/console.d.ts +0 -415
  730. package/node_modules/@alanszp/logger/node_modules/@types/node/constants.d.ts +0 -19
  731. package/node_modules/@alanszp/logger/node_modules/@types/node/crypto.d.ts +0 -4487
  732. package/node_modules/@alanszp/logger/node_modules/@types/node/dgram.d.ts +0 -596
  733. package/node_modules/@alanszp/logger/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  734. package/node_modules/@alanszp/logger/node_modules/@types/node/dns/promises.d.ts +0 -425
  735. package/node_modules/@alanszp/logger/node_modules/@types/node/dns.d.ts +0 -809
  736. package/node_modules/@alanszp/logger/node_modules/@types/node/dom-events.d.ts +0 -122
  737. package/node_modules/@alanszp/logger/node_modules/@types/node/domain.d.ts +0 -170
  738. package/node_modules/@alanszp/logger/node_modules/@types/node/events.d.ts +0 -879
  739. package/node_modules/@alanszp/logger/node_modules/@types/node/fs/promises.d.ts +0 -1239
  740. package/node_modules/@alanszp/logger/node_modules/@types/node/fs.d.ts +0 -4311
  741. package/node_modules/@alanszp/logger/node_modules/@types/node/globals.d.ts +0 -411
  742. package/node_modules/@alanszp/logger/node_modules/@types/node/globals.global.d.ts +0 -1
  743. package/node_modules/@alanszp/logger/node_modules/@types/node/http.d.ts +0 -1887
  744. package/node_modules/@alanszp/logger/node_modules/@types/node/http2.d.ts +0 -2382
  745. package/node_modules/@alanszp/logger/node_modules/@types/node/https.d.ts +0 -550
  746. package/node_modules/@alanszp/logger/node_modules/@types/node/index.d.ts +0 -88
  747. package/node_modules/@alanszp/logger/node_modules/@types/node/inspector.d.ts +0 -2747
  748. package/node_modules/@alanszp/logger/node_modules/@types/node/module.d.ts +0 -315
  749. package/node_modules/@alanszp/logger/node_modules/@types/node/net.d.ts +0 -949
  750. package/node_modules/@alanszp/logger/node_modules/@types/node/os.d.ts +0 -478
  751. package/node_modules/@alanszp/logger/node_modules/@types/node/package.json +0 -229
  752. package/node_modules/@alanszp/logger/node_modules/@types/node/path.d.ts +0 -191
  753. package/node_modules/@alanszp/logger/node_modules/@types/node/perf_hooks.d.ts +0 -645
  754. package/node_modules/@alanszp/logger/node_modules/@types/node/process.d.ts +0 -1561
  755. package/node_modules/@alanszp/logger/node_modules/@types/node/punycode.d.ts +0 -117
  756. package/node_modules/@alanszp/logger/node_modules/@types/node/querystring.d.ts +0 -141
  757. package/node_modules/@alanszp/logger/node_modules/@types/node/readline/promises.d.ts +0 -150
  758. package/node_modules/@alanszp/logger/node_modules/@types/node/readline.d.ts +0 -539
  759. package/node_modules/@alanszp/logger/node_modules/@types/node/repl.d.ts +0 -430
  760. package/node_modules/@alanszp/logger/node_modules/@types/node/stream/consumers.d.ts +0 -12
  761. package/node_modules/@alanszp/logger/node_modules/@types/node/stream/promises.d.ts +0 -83
  762. package/node_modules/@alanszp/logger/node_modules/@types/node/stream/web.d.ts +0 -366
  763. package/node_modules/@alanszp/logger/node_modules/@types/node/stream.d.ts +0 -1701
  764. package/node_modules/@alanszp/logger/node_modules/@types/node/string_decoder.d.ts +0 -67
  765. package/node_modules/@alanszp/logger/node_modules/@types/node/test.d.ts +0 -1465
  766. package/node_modules/@alanszp/logger/node_modules/@types/node/timers/promises.d.ts +0 -93
  767. package/node_modules/@alanszp/logger/node_modules/@types/node/timers.d.ts +0 -240
  768. package/node_modules/@alanszp/logger/node_modules/@types/node/tls.d.ts +0 -1210
  769. package/node_modules/@alanszp/logger/node_modules/@types/node/trace_events.d.ts +0 -182
  770. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  771. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  772. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  773. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  774. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  775. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  776. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  777. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  778. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  779. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  780. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  781. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  782. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  783. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  784. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  785. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  786. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  787. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  788. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  789. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  790. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  791. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  792. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  793. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  794. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  795. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  796. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  797. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  798. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  799. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  800. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  801. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  802. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  803. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  804. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  805. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  806. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  807. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  808. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  809. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  810. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  811. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  812. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  813. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  814. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  815. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  816. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  817. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  818. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  819. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  820. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  821. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  822. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  823. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  824. package/node_modules/@alanszp/logger/node_modules/@types/node/tty.d.ts +0 -208
  825. package/node_modules/@alanszp/logger/node_modules/@types/node/url.d.ts +0 -927
  826. package/node_modules/@alanszp/logger/node_modules/@types/node/util.d.ts +0 -2183
  827. package/node_modules/@alanszp/logger/node_modules/@types/node/v8.d.ts +0 -764
  828. package/node_modules/@alanszp/logger/node_modules/@types/node/vm.d.ts +0 -903
  829. package/node_modules/@alanszp/logger/node_modules/@types/node/wasi.d.ts +0 -179
  830. package/node_modules/@alanszp/logger/node_modules/@types/node/worker_threads.d.ts +0 -691
  831. package/node_modules/@alanszp/logger/node_modules/@types/node/zlib.d.ts +0 -517
  832. package/node_modules/@alanszp/logger/package.json +0 -35
  833. package/node_modules/@alanszp/logger/src/config.ts +0 -34
  834. package/node_modules/@alanszp/logger/src/factory.ts +0 -68
  835. package/node_modules/@alanszp/logger/src/index.ts +0 -5
  836. package/node_modules/@alanszp/logger/src/interfaces.ts +0 -26
  837. package/node_modules/@alanszp/logger/src/logger.ts +0 -54
  838. package/node_modules/@alanszp/logger/src/mock.ts +0 -35
  839. package/node_modules/@alanszp/logger/src/serializer.ts +0 -65
  840. package/node_modules/@alanszp/logger/src/slackBunyan.ts +0 -133
  841. package/node_modules/@alanszp/logger/tsconfig.json +0 -15
  842. package/node_modules/@types/node/LICENSE +0 -21
  843. package/node_modules/@types/node/README.md +0 -15
  844. package/node_modules/@types/node/assert/strict.d.ts +0 -8
  845. package/node_modules/@types/node/assert.d.ts +0 -996
  846. package/node_modules/@types/node/async_hooks.d.ts +0 -539
  847. package/node_modules/@types/node/buffer.d.ts +0 -2362
  848. package/node_modules/@types/node/child_process.d.ts +0 -1540
  849. package/node_modules/@types/node/cluster.d.ts +0 -432
  850. package/node_modules/@types/node/console.d.ts +0 -415
  851. package/node_modules/@types/node/constants.d.ts +0 -19
  852. package/node_modules/@types/node/crypto.d.ts +0 -4487
  853. package/node_modules/@types/node/dgram.d.ts +0 -596
  854. package/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  855. package/node_modules/@types/node/dns/promises.d.ts +0 -425
  856. package/node_modules/@types/node/dns.d.ts +0 -809
  857. package/node_modules/@types/node/dom-events.d.ts +0 -122
  858. package/node_modules/@types/node/domain.d.ts +0 -170
  859. package/node_modules/@types/node/events.d.ts +0 -879
  860. package/node_modules/@types/node/fs/promises.d.ts +0 -1239
  861. package/node_modules/@types/node/fs.d.ts +0 -4311
  862. package/node_modules/@types/node/globals.d.ts +0 -411
  863. package/node_modules/@types/node/globals.global.d.ts +0 -1
  864. package/node_modules/@types/node/http.d.ts +0 -1887
  865. package/node_modules/@types/node/http2.d.ts +0 -2382
  866. package/node_modules/@types/node/https.d.ts +0 -550
  867. package/node_modules/@types/node/index.d.ts +0 -88
  868. package/node_modules/@types/node/inspector.d.ts +0 -2747
  869. package/node_modules/@types/node/module.d.ts +0 -315
  870. package/node_modules/@types/node/net.d.ts +0 -949
  871. package/node_modules/@types/node/os.d.ts +0 -478
  872. package/node_modules/@types/node/package.json +0 -229
  873. package/node_modules/@types/node/path.d.ts +0 -191
  874. package/node_modules/@types/node/perf_hooks.d.ts +0 -645
  875. package/node_modules/@types/node/process.d.ts +0 -1561
  876. package/node_modules/@types/node/punycode.d.ts +0 -117
  877. package/node_modules/@types/node/querystring.d.ts +0 -141
  878. package/node_modules/@types/node/readline/promises.d.ts +0 -150
  879. package/node_modules/@types/node/readline.d.ts +0 -539
  880. package/node_modules/@types/node/repl.d.ts +0 -430
  881. package/node_modules/@types/node/stream/consumers.d.ts +0 -12
  882. package/node_modules/@types/node/stream/promises.d.ts +0 -83
  883. package/node_modules/@types/node/stream/web.d.ts +0 -366
  884. package/node_modules/@types/node/stream.d.ts +0 -1701
  885. package/node_modules/@types/node/string_decoder.d.ts +0 -67
  886. package/node_modules/@types/node/test.d.ts +0 -1465
  887. package/node_modules/@types/node/timers/promises.d.ts +0 -93
  888. package/node_modules/@types/node/timers.d.ts +0 -240
  889. package/node_modules/@types/node/tls.d.ts +0 -1210
  890. package/node_modules/@types/node/trace_events.d.ts +0 -182
  891. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  892. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  893. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  894. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  895. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  896. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  897. package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  898. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  899. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  900. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  901. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  902. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  903. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  904. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  905. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  906. package/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  907. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  908. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  909. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  910. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  911. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  912. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  913. package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  914. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  915. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  916. package/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  917. package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  918. package/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  919. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  920. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  921. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  922. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  923. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  924. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  925. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  926. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  927. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  928. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  929. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  930. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  931. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  932. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  933. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  934. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  935. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  936. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  937. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  938. package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  939. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  940. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  941. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  942. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  943. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  944. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  945. package/node_modules/@types/node/tty.d.ts +0 -208
  946. package/node_modules/@types/node/url.d.ts +0 -927
  947. package/node_modules/@types/node/util.d.ts +0 -2183
  948. package/node_modules/@types/node/v8.d.ts +0 -764
  949. package/node_modules/@types/node/vm.d.ts +0 -903
  950. package/node_modules/@types/node/wasi.d.ts +0 -179
  951. package/node_modules/@types/node/worker_threads.d.ts +0 -691
  952. package/node_modules/@types/node/zlib.d.ts +0 -517
  953. package/src/commonErrorsHandler.ts +0 -105
  954. package/src/index.ts +0 -1
@@ -1,2362 +0,0 @@
1
- /**
2
- * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
3
- * Node.js APIs support `Buffer`s.
4
- *
5
- * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and
6
- * extends it with methods that cover additional use cases. Node.js APIs accept
7
- * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well.
8
- *
9
- * While the `Buffer` class is available within the global scope, it is still
10
- * recommended to explicitly reference it via an import or require statement.
11
- *
12
- * ```js
13
- * import { Buffer } from 'node:buffer';
14
- *
15
- * // Creates a zero-filled Buffer of length 10.
16
- * const buf1 = Buffer.alloc(10);
17
- *
18
- * // Creates a Buffer of length 10,
19
- * // filled with bytes which all have the value `1`.
20
- * const buf2 = Buffer.alloc(10, 1);
21
- *
22
- * // Creates an uninitialized buffer of length 10.
23
- * // This is faster than calling Buffer.alloc() but the returned
24
- * // Buffer instance might contain old data that needs to be
25
- * // overwritten using fill(), write(), or other functions that fill the Buffer's
26
- * // contents.
27
- * const buf3 = Buffer.allocUnsafe(10);
28
- *
29
- * // Creates a Buffer containing the bytes [1, 2, 3].
30
- * const buf4 = Buffer.from([1, 2, 3]);
31
- *
32
- * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries
33
- * // are all truncated using `(value & 255)` to fit into the range 0–255.
34
- * const buf5 = Buffer.from([257, 257.5, -255, '1']);
35
- *
36
- * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':
37
- * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)
38
- * // [116, 195, 169, 115, 116] (in decimal notation)
39
- * const buf6 = Buffer.from('tést');
40
- *
41
- * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
42
- * const buf7 = Buffer.from('tést', 'latin1');
43
- * ```
44
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/buffer.js)
45
- */
46
- declare module "buffer" {
47
- import { BinaryLike } from "node:crypto";
48
- import { ReadableStream as WebReadableStream } from "node:stream/web";
49
- /**
50
- * This function returns `true` if `input` contains only valid UTF-8-encoded data,
51
- * including the case in which `input` is empty.
52
- *
53
- * Throws if the `input` is a detached array buffer.
54
- * @since v19.4.0, v18.14.0
55
- * @param input The input to validate.
56
- */
57
- export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
58
- /**
59
- * This function returns `true` if `input` contains only valid ASCII-encoded data,
60
- * including the case in which `input` is empty.
61
- *
62
- * Throws if the `input` is a detached array buffer.
63
- * @since v19.6.0, v18.15.0
64
- * @param input The input to validate.
65
- */
66
- export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
67
- export const INSPECT_MAX_BYTES: number;
68
- export const kMaxLength: number;
69
- export const kStringMaxLength: number;
70
- export const constants: {
71
- MAX_LENGTH: number;
72
- MAX_STRING_LENGTH: number;
73
- };
74
- export type TranscodeEncoding =
75
- | "ascii"
76
- | "utf8"
77
- | "utf-8"
78
- | "utf16le"
79
- | "utf-16le"
80
- | "ucs2"
81
- | "ucs-2"
82
- | "latin1"
83
- | "binary";
84
- /**
85
- * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
86
- * encoding to another. Returns a new `Buffer` instance.
87
- *
88
- * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if
89
- * conversion from `fromEnc` to `toEnc` is not permitted.
90
- *
91
- * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`.
92
- *
93
- * The transcoding process will use substitution characters if a given byte
94
- * sequence cannot be adequately represented in the target encoding. For instance:
95
- *
96
- * ```js
97
- * import { Buffer, transcode } from 'node:buffer';
98
- *
99
- * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii');
100
- * console.log(newBuf.toString('ascii'));
101
- * // Prints: '?'
102
- * ```
103
- *
104
- * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced
105
- * with `?` in the transcoded `Buffer`.
106
- * @since v7.1.0
107
- * @param source A `Buffer` or `Uint8Array` instance.
108
- * @param fromEnc The current encoding.
109
- * @param toEnc To target encoding.
110
- */
111
- export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
112
- export const SlowBuffer: {
113
- /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
114
- new(size: number): Buffer;
115
- prototype: Buffer;
116
- };
117
- /**
118
- * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
119
- * a prior call to `URL.createObjectURL()`.
120
- * @since v16.7.0
121
- * @experimental
122
- * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
123
- */
124
- export function resolveObjectURL(id: string): Blob | undefined;
125
- export { Buffer };
126
- /**
127
- * @experimental
128
- */
129
- export interface BlobOptions {
130
- /**
131
- * @default 'utf8'
132
- */
133
- encoding?: BufferEncoding | undefined;
134
- /**
135
- * The Blob content-type. The intent is for `type` to convey
136
- * the MIME media type of the data, however no validation of the type format
137
- * is performed.
138
- */
139
- type?: string | undefined;
140
- }
141
- /**
142
- * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
143
- * multiple worker threads.
144
- * @since v15.7.0, v14.18.0
145
- */
146
- export class Blob {
147
- /**
148
- * The total size of the `Blob` in bytes.
149
- * @since v15.7.0, v14.18.0
150
- */
151
- readonly size: number;
152
- /**
153
- * The content-type of the `Blob`.
154
- * @since v15.7.0, v14.18.0
155
- */
156
- readonly type: string;
157
- /**
158
- * Creates a new `Blob` object containing a concatenation of the given sources.
159
- *
160
- * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
161
- * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
162
- *
163
- * String sources are also copied into the `Blob`.
164
- */
165
- constructor(sources: Array<BinaryLike | Blob>, options?: BlobOptions);
166
- /**
167
- * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
168
- * the `Blob` data.
169
- * @since v15.7.0, v14.18.0
170
- */
171
- arrayBuffer(): Promise<ArrayBuffer>;
172
- /**
173
- * Creates and returns a new `Blob` containing a subset of this `Blob` objects
174
- * data. The original `Blob` is not altered.
175
- * @since v15.7.0, v14.18.0
176
- * @param start The starting index.
177
- * @param end The ending index.
178
- * @param type The content-type for the new `Blob`
179
- */
180
- slice(start?: number, end?: number, type?: string): Blob;
181
- /**
182
- * Returns a promise that fulfills with the contents of the `Blob` decoded as a
183
- * UTF-8 string.
184
- * @since v15.7.0, v14.18.0
185
- */
186
- text(): Promise<string>;
187
- /**
188
- * Returns a new `ReadableStream` that allows the content of the `Blob` to be read.
189
- * @since v16.7.0
190
- */
191
- stream(): WebReadableStream;
192
- }
193
- export interface FileOptions {
194
- /**
195
- * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
196
- * converted to the platform native line-ending as specified by `require('node:os').EOL`.
197
- */
198
- endings?: "native" | "transparent";
199
- /** The File content-type. */
200
- type?: string;
201
- /** The last modified date of the file. `Default`: Date.now(). */
202
- lastModified?: number;
203
- }
204
- /**
205
- * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
206
- * @since v19.2.0, v18.13.0
207
- */
208
- export class File extends Blob {
209
- constructor(sources: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
210
- /**
211
- * The name of the `File`.
212
- * @since v19.2.0, v18.13.0
213
- */
214
- readonly name: string;
215
- /**
216
- * The last modified date of the `File`.
217
- * @since v19.2.0, v18.13.0
218
- */
219
- readonly lastModified: number;
220
- }
221
- export import atob = globalThis.atob;
222
- export import btoa = globalThis.btoa;
223
- import { Blob as NodeBlob } from "buffer";
224
- // This conditional type will be the existing global Blob in a browser, or
225
- // the copy below in a Node environment.
226
- type __Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : NodeBlob;
227
- global {
228
- namespace NodeJS {
229
- export { BufferEncoding };
230
- }
231
- // Buffer class
232
- type BufferEncoding =
233
- | "ascii"
234
- | "utf8"
235
- | "utf-8"
236
- | "utf16le"
237
- | "utf-16le"
238
- | "ucs2"
239
- | "ucs-2"
240
- | "base64"
241
- | "base64url"
242
- | "latin1"
243
- | "binary"
244
- | "hex";
245
- type WithImplicitCoercion<T> =
246
- | T
247
- | {
248
- valueOf(): T;
249
- };
250
- /**
251
- * Raw data is stored in instances of the Buffer class.
252
- * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
253
- * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex'
254
- */
255
- interface BufferConstructor {
256
- /**
257
- * Allocates a new buffer containing the given {str}.
258
- *
259
- * @param str String to store in buffer.
260
- * @param encoding encoding to use, optional. Default is 'utf8'
261
- * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
262
- */
263
- new(str: string, encoding?: BufferEncoding): Buffer;
264
- /**
265
- * Allocates a new buffer of {size} octets.
266
- *
267
- * @param size count of octets to allocate.
268
- * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
269
- */
270
- new(size: number): Buffer;
271
- /**
272
- * Allocates a new buffer containing the given {array} of octets.
273
- *
274
- * @param array The octets to store.
275
- * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
276
- */
277
- new(array: Uint8Array): Buffer;
278
- /**
279
- * Produces a Buffer backed by the same allocated memory as
280
- * the given {ArrayBuffer}/{SharedArrayBuffer}.
281
- *
282
- * @param arrayBuffer The ArrayBuffer with which to share memory.
283
- * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
284
- */
285
- new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
286
- /**
287
- * Allocates a new buffer containing the given {array} of octets.
288
- *
289
- * @param array The octets to store.
290
- * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
291
- */
292
- new(array: readonly any[]): Buffer;
293
- /**
294
- * Copies the passed {buffer} data onto a new {Buffer} instance.
295
- *
296
- * @param buffer The buffer to copy.
297
- * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
298
- */
299
- new(buffer: Buffer): Buffer;
300
- /**
301
- * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
302
- * Array entries outside that range will be truncated to fit into it.
303
- *
304
- * ```js
305
- * import { Buffer } from 'node:buffer';
306
- *
307
- * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
308
- * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
309
- * ```
310
- *
311
- * If `array` is an `Array`\-like object (that is, one with a `length` property of
312
- * type `number`), it is treated as if it is an array, unless it is a `Buffer` or
313
- * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`.
314
- *
315
- * A `TypeError` will be thrown if `array` is not an `Array` or another type
316
- * appropriate for `Buffer.from()` variants.
317
- *
318
- * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
319
- * @since v5.10.0
320
- */
321
- from(
322
- arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
323
- byteOffset?: number,
324
- length?: number,
325
- ): Buffer;
326
- /**
327
- * Creates a new Buffer using the passed {data}
328
- * @param data data to create a new Buffer
329
- */
330
- from(data: Uint8Array | readonly number[]): Buffer;
331
- from(data: WithImplicitCoercion<Uint8Array | readonly number[] | string>): Buffer;
332
- /**
333
- * Creates a new Buffer containing the given JavaScript string {str}.
334
- * If provided, the {encoding} parameter identifies the character encoding.
335
- * If not provided, {encoding} defaults to 'utf8'.
336
- */
337
- from(
338
- str:
339
- | WithImplicitCoercion<string>
340
- | {
341
- [Symbol.toPrimitive](hint: "string"): string;
342
- },
343
- encoding?: BufferEncoding,
344
- ): Buffer;
345
- /**
346
- * Creates a new Buffer using the passed {data}
347
- * @param values to create a new Buffer
348
- */
349
- of(...items: number[]): Buffer;
350
- /**
351
- * Returns `true` if `obj` is a `Buffer`, `false` otherwise.
352
- *
353
- * ```js
354
- * import { Buffer } from 'node:buffer';
355
- *
356
- * Buffer.isBuffer(Buffer.alloc(10)); // true
357
- * Buffer.isBuffer(Buffer.from('foo')); // true
358
- * Buffer.isBuffer('a string'); // false
359
- * Buffer.isBuffer([]); // false
360
- * Buffer.isBuffer(new Uint8Array(1024)); // false
361
- * ```
362
- * @since v0.1.101
363
- */
364
- isBuffer(obj: any): obj is Buffer;
365
- /**
366
- * Returns `true` if `encoding` is the name of a supported character encoding,
367
- * or `false` otherwise.
368
- *
369
- * ```js
370
- * import { Buffer } from 'node:buffer';
371
- *
372
- * console.log(Buffer.isEncoding('utf8'));
373
- * // Prints: true
374
- *
375
- * console.log(Buffer.isEncoding('hex'));
376
- * // Prints: true
377
- *
378
- * console.log(Buffer.isEncoding('utf/8'));
379
- * // Prints: false
380
- *
381
- * console.log(Buffer.isEncoding(''));
382
- * // Prints: false
383
- * ```
384
- * @since v0.9.1
385
- * @param encoding A character encoding name to check.
386
- */
387
- isEncoding(encoding: string): encoding is BufferEncoding;
388
- /**
389
- * Returns the byte length of a string when encoded using `encoding`.
390
- * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account
391
- * for the encoding that is used to convert the string into bytes.
392
- *
393
- * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input.
394
- * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the
395
- * return value might be greater than the length of a `Buffer` created from the
396
- * string.
397
- *
398
- * ```js
399
- * import { Buffer } from 'node:buffer';
400
- *
401
- * const str = '\u00bd + \u00bc = \u00be';
402
- *
403
- * console.log(`${str}: ${str.length} characters, ` +
404
- * `${Buffer.byteLength(str, 'utf8')} bytes`);
405
- * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes
406
- * ```
407
- *
408
- * When `string` is a
409
- * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/-
410
- * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop-
411
- * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned.
412
- * @since v0.1.90
413
- * @param string A value to calculate the length of.
414
- * @param [encoding='utf8'] If `string` is a string, this is its encoding.
415
- * @return The number of bytes contained within `string`.
416
- */
417
- byteLength(
418
- string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
419
- encoding?: BufferEncoding,
420
- ): number;
421
- /**
422
- * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
423
- *
424
- * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned.
425
- *
426
- * If `totalLength` is not provided, it is calculated from the `Buffer` instances
427
- * in `list` by adding their lengths.
428
- *
429
- * If `totalLength` is provided, it is coerced to an unsigned integer. If the
430
- * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
431
- * truncated to `totalLength`.
432
- *
433
- * ```js
434
- * import { Buffer } from 'node:buffer';
435
- *
436
- * // Create a single `Buffer` from a list of three `Buffer` instances.
437
- *
438
- * const buf1 = Buffer.alloc(10);
439
- * const buf2 = Buffer.alloc(14);
440
- * const buf3 = Buffer.alloc(18);
441
- * const totalLength = buf1.length + buf2.length + buf3.length;
442
- *
443
- * console.log(totalLength);
444
- * // Prints: 42
445
- *
446
- * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);
447
- *
448
- * console.log(bufA);
449
- * // Prints: <Buffer 00 00 00 00 ...>
450
- * console.log(bufA.length);
451
- * // Prints: 42
452
- * ```
453
- *
454
- * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
455
- * @since v0.7.11
456
- * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate.
457
- * @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
458
- */
459
- concat(list: readonly Uint8Array[], totalLength?: number): Buffer;
460
- /**
461
- * Copies the underlying memory of `view` into a new `Buffer`.
462
- *
463
- * ```js
464
- * const u16 = new Uint16Array([0, 0xffff]);
465
- * const buf = Buffer.copyBytesFrom(u16, 1, 1);
466
- * u16[1] = 0;
467
- * console.log(buf.length); // 2
468
- * console.log(buf[0]); // 255
469
- * console.log(buf[1]); // 255
470
- * ```
471
- * @since v19.8.0
472
- * @param view The {TypedArray} to copy.
473
- * @param [offset=': 0'] The starting offset within `view`.
474
- * @param [length=view.length - offset] The number of elements from `view` to copy.
475
- */
476
- copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer;
477
- /**
478
- * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`.
479
- *
480
- * ```js
481
- * import { Buffer } from 'node:buffer';
482
- *
483
- * const buf1 = Buffer.from('1234');
484
- * const buf2 = Buffer.from('0123');
485
- * const arr = [buf1, buf2];
486
- *
487
- * console.log(arr.sort(Buffer.compare));
488
- * // Prints: [ <Buffer 30 31 32 33>, <Buffer 31 32 33 34> ]
489
- * // (This result is equal to: [buf2, buf1].)
490
- * ```
491
- * @since v0.11.13
492
- * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details.
493
- */
494
- compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1;
495
- /**
496
- * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
497
- *
498
- * ```js
499
- * import { Buffer } from 'node:buffer';
500
- *
501
- * const buf = Buffer.alloc(5);
502
- *
503
- * console.log(buf);
504
- * // Prints: <Buffer 00 00 00 00 00>
505
- * ```
506
- *
507
- * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
508
- *
509
- * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
510
- *
511
- * ```js
512
- * import { Buffer } from 'node:buffer';
513
- *
514
- * const buf = Buffer.alloc(5, 'a');
515
- *
516
- * console.log(buf);
517
- * // Prints: <Buffer 61 61 61 61 61>
518
- * ```
519
- *
520
- * If both `fill` and `encoding` are specified, the allocated `Buffer` will be
521
- * initialized by calling `buf.fill(fill, encoding)`.
522
- *
523
- * ```js
524
- * import { Buffer } from 'node:buffer';
525
- *
526
- * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
527
- *
528
- * console.log(buf);
529
- * // Prints: <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
530
- * ```
531
- *
532
- * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance
533
- * contents will never contain sensitive data from previous allocations, including
534
- * data that might not have been allocated for `Buffer`s.
535
- *
536
- * A `TypeError` will be thrown if `size` is not a number.
537
- * @since v5.10.0
538
- * @param size The desired length of the new `Buffer`.
539
- * @param [fill=0] A value to pre-fill the new `Buffer` with.
540
- * @param [encoding='utf8'] If `fill` is a string, this is its encoding.
541
- */
542
- alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer;
543
- /**
544
- * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
545
- *
546
- * The underlying memory for `Buffer` instances created in this way is _not_
547
- * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
548
- *
549
- * ```js
550
- * import { Buffer } from 'node:buffer';
551
- *
552
- * const buf = Buffer.allocUnsafe(10);
553
- *
554
- * console.log(buf);
555
- * // Prints (contents may vary): <Buffer a0 8b 28 3f 01 00 00 00 50 32>
556
- *
557
- * buf.fill(0);
558
- *
559
- * console.log(buf);
560
- * // Prints: <Buffer 00 00 00 00 00 00 00 00 00 00>
561
- * ```
562
- *
563
- * A `TypeError` will be thrown if `size` is not a number.
564
- *
565
- * The `Buffer` module pre-allocates an internal `Buffer` instance of
566
- * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
567
- * and `Buffer.concat()` only when `size` is less than`Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two).
568
- *
569
- * Use of this pre-allocated internal memory pool is a key difference between
570
- * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
571
- * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less
572
- * than or equal to half `Buffer.poolSize`. The
573
- * difference is subtle but can be important when an application requires the
574
- * additional performance that `Buffer.allocUnsafe()` provides.
575
- * @since v5.10.0
576
- * @param size The desired length of the new `Buffer`.
577
- */
578
- allocUnsafe(size: number): Buffer;
579
- /**
580
- * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if
581
- * `size` is 0.
582
- *
583
- * The underlying memory for `Buffer` instances created in this way is _not_
584
- * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize
585
- * such `Buffer` instances with zeroes.
586
- *
587
- * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
588
- * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This
589
- * allows applications to avoid the garbage collection overhead of creating many
590
- * individually allocated `Buffer` instances. This approach improves both
591
- * performance and memory usage by eliminating the need to track and clean up as
592
- * many individual `ArrayBuffer` objects.
593
- *
594
- * However, in the case where a developer may need to retain a small chunk of
595
- * memory from a pool for an indeterminate amount of time, it may be appropriate
596
- * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and
597
- * then copying out the relevant bits.
598
- *
599
- * ```js
600
- * import { Buffer } from 'node:buffer';
601
- *
602
- * // Need to keep around a few small chunks of memory.
603
- * const store = [];
604
- *
605
- * socket.on('readable', () => {
606
- * let data;
607
- * while (null !== (data = readable.read())) {
608
- * // Allocate for retained data.
609
- * const sb = Buffer.allocUnsafeSlow(10);
610
- *
611
- * // Copy the data into the new allocation.
612
- * data.copy(sb, 0, 0, 10);
613
- *
614
- * store.push(sb);
615
- * }
616
- * });
617
- * ```
618
- *
619
- * A `TypeError` will be thrown if `size` is not a number.
620
- * @since v5.12.0
621
- * @param size The desired length of the new `Buffer`.
622
- */
623
- allocUnsafeSlow(size: number): Buffer;
624
- /**
625
- * This is the size (in bytes) of pre-allocated internal `Buffer` instances used
626
- * for pooling. This value may be modified.
627
- * @since v0.11.3
628
- */
629
- poolSize: number;
630
- }
631
- interface Buffer extends Uint8Array {
632
- /**
633
- * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did
634
- * not contain enough space to fit the entire string, only part of `string` will be
635
- * written. However, partially encoded characters will not be written.
636
- *
637
- * ```js
638
- * import { Buffer } from 'node:buffer';
639
- *
640
- * const buf = Buffer.alloc(256);
641
- *
642
- * const len = buf.write('\u00bd + \u00bc = \u00be', 0);
643
- *
644
- * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
645
- * // Prints: 12 bytes: ½ + ¼ = ¾
646
- *
647
- * const buffer = Buffer.alloc(10);
648
- *
649
- * const length = buffer.write('abcd', 8);
650
- *
651
- * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);
652
- * // Prints: 2 bytes : ab
653
- * ```
654
- * @since v0.1.90
655
- * @param string String to write to `buf`.
656
- * @param [offset=0] Number of bytes to skip before starting to write `string`.
657
- * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`).
658
- * @param [encoding='utf8'] The character encoding of `string`.
659
- * @return Number of bytes written.
660
- */
661
- write(string: string, encoding?: BufferEncoding): number;
662
- write(string: string, offset: number, encoding?: BufferEncoding): number;
663
- write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
664
- /**
665
- * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`.
666
- *
667
- * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8,
668
- * then each invalid byte is replaced with the replacement character `U+FFFD`.
669
- *
670
- * The maximum length of a string instance (in UTF-16 code units) is available
671
- * as {@link constants.MAX_STRING_LENGTH}.
672
- *
673
- * ```js
674
- * import { Buffer } from 'node:buffer';
675
- *
676
- * const buf1 = Buffer.allocUnsafe(26);
677
- *
678
- * for (let i = 0; i < 26; i++) {
679
- * // 97 is the decimal ASCII value for 'a'.
680
- * buf1[i] = i + 97;
681
- * }
682
- *
683
- * console.log(buf1.toString('utf8'));
684
- * // Prints: abcdefghijklmnopqrstuvwxyz
685
- * console.log(buf1.toString('utf8', 0, 5));
686
- * // Prints: abcde
687
- *
688
- * const buf2 = Buffer.from('tést');
689
- *
690
- * console.log(buf2.toString('hex'));
691
- * // Prints: 74c3a97374
692
- * console.log(buf2.toString('utf8', 0, 3));
693
- * // Prints: té
694
- * console.log(buf2.toString(undefined, 0, 3));
695
- * // Prints: té
696
- * ```
697
- * @since v0.1.90
698
- * @param [encoding='utf8'] The character encoding to use.
699
- * @param [start=0] The byte offset to start decoding at.
700
- * @param [end=buf.length] The byte offset to stop decoding at (not inclusive).
701
- */
702
- toString(encoding?: BufferEncoding, start?: number, end?: number): string;
703
- /**
704
- * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls
705
- * this function when stringifying a `Buffer` instance.
706
- *
707
- * `Buffer.from()` accepts objects in the format returned from this method.
708
- * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`.
709
- *
710
- * ```js
711
- * import { Buffer } from 'node:buffer';
712
- *
713
- * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);
714
- * const json = JSON.stringify(buf);
715
- *
716
- * console.log(json);
717
- * // Prints: {"type":"Buffer","data":[1,2,3,4,5]}
718
- *
719
- * const copy = JSON.parse(json, (key, value) => {
720
- * return value &#x26;&#x26; value.type === 'Buffer' ?
721
- * Buffer.from(value) :
722
- * value;
723
- * });
724
- *
725
- * console.log(copy);
726
- * // Prints: <Buffer 01 02 03 04 05>
727
- * ```
728
- * @since v0.9.2
729
- */
730
- toJSON(): {
731
- type: "Buffer";
732
- data: number[];
733
- };
734
- /**
735
- * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`.
736
- *
737
- * ```js
738
- * import { Buffer } from 'node:buffer';
739
- *
740
- * const buf1 = Buffer.from('ABC');
741
- * const buf2 = Buffer.from('414243', 'hex');
742
- * const buf3 = Buffer.from('ABCD');
743
- *
744
- * console.log(buf1.equals(buf2));
745
- * // Prints: true
746
- * console.log(buf1.equals(buf3));
747
- * // Prints: false
748
- * ```
749
- * @since v0.11.13
750
- * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`.
751
- */
752
- equals(otherBuffer: Uint8Array): boolean;
753
- /**
754
- * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order.
755
- * Comparison is based on the actual sequence of bytes in each `Buffer`.
756
- *
757
- * * `0` is returned if `target` is the same as `buf`
758
- * * `1` is returned if `target` should come _before_`buf` when sorted.
759
- * * `-1` is returned if `target` should come _after_`buf` when sorted.
760
- *
761
- * ```js
762
- * import { Buffer } from 'node:buffer';
763
- *
764
- * const buf1 = Buffer.from('ABC');
765
- * const buf2 = Buffer.from('BCD');
766
- * const buf3 = Buffer.from('ABCD');
767
- *
768
- * console.log(buf1.compare(buf1));
769
- * // Prints: 0
770
- * console.log(buf1.compare(buf2));
771
- * // Prints: -1
772
- * console.log(buf1.compare(buf3));
773
- * // Prints: -1
774
- * console.log(buf2.compare(buf1));
775
- * // Prints: 1
776
- * console.log(buf2.compare(buf3));
777
- * // Prints: 1
778
- * console.log([buf1, buf2, buf3].sort(Buffer.compare));
779
- * // Prints: [ <Buffer 41 42 43>, <Buffer 41 42 43 44>, <Buffer 42 43 44> ]
780
- * // (This result is equal to: [buf1, buf3, buf2].)
781
- * ```
782
- *
783
- * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively.
784
- *
785
- * ```js
786
- * import { Buffer } from 'node:buffer';
787
- *
788
- * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);
789
- * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);
790
- *
791
- * console.log(buf1.compare(buf2, 5, 9, 0, 4));
792
- * // Prints: 0
793
- * console.log(buf1.compare(buf2, 0, 6, 4));
794
- * // Prints: -1
795
- * console.log(buf1.compare(buf2, 5, 6, 5));
796
- * // Prints: 1
797
- * ```
798
- *
799
- * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`.
800
- * @since v0.11.13
801
- * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`.
802
- * @param [targetStart=0] The offset within `target` at which to begin comparison.
803
- * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive).
804
- * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
805
- * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
806
- */
807
- compare(
808
- target: Uint8Array,
809
- targetStart?: number,
810
- targetEnd?: number,
811
- sourceStart?: number,
812
- sourceEnd?: number,
813
- ): -1 | 0 | 1;
814
- /**
815
- * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
816
- *
817
- * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available
818
- * for all TypedArrays, including Node.js `Buffer`s, although it takes
819
- * different function arguments.
820
- *
821
- * ```js
822
- * import { Buffer } from 'node:buffer';
823
- *
824
- * // Create two `Buffer` instances.
825
- * const buf1 = Buffer.allocUnsafe(26);
826
- * const buf2 = Buffer.allocUnsafe(26).fill('!');
827
- *
828
- * for (let i = 0; i < 26; i++) {
829
- * // 97 is the decimal ASCII value for 'a'.
830
- * buf1[i] = i + 97;
831
- * }
832
- *
833
- * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.
834
- * buf1.copy(buf2, 8, 16, 20);
835
- * // This is equivalent to:
836
- * // buf2.set(buf1.subarray(16, 20), 8);
837
- *
838
- * console.log(buf2.toString('ascii', 0, 25));
839
- * // Prints: !!!!!!!!qrst!!!!!!!!!!!!!
840
- * ```
841
- *
842
- * ```js
843
- * import { Buffer } from 'node:buffer';
844
- *
845
- * // Create a `Buffer` and copy data from one region to an overlapping region
846
- * // within the same `Buffer`.
847
- *
848
- * const buf = Buffer.allocUnsafe(26);
849
- *
850
- * for (let i = 0; i < 26; i++) {
851
- * // 97 is the decimal ASCII value for 'a'.
852
- * buf[i] = i + 97;
853
- * }
854
- *
855
- * buf.copy(buf, 0, 4, 10);
856
- *
857
- * console.log(buf.toString());
858
- * // Prints: efghijghijklmnopqrstuvwxyz
859
- * ```
860
- * @since v0.1.90
861
- * @param target A `Buffer` or {@link Uint8Array} to copy into.
862
- * @param [targetStart=0] The offset within `target` at which to begin writing.
863
- * @param [sourceStart=0] The offset within `buf` from which to begin copying.
864
- * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive).
865
- * @return The number of bytes copied.
866
- */
867
- copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
868
- /**
869
- * Returns a new `Buffer` that references the same memory as the original, but
870
- * offset and cropped by the `start` and `end` indices.
871
- *
872
- * This method is not compatible with the `Uint8Array.prototype.slice()`,
873
- * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
874
- *
875
- * ```js
876
- * import { Buffer } from 'node:buffer';
877
- *
878
- * const buf = Buffer.from('buffer');
879
- *
880
- * const copiedBuf = Uint8Array.prototype.slice.call(buf);
881
- * copiedBuf[0]++;
882
- * console.log(copiedBuf.toString());
883
- * // Prints: cuffer
884
- *
885
- * console.log(buf.toString());
886
- * // Prints: buffer
887
- *
888
- * // With buf.slice(), the original buffer is modified.
889
- * const notReallyCopiedBuf = buf.slice();
890
- * notReallyCopiedBuf[0]++;
891
- * console.log(notReallyCopiedBuf.toString());
892
- * // Prints: cuffer
893
- * console.log(buf.toString());
894
- * // Also prints: cuffer (!)
895
- * ```
896
- * @since v0.3.0
897
- * @deprecated Use `subarray` instead.
898
- * @param [start=0] Where the new `Buffer` will start.
899
- * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
900
- */
901
- slice(start?: number, end?: number): Buffer;
902
- /**
903
- * Returns a new `Buffer` that references the same memory as the original, but
904
- * offset and cropped by the `start` and `end` indices.
905
- *
906
- * Specifying `end` greater than `buf.length` will return the same result as
907
- * that of `end` equal to `buf.length`.
908
- *
909
- * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray).
910
- *
911
- * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
912
- *
913
- * ```js
914
- * import { Buffer } from 'node:buffer';
915
- *
916
- * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
917
- * // from the original `Buffer`.
918
- *
919
- * const buf1 = Buffer.allocUnsafe(26);
920
- *
921
- * for (let i = 0; i < 26; i++) {
922
- * // 97 is the decimal ASCII value for 'a'.
923
- * buf1[i] = i + 97;
924
- * }
925
- *
926
- * const buf2 = buf1.subarray(0, 3);
927
- *
928
- * console.log(buf2.toString('ascii', 0, buf2.length));
929
- * // Prints: abc
930
- *
931
- * buf1[0] = 33;
932
- *
933
- * console.log(buf2.toString('ascii', 0, buf2.length));
934
- * // Prints: !bc
935
- * ```
936
- *
937
- * Specifying negative indexes causes the slice to be generated relative to the
938
- * end of `buf` rather than the beginning.
939
- *
940
- * ```js
941
- * import { Buffer } from 'node:buffer';
942
- *
943
- * const buf = Buffer.from('buffer');
944
- *
945
- * console.log(buf.subarray(-6, -1).toString());
946
- * // Prints: buffe
947
- * // (Equivalent to buf.subarray(0, 5).)
948
- *
949
- * console.log(buf.subarray(-6, -2).toString());
950
- * // Prints: buff
951
- * // (Equivalent to buf.subarray(0, 4).)
952
- *
953
- * console.log(buf.subarray(-5, -2).toString());
954
- * // Prints: uff
955
- * // (Equivalent to buf.subarray(1, 4).)
956
- * ```
957
- * @since v3.0.0
958
- * @param [start=0] Where the new `Buffer` will start.
959
- * @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
960
- */
961
- subarray(start?: number, end?: number): Buffer;
962
- /**
963
- * Writes `value` to `buf` at the specified `offset` as big-endian.
964
- *
965
- * `value` is interpreted and written as a two's complement signed integer.
966
- *
967
- * ```js
968
- * import { Buffer } from 'node:buffer';
969
- *
970
- * const buf = Buffer.allocUnsafe(8);
971
- *
972
- * buf.writeBigInt64BE(0x0102030405060708n, 0);
973
- *
974
- * console.log(buf);
975
- * // Prints: <Buffer 01 02 03 04 05 06 07 08>
976
- * ```
977
- * @since v12.0.0, v10.20.0
978
- * @param value Number to be written to `buf`.
979
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
980
- * @return `offset` plus the number of bytes written.
981
- */
982
- writeBigInt64BE(value: bigint, offset?: number): number;
983
- /**
984
- * Writes `value` to `buf` at the specified `offset` as little-endian.
985
- *
986
- * `value` is interpreted and written as a two's complement signed integer.
987
- *
988
- * ```js
989
- * import { Buffer } from 'node:buffer';
990
- *
991
- * const buf = Buffer.allocUnsafe(8);
992
- *
993
- * buf.writeBigInt64LE(0x0102030405060708n, 0);
994
- *
995
- * console.log(buf);
996
- * // Prints: <Buffer 08 07 06 05 04 03 02 01>
997
- * ```
998
- * @since v12.0.0, v10.20.0
999
- * @param value Number to be written to `buf`.
1000
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
1001
- * @return `offset` plus the number of bytes written.
1002
- */
1003
- writeBigInt64LE(value: bigint, offset?: number): number;
1004
- /**
1005
- * Writes `value` to `buf` at the specified `offset` as big-endian.
1006
- *
1007
- * This function is also available under the `writeBigUint64BE` alias.
1008
- *
1009
- * ```js
1010
- * import { Buffer } from 'node:buffer';
1011
- *
1012
- * const buf = Buffer.allocUnsafe(8);
1013
- *
1014
- * buf.writeBigUInt64BE(0xdecafafecacefaden, 0);
1015
- *
1016
- * console.log(buf);
1017
- * // Prints: <Buffer de ca fa fe ca ce fa de>
1018
- * ```
1019
- * @since v12.0.0, v10.20.0
1020
- * @param value Number to be written to `buf`.
1021
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
1022
- * @return `offset` plus the number of bytes written.
1023
- */
1024
- writeBigUInt64BE(value: bigint, offset?: number): number;
1025
- /**
1026
- * @alias Buffer.writeBigUInt64BE
1027
- * @since v14.10.0, v12.19.0
1028
- */
1029
- writeBigUint64BE(value: bigint, offset?: number): number;
1030
- /**
1031
- * Writes `value` to `buf` at the specified `offset` as little-endian
1032
- *
1033
- * ```js
1034
- * import { Buffer } from 'node:buffer';
1035
- *
1036
- * const buf = Buffer.allocUnsafe(8);
1037
- *
1038
- * buf.writeBigUInt64LE(0xdecafafecacefaden, 0);
1039
- *
1040
- * console.log(buf);
1041
- * // Prints: <Buffer de fa ce ca fe fa ca de>
1042
- * ```
1043
- *
1044
- * This function is also available under the `writeBigUint64LE` alias.
1045
- * @since v12.0.0, v10.20.0
1046
- * @param value Number to be written to `buf`.
1047
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.
1048
- * @return `offset` plus the number of bytes written.
1049
- */
1050
- writeBigUInt64LE(value: bigint, offset?: number): number;
1051
- /**
1052
- * @alias Buffer.writeBigUInt64LE
1053
- * @since v14.10.0, v12.19.0
1054
- */
1055
- writeBigUint64LE(value: bigint, offset?: number): number;
1056
- /**
1057
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
1058
- * when `value` is anything other than an unsigned integer.
1059
- *
1060
- * This function is also available under the `writeUintLE` alias.
1061
- *
1062
- * ```js
1063
- * import { Buffer } from 'node:buffer';
1064
- *
1065
- * const buf = Buffer.allocUnsafe(6);
1066
- *
1067
- * buf.writeUIntLE(0x1234567890ab, 0, 6);
1068
- *
1069
- * console.log(buf);
1070
- * // Prints: <Buffer ab 90 78 56 34 12>
1071
- * ```
1072
- * @since v0.5.5
1073
- * @param value Number to be written to `buf`.
1074
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
1075
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
1076
- * @return `offset` plus the number of bytes written.
1077
- */
1078
- writeUIntLE(value: number, offset: number, byteLength: number): number;
1079
- /**
1080
- * @alias Buffer.writeUIntLE
1081
- * @since v14.9.0, v12.19.0
1082
- */
1083
- writeUintLE(value: number, offset: number, byteLength: number): number;
1084
- /**
1085
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined
1086
- * when `value` is anything other than an unsigned integer.
1087
- *
1088
- * This function is also available under the `writeUintBE` alias.
1089
- *
1090
- * ```js
1091
- * import { Buffer } from 'node:buffer';
1092
- *
1093
- * const buf = Buffer.allocUnsafe(6);
1094
- *
1095
- * buf.writeUIntBE(0x1234567890ab, 0, 6);
1096
- *
1097
- * console.log(buf);
1098
- * // Prints: <Buffer 12 34 56 78 90 ab>
1099
- * ```
1100
- * @since v0.5.5
1101
- * @param value Number to be written to `buf`.
1102
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
1103
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
1104
- * @return `offset` plus the number of bytes written.
1105
- */
1106
- writeUIntBE(value: number, offset: number, byteLength: number): number;
1107
- /**
1108
- * @alias Buffer.writeUIntBE
1109
- * @since v14.9.0, v12.19.0
1110
- */
1111
- writeUintBE(value: number, offset: number, byteLength: number): number;
1112
- /**
1113
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined
1114
- * when `value` is anything other than a signed integer.
1115
- *
1116
- * ```js
1117
- * import { Buffer } from 'node:buffer';
1118
- *
1119
- * const buf = Buffer.allocUnsafe(6);
1120
- *
1121
- * buf.writeIntLE(0x1234567890ab, 0, 6);
1122
- *
1123
- * console.log(buf);
1124
- * // Prints: <Buffer ab 90 78 56 34 12>
1125
- * ```
1126
- * @since v0.11.15
1127
- * @param value Number to be written to `buf`.
1128
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
1129
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
1130
- * @return `offset` plus the number of bytes written.
1131
- */
1132
- writeIntLE(value: number, offset: number, byteLength: number): number;
1133
- /**
1134
- * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a
1135
- * signed integer.
1136
- *
1137
- * ```js
1138
- * import { Buffer } from 'node:buffer';
1139
- *
1140
- * const buf = Buffer.allocUnsafe(6);
1141
- *
1142
- * buf.writeIntBE(0x1234567890ab, 0, 6);
1143
- *
1144
- * console.log(buf);
1145
- * // Prints: <Buffer 12 34 56 78 90 ab>
1146
- * ```
1147
- * @since v0.11.15
1148
- * @param value Number to be written to `buf`.
1149
- * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
1150
- * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`.
1151
- * @return `offset` plus the number of bytes written.
1152
- */
1153
- writeIntBE(value: number, offset: number, byteLength: number): number;
1154
- /**
1155
- * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`.
1156
- *
1157
- * This function is also available under the `readBigUint64BE` alias.
1158
- *
1159
- * ```js
1160
- * import { Buffer } from 'node:buffer';
1161
- *
1162
- * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
1163
- *
1164
- * console.log(buf.readBigUInt64BE(0));
1165
- * // Prints: 4294967295n
1166
- * ```
1167
- * @since v12.0.0, v10.20.0
1168
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
1169
- */
1170
- readBigUInt64BE(offset?: number): bigint;
1171
- /**
1172
- * @alias Buffer.readBigUInt64BE
1173
- * @since v14.10.0, v12.19.0
1174
- */
1175
- readBigUint64BE(offset?: number): bigint;
1176
- /**
1177
- * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`.
1178
- *
1179
- * This function is also available under the `readBigUint64LE` alias.
1180
- *
1181
- * ```js
1182
- * import { Buffer } from 'node:buffer';
1183
- *
1184
- * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);
1185
- *
1186
- * console.log(buf.readBigUInt64LE(0));
1187
- * // Prints: 18446744069414584320n
1188
- * ```
1189
- * @since v12.0.0, v10.20.0
1190
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
1191
- */
1192
- readBigUInt64LE(offset?: number): bigint;
1193
- /**
1194
- * @alias Buffer.readBigUInt64LE
1195
- * @since v14.10.0, v12.19.0
1196
- */
1197
- readBigUint64LE(offset?: number): bigint;
1198
- /**
1199
- * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`.
1200
- *
1201
- * Integers read from a `Buffer` are interpreted as two's complement signed
1202
- * values.
1203
- * @since v12.0.0, v10.20.0
1204
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
1205
- */
1206
- readBigInt64BE(offset?: number): bigint;
1207
- /**
1208
- * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`.
1209
- *
1210
- * Integers read from a `Buffer` are interpreted as two's complement signed
1211
- * values.
1212
- * @since v12.0.0, v10.20.0
1213
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.
1214
- */
1215
- readBigInt64LE(offset?: number): bigint;
1216
- /**
1217
- * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting
1218
- * up to 48 bits of accuracy.
1219
- *
1220
- * This function is also available under the `readUintLE` alias.
1221
- *
1222
- * ```js
1223
- * import { Buffer } from 'node:buffer';
1224
- *
1225
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
1226
- *
1227
- * console.log(buf.readUIntLE(0, 6).toString(16));
1228
- * // Prints: ab9078563412
1229
- * ```
1230
- * @since v0.11.15
1231
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
1232
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
1233
- */
1234
- readUIntLE(offset: number, byteLength: number): number;
1235
- /**
1236
- * @alias Buffer.readUIntLE
1237
- * @since v14.9.0, v12.19.0
1238
- */
1239
- readUintLE(offset: number, byteLength: number): number;
1240
- /**
1241
- * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting
1242
- * up to 48 bits of accuracy.
1243
- *
1244
- * This function is also available under the `readUintBE` alias.
1245
- *
1246
- * ```js
1247
- * import { Buffer } from 'node:buffer';
1248
- *
1249
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
1250
- *
1251
- * console.log(buf.readUIntBE(0, 6).toString(16));
1252
- * // Prints: 1234567890ab
1253
- * console.log(buf.readUIntBE(1, 6).toString(16));
1254
- * // Throws ERR_OUT_OF_RANGE.
1255
- * ```
1256
- * @since v0.11.15
1257
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
1258
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
1259
- */
1260
- readUIntBE(offset: number, byteLength: number): number;
1261
- /**
1262
- * @alias Buffer.readUIntBE
1263
- * @since v14.9.0, v12.19.0
1264
- */
1265
- readUintBE(offset: number, byteLength: number): number;
1266
- /**
1267
- * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value
1268
- * supporting up to 48 bits of accuracy.
1269
- *
1270
- * ```js
1271
- * import { Buffer } from 'node:buffer';
1272
- *
1273
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
1274
- *
1275
- * console.log(buf.readIntLE(0, 6).toString(16));
1276
- * // Prints: -546f87a9cbee
1277
- * ```
1278
- * @since v0.11.15
1279
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
1280
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
1281
- */
1282
- readIntLE(offset: number, byteLength: number): number;
1283
- /**
1284
- * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value
1285
- * supporting up to 48 bits of accuracy.
1286
- *
1287
- * ```js
1288
- * import { Buffer } from 'node:buffer';
1289
- *
1290
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);
1291
- *
1292
- * console.log(buf.readIntBE(0, 6).toString(16));
1293
- * // Prints: 1234567890ab
1294
- * console.log(buf.readIntBE(1, 6).toString(16));
1295
- * // Throws ERR_OUT_OF_RANGE.
1296
- * console.log(buf.readIntBE(1, 0).toString(16));
1297
- * // Throws ERR_OUT_OF_RANGE.
1298
- * ```
1299
- * @since v0.11.15
1300
- * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.
1301
- * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`.
1302
- */
1303
- readIntBE(offset: number, byteLength: number): number;
1304
- /**
1305
- * Reads an unsigned 8-bit integer from `buf` at the specified `offset`.
1306
- *
1307
- * This function is also available under the `readUint8` alias.
1308
- *
1309
- * ```js
1310
- * import { Buffer } from 'node:buffer';
1311
- *
1312
- * const buf = Buffer.from([1, -2]);
1313
- *
1314
- * console.log(buf.readUInt8(0));
1315
- * // Prints: 1
1316
- * console.log(buf.readUInt8(1));
1317
- * // Prints: 254
1318
- * console.log(buf.readUInt8(2));
1319
- * // Throws ERR_OUT_OF_RANGE.
1320
- * ```
1321
- * @since v0.5.0
1322
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
1323
- */
1324
- readUInt8(offset?: number): number;
1325
- /**
1326
- * @alias Buffer.readUInt8
1327
- * @since v14.9.0, v12.19.0
1328
- */
1329
- readUint8(offset?: number): number;
1330
- /**
1331
- * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`.
1332
- *
1333
- * This function is also available under the `readUint16LE` alias.
1334
- *
1335
- * ```js
1336
- * import { Buffer } from 'node:buffer';
1337
- *
1338
- * const buf = Buffer.from([0x12, 0x34, 0x56]);
1339
- *
1340
- * console.log(buf.readUInt16LE(0).toString(16));
1341
- * // Prints: 3412
1342
- * console.log(buf.readUInt16LE(1).toString(16));
1343
- * // Prints: 5634
1344
- * console.log(buf.readUInt16LE(2).toString(16));
1345
- * // Throws ERR_OUT_OF_RANGE.
1346
- * ```
1347
- * @since v0.5.5
1348
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1349
- */
1350
- readUInt16LE(offset?: number): number;
1351
- /**
1352
- * @alias Buffer.readUInt16LE
1353
- * @since v14.9.0, v12.19.0
1354
- */
1355
- readUint16LE(offset?: number): number;
1356
- /**
1357
- * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`.
1358
- *
1359
- * This function is also available under the `readUint16BE` alias.
1360
- *
1361
- * ```js
1362
- * import { Buffer } from 'node:buffer';
1363
- *
1364
- * const buf = Buffer.from([0x12, 0x34, 0x56]);
1365
- *
1366
- * console.log(buf.readUInt16BE(0).toString(16));
1367
- * // Prints: 1234
1368
- * console.log(buf.readUInt16BE(1).toString(16));
1369
- * // Prints: 3456
1370
- * ```
1371
- * @since v0.5.5
1372
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1373
- */
1374
- readUInt16BE(offset?: number): number;
1375
- /**
1376
- * @alias Buffer.readUInt16BE
1377
- * @since v14.9.0, v12.19.0
1378
- */
1379
- readUint16BE(offset?: number): number;
1380
- /**
1381
- * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`.
1382
- *
1383
- * This function is also available under the `readUint32LE` alias.
1384
- *
1385
- * ```js
1386
- * import { Buffer } from 'node:buffer';
1387
- *
1388
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
1389
- *
1390
- * console.log(buf.readUInt32LE(0).toString(16));
1391
- * // Prints: 78563412
1392
- * console.log(buf.readUInt32LE(1).toString(16));
1393
- * // Throws ERR_OUT_OF_RANGE.
1394
- * ```
1395
- * @since v0.5.5
1396
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1397
- */
1398
- readUInt32LE(offset?: number): number;
1399
- /**
1400
- * @alias Buffer.readUInt32LE
1401
- * @since v14.9.0, v12.19.0
1402
- */
1403
- readUint32LE(offset?: number): number;
1404
- /**
1405
- * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`.
1406
- *
1407
- * This function is also available under the `readUint32BE` alias.
1408
- *
1409
- * ```js
1410
- * import { Buffer } from 'node:buffer';
1411
- *
1412
- * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);
1413
- *
1414
- * console.log(buf.readUInt32BE(0).toString(16));
1415
- * // Prints: 12345678
1416
- * ```
1417
- * @since v0.5.5
1418
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1419
- */
1420
- readUInt32BE(offset?: number): number;
1421
- /**
1422
- * @alias Buffer.readUInt32BE
1423
- * @since v14.9.0, v12.19.0
1424
- */
1425
- readUint32BE(offset?: number): number;
1426
- /**
1427
- * Reads a signed 8-bit integer from `buf` at the specified `offset`.
1428
- *
1429
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
1430
- *
1431
- * ```js
1432
- * import { Buffer } from 'node:buffer';
1433
- *
1434
- * const buf = Buffer.from([-1, 5]);
1435
- *
1436
- * console.log(buf.readInt8(0));
1437
- * // Prints: -1
1438
- * console.log(buf.readInt8(1));
1439
- * // Prints: 5
1440
- * console.log(buf.readInt8(2));
1441
- * // Throws ERR_OUT_OF_RANGE.
1442
- * ```
1443
- * @since v0.5.0
1444
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.
1445
- */
1446
- readInt8(offset?: number): number;
1447
- /**
1448
- * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`.
1449
- *
1450
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
1451
- *
1452
- * ```js
1453
- * import { Buffer } from 'node:buffer';
1454
- *
1455
- * const buf = Buffer.from([0, 5]);
1456
- *
1457
- * console.log(buf.readInt16LE(0));
1458
- * // Prints: 1280
1459
- * console.log(buf.readInt16LE(1));
1460
- * // Throws ERR_OUT_OF_RANGE.
1461
- * ```
1462
- * @since v0.5.5
1463
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1464
- */
1465
- readInt16LE(offset?: number): number;
1466
- /**
1467
- * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`.
1468
- *
1469
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
1470
- *
1471
- * ```js
1472
- * import { Buffer } from 'node:buffer';
1473
- *
1474
- * const buf = Buffer.from([0, 5]);
1475
- *
1476
- * console.log(buf.readInt16BE(0));
1477
- * // Prints: 5
1478
- * ```
1479
- * @since v0.5.5
1480
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.
1481
- */
1482
- readInt16BE(offset?: number): number;
1483
- /**
1484
- * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`.
1485
- *
1486
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
1487
- *
1488
- * ```js
1489
- * import { Buffer } from 'node:buffer';
1490
- *
1491
- * const buf = Buffer.from([0, 0, 0, 5]);
1492
- *
1493
- * console.log(buf.readInt32LE(0));
1494
- * // Prints: 83886080
1495
- * console.log(buf.readInt32LE(1));
1496
- * // Throws ERR_OUT_OF_RANGE.
1497
- * ```
1498
- * @since v0.5.5
1499
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1500
- */
1501
- readInt32LE(offset?: number): number;
1502
- /**
1503
- * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`.
1504
- *
1505
- * Integers read from a `Buffer` are interpreted as two's complement signed values.
1506
- *
1507
- * ```js
1508
- * import { Buffer } from 'node:buffer';
1509
- *
1510
- * const buf = Buffer.from([0, 0, 0, 5]);
1511
- *
1512
- * console.log(buf.readInt32BE(0));
1513
- * // Prints: 5
1514
- * ```
1515
- * @since v0.5.5
1516
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1517
- */
1518
- readInt32BE(offset?: number): number;
1519
- /**
1520
- * Reads a 32-bit, little-endian float from `buf` at the specified `offset`.
1521
- *
1522
- * ```js
1523
- * import { Buffer } from 'node:buffer';
1524
- *
1525
- * const buf = Buffer.from([1, 2, 3, 4]);
1526
- *
1527
- * console.log(buf.readFloatLE(0));
1528
- * // Prints: 1.539989614439558e-36
1529
- * console.log(buf.readFloatLE(1));
1530
- * // Throws ERR_OUT_OF_RANGE.
1531
- * ```
1532
- * @since v0.11.15
1533
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1534
- */
1535
- readFloatLE(offset?: number): number;
1536
- /**
1537
- * Reads a 32-bit, big-endian float from `buf` at the specified `offset`.
1538
- *
1539
- * ```js
1540
- * import { Buffer } from 'node:buffer';
1541
- *
1542
- * const buf = Buffer.from([1, 2, 3, 4]);
1543
- *
1544
- * console.log(buf.readFloatBE(0));
1545
- * // Prints: 2.387939260590663e-38
1546
- * ```
1547
- * @since v0.11.15
1548
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.
1549
- */
1550
- readFloatBE(offset?: number): number;
1551
- /**
1552
- * Reads a 64-bit, little-endian double from `buf` at the specified `offset`.
1553
- *
1554
- * ```js
1555
- * import { Buffer } from 'node:buffer';
1556
- *
1557
- * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
1558
- *
1559
- * console.log(buf.readDoubleLE(0));
1560
- * // Prints: 5.447603722011605e-270
1561
- * console.log(buf.readDoubleLE(1));
1562
- * // Throws ERR_OUT_OF_RANGE.
1563
- * ```
1564
- * @since v0.11.15
1565
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
1566
- */
1567
- readDoubleLE(offset?: number): number;
1568
- /**
1569
- * Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
1570
- *
1571
- * ```js
1572
- * import { Buffer } from 'node:buffer';
1573
- *
1574
- * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);
1575
- *
1576
- * console.log(buf.readDoubleBE(0));
1577
- * // Prints: 8.20788039913184e-304
1578
- * ```
1579
- * @since v0.11.15
1580
- * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.
1581
- */
1582
- readDoubleBE(offset?: number): number;
1583
- reverse(): this;
1584
- /**
1585
- * Interprets `buf` as an array of unsigned 16-bit integers and swaps the
1586
- * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2.
1587
- *
1588
- * ```js
1589
- * import { Buffer } from 'node:buffer';
1590
- *
1591
- * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
1592
- *
1593
- * console.log(buf1);
1594
- * // Prints: <Buffer 01 02 03 04 05 06 07 08>
1595
- *
1596
- * buf1.swap16();
1597
- *
1598
- * console.log(buf1);
1599
- * // Prints: <Buffer 02 01 04 03 06 05 08 07>
1600
- *
1601
- * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
1602
- *
1603
- * buf2.swap16();
1604
- * // Throws ERR_INVALID_BUFFER_SIZE.
1605
- * ```
1606
- *
1607
- * One convenient use of `buf.swap16()` is to perform a fast in-place conversion
1608
- * between UTF-16 little-endian and UTF-16 big-endian:
1609
- *
1610
- * ```js
1611
- * import { Buffer } from 'node:buffer';
1612
- *
1613
- * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le');
1614
- * buf.swap16(); // Convert to big-endian UTF-16 text.
1615
- * ```
1616
- * @since v5.10.0
1617
- * @return A reference to `buf`.
1618
- */
1619
- swap16(): Buffer;
1620
- /**
1621
- * Interprets `buf` as an array of unsigned 32-bit integers and swaps the
1622
- * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4.
1623
- *
1624
- * ```js
1625
- * import { Buffer } from 'node:buffer';
1626
- *
1627
- * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
1628
- *
1629
- * console.log(buf1);
1630
- * // Prints: <Buffer 01 02 03 04 05 06 07 08>
1631
- *
1632
- * buf1.swap32();
1633
- *
1634
- * console.log(buf1);
1635
- * // Prints: <Buffer 04 03 02 01 08 07 06 05>
1636
- *
1637
- * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
1638
- *
1639
- * buf2.swap32();
1640
- * // Throws ERR_INVALID_BUFFER_SIZE.
1641
- * ```
1642
- * @since v5.10.0
1643
- * @return A reference to `buf`.
1644
- */
1645
- swap32(): Buffer;
1646
- /**
1647
- * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_.
1648
- * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8.
1649
- *
1650
- * ```js
1651
- * import { Buffer } from 'node:buffer';
1652
- *
1653
- * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);
1654
- *
1655
- * console.log(buf1);
1656
- * // Prints: <Buffer 01 02 03 04 05 06 07 08>
1657
- *
1658
- * buf1.swap64();
1659
- *
1660
- * console.log(buf1);
1661
- * // Prints: <Buffer 08 07 06 05 04 03 02 01>
1662
- *
1663
- * const buf2 = Buffer.from([0x1, 0x2, 0x3]);
1664
- *
1665
- * buf2.swap64();
1666
- * // Throws ERR_INVALID_BUFFER_SIZE.
1667
- * ```
1668
- * @since v6.3.0
1669
- * @return A reference to `buf`.
1670
- */
1671
- swap64(): Buffer;
1672
- /**
1673
- * Writes `value` to `buf` at the specified `offset`. `value` must be a
1674
- * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything
1675
- * other than an unsigned 8-bit integer.
1676
- *
1677
- * This function is also available under the `writeUint8` alias.
1678
- *
1679
- * ```js
1680
- * import { Buffer } from 'node:buffer';
1681
- *
1682
- * const buf = Buffer.allocUnsafe(4);
1683
- *
1684
- * buf.writeUInt8(0x3, 0);
1685
- * buf.writeUInt8(0x4, 1);
1686
- * buf.writeUInt8(0x23, 2);
1687
- * buf.writeUInt8(0x42, 3);
1688
- *
1689
- * console.log(buf);
1690
- * // Prints: <Buffer 03 04 23 42>
1691
- * ```
1692
- * @since v0.5.0
1693
- * @param value Number to be written to `buf`.
1694
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
1695
- * @return `offset` plus the number of bytes written.
1696
- */
1697
- writeUInt8(value: number, offset?: number): number;
1698
- /**
1699
- * @alias Buffer.writeUInt8
1700
- * @since v14.9.0, v12.19.0
1701
- */
1702
- writeUint8(value: number, offset?: number): number;
1703
- /**
1704
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is
1705
- * anything other than an unsigned 16-bit integer.
1706
- *
1707
- * This function is also available under the `writeUint16LE` alias.
1708
- *
1709
- * ```js
1710
- * import { Buffer } from 'node:buffer';
1711
- *
1712
- * const buf = Buffer.allocUnsafe(4);
1713
- *
1714
- * buf.writeUInt16LE(0xdead, 0);
1715
- * buf.writeUInt16LE(0xbeef, 2);
1716
- *
1717
- * console.log(buf);
1718
- * // Prints: <Buffer ad de ef be>
1719
- * ```
1720
- * @since v0.5.5
1721
- * @param value Number to be written to `buf`.
1722
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1723
- * @return `offset` plus the number of bytes written.
1724
- */
1725
- writeUInt16LE(value: number, offset?: number): number;
1726
- /**
1727
- * @alias Buffer.writeUInt16LE
1728
- * @since v14.9.0, v12.19.0
1729
- */
1730
- writeUint16LE(value: number, offset?: number): number;
1731
- /**
1732
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an
1733
- * unsigned 16-bit integer.
1734
- *
1735
- * This function is also available under the `writeUint16BE` alias.
1736
- *
1737
- * ```js
1738
- * import { Buffer } from 'node:buffer';
1739
- *
1740
- * const buf = Buffer.allocUnsafe(4);
1741
- *
1742
- * buf.writeUInt16BE(0xdead, 0);
1743
- * buf.writeUInt16BE(0xbeef, 2);
1744
- *
1745
- * console.log(buf);
1746
- * // Prints: <Buffer de ad be ef>
1747
- * ```
1748
- * @since v0.5.5
1749
- * @param value Number to be written to `buf`.
1750
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1751
- * @return `offset` plus the number of bytes written.
1752
- */
1753
- writeUInt16BE(value: number, offset?: number): number;
1754
- /**
1755
- * @alias Buffer.writeUInt16BE
1756
- * @since v14.9.0, v12.19.0
1757
- */
1758
- writeUint16BE(value: number, offset?: number): number;
1759
- /**
1760
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is
1761
- * anything other than an unsigned 32-bit integer.
1762
- *
1763
- * This function is also available under the `writeUint32LE` alias.
1764
- *
1765
- * ```js
1766
- * import { Buffer } from 'node:buffer';
1767
- *
1768
- * const buf = Buffer.allocUnsafe(4);
1769
- *
1770
- * buf.writeUInt32LE(0xfeedface, 0);
1771
- *
1772
- * console.log(buf);
1773
- * // Prints: <Buffer ce fa ed fe>
1774
- * ```
1775
- * @since v0.5.5
1776
- * @param value Number to be written to `buf`.
1777
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1778
- * @return `offset` plus the number of bytes written.
1779
- */
1780
- writeUInt32LE(value: number, offset?: number): number;
1781
- /**
1782
- * @alias Buffer.writeUInt32LE
1783
- * @since v14.9.0, v12.19.0
1784
- */
1785
- writeUint32LE(value: number, offset?: number): number;
1786
- /**
1787
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an
1788
- * unsigned 32-bit integer.
1789
- *
1790
- * This function is also available under the `writeUint32BE` alias.
1791
- *
1792
- * ```js
1793
- * import { Buffer } from 'node:buffer';
1794
- *
1795
- * const buf = Buffer.allocUnsafe(4);
1796
- *
1797
- * buf.writeUInt32BE(0xfeedface, 0);
1798
- *
1799
- * console.log(buf);
1800
- * // Prints: <Buffer fe ed fa ce>
1801
- * ```
1802
- * @since v0.5.5
1803
- * @param value Number to be written to `buf`.
1804
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1805
- * @return `offset` plus the number of bytes written.
1806
- */
1807
- writeUInt32BE(value: number, offset?: number): number;
1808
- /**
1809
- * @alias Buffer.writeUInt32BE
1810
- * @since v14.9.0, v12.19.0
1811
- */
1812
- writeUint32BE(value: number, offset?: number): number;
1813
- /**
1814
- * Writes `value` to `buf` at the specified `offset`. `value` must be a valid
1815
- * signed 8-bit integer. Behavior is undefined when `value` is anything other than
1816
- * a signed 8-bit integer.
1817
- *
1818
- * `value` is interpreted and written as a two's complement signed integer.
1819
- *
1820
- * ```js
1821
- * import { Buffer } from 'node:buffer';
1822
- *
1823
- * const buf = Buffer.allocUnsafe(2);
1824
- *
1825
- * buf.writeInt8(2, 0);
1826
- * buf.writeInt8(-2, 1);
1827
- *
1828
- * console.log(buf);
1829
- * // Prints: <Buffer 02 fe>
1830
- * ```
1831
- * @since v0.5.0
1832
- * @param value Number to be written to `buf`.
1833
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.
1834
- * @return `offset` plus the number of bytes written.
1835
- */
1836
- writeInt8(value: number, offset?: number): number;
1837
- /**
1838
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is
1839
- * anything other than a signed 16-bit integer.
1840
- *
1841
- * The `value` is interpreted and written as a two's complement signed integer.
1842
- *
1843
- * ```js
1844
- * import { Buffer } from 'node:buffer';
1845
- *
1846
- * const buf = Buffer.allocUnsafe(2);
1847
- *
1848
- * buf.writeInt16LE(0x0304, 0);
1849
- *
1850
- * console.log(buf);
1851
- * // Prints: <Buffer 04 03>
1852
- * ```
1853
- * @since v0.5.5
1854
- * @param value Number to be written to `buf`.
1855
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1856
- * @return `offset` plus the number of bytes written.
1857
- */
1858
- writeInt16LE(value: number, offset?: number): number;
1859
- /**
1860
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is
1861
- * anything other than a signed 16-bit integer.
1862
- *
1863
- * The `value` is interpreted and written as a two's complement signed integer.
1864
- *
1865
- * ```js
1866
- * import { Buffer } from 'node:buffer';
1867
- *
1868
- * const buf = Buffer.allocUnsafe(2);
1869
- *
1870
- * buf.writeInt16BE(0x0102, 0);
1871
- *
1872
- * console.log(buf);
1873
- * // Prints: <Buffer 01 02>
1874
- * ```
1875
- * @since v0.5.5
1876
- * @param value Number to be written to `buf`.
1877
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.
1878
- * @return `offset` plus the number of bytes written.
1879
- */
1880
- writeInt16BE(value: number, offset?: number): number;
1881
- /**
1882
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is
1883
- * anything other than a signed 32-bit integer.
1884
- *
1885
- * The `value` is interpreted and written as a two's complement signed integer.
1886
- *
1887
- * ```js
1888
- * import { Buffer } from 'node:buffer';
1889
- *
1890
- * const buf = Buffer.allocUnsafe(4);
1891
- *
1892
- * buf.writeInt32LE(0x05060708, 0);
1893
- *
1894
- * console.log(buf);
1895
- * // Prints: <Buffer 08 07 06 05>
1896
- * ```
1897
- * @since v0.5.5
1898
- * @param value Number to be written to `buf`.
1899
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1900
- * @return `offset` plus the number of bytes written.
1901
- */
1902
- writeInt32LE(value: number, offset?: number): number;
1903
- /**
1904
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is
1905
- * anything other than a signed 32-bit integer.
1906
- *
1907
- * The `value` is interpreted and written as a two's complement signed integer.
1908
- *
1909
- * ```js
1910
- * import { Buffer } from 'node:buffer';
1911
- *
1912
- * const buf = Buffer.allocUnsafe(4);
1913
- *
1914
- * buf.writeInt32BE(0x01020304, 0);
1915
- *
1916
- * console.log(buf);
1917
- * // Prints: <Buffer 01 02 03 04>
1918
- * ```
1919
- * @since v0.5.5
1920
- * @param value Number to be written to `buf`.
1921
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1922
- * @return `offset` plus the number of bytes written.
1923
- */
1924
- writeInt32BE(value: number, offset?: number): number;
1925
- /**
1926
- * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is
1927
- * undefined when `value` is anything other than a JavaScript number.
1928
- *
1929
- * ```js
1930
- * import { Buffer } from 'node:buffer';
1931
- *
1932
- * const buf = Buffer.allocUnsafe(4);
1933
- *
1934
- * buf.writeFloatLE(0xcafebabe, 0);
1935
- *
1936
- * console.log(buf);
1937
- * // Prints: <Buffer bb fe 4a 4f>
1938
- * ```
1939
- * @since v0.11.15
1940
- * @param value Number to be written to `buf`.
1941
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1942
- * @return `offset` plus the number of bytes written.
1943
- */
1944
- writeFloatLE(value: number, offset?: number): number;
1945
- /**
1946
- * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is
1947
- * undefined when `value` is anything other than a JavaScript number.
1948
- *
1949
- * ```js
1950
- * import { Buffer } from 'node:buffer';
1951
- *
1952
- * const buf = Buffer.allocUnsafe(4);
1953
- *
1954
- * buf.writeFloatBE(0xcafebabe, 0);
1955
- *
1956
- * console.log(buf);
1957
- * // Prints: <Buffer 4f 4a fe bb>
1958
- * ```
1959
- * @since v0.11.15
1960
- * @param value Number to be written to `buf`.
1961
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.
1962
- * @return `offset` plus the number of bytes written.
1963
- */
1964
- writeFloatBE(value: number, offset?: number): number;
1965
- /**
1966
- * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything
1967
- * other than a JavaScript number.
1968
- *
1969
- * ```js
1970
- * import { Buffer } from 'node:buffer';
1971
- *
1972
- * const buf = Buffer.allocUnsafe(8);
1973
- *
1974
- * buf.writeDoubleLE(123.456, 0);
1975
- *
1976
- * console.log(buf);
1977
- * // Prints: <Buffer 77 be 9f 1a 2f dd 5e 40>
1978
- * ```
1979
- * @since v0.11.15
1980
- * @param value Number to be written to `buf`.
1981
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
1982
- * @return `offset` plus the number of bytes written.
1983
- */
1984
- writeDoubleLE(value: number, offset?: number): number;
1985
- /**
1986
- * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything
1987
- * other than a JavaScript number.
1988
- *
1989
- * ```js
1990
- * import { Buffer } from 'node:buffer';
1991
- *
1992
- * const buf = Buffer.allocUnsafe(8);
1993
- *
1994
- * buf.writeDoubleBE(123.456, 0);
1995
- *
1996
- * console.log(buf);
1997
- * // Prints: <Buffer 40 5e dd 2f 1a 9f be 77>
1998
- * ```
1999
- * @since v0.11.15
2000
- * @param value Number to be written to `buf`.
2001
- * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.
2002
- * @return `offset` plus the number of bytes written.
2003
- */
2004
- writeDoubleBE(value: number, offset?: number): number;
2005
- /**
2006
- * Fills `buf` with the specified `value`. If the `offset` and `end` are not given,
2007
- * the entire `buf` will be filled:
2008
- *
2009
- * ```js
2010
- * import { Buffer } from 'node:buffer';
2011
- *
2012
- * // Fill a `Buffer` with the ASCII character 'h'.
2013
- *
2014
- * const b = Buffer.allocUnsafe(50).fill('h');
2015
- *
2016
- * console.log(b.toString());
2017
- * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
2018
- *
2019
- * // Fill a buffer with empty string
2020
- * const c = Buffer.allocUnsafe(5).fill('');
2021
- *
2022
- * console.log(c.fill(''));
2023
- * // Prints: <Buffer 00 00 00 00 00>
2024
- * ```
2025
- *
2026
- * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
2027
- * integer. If the resulting integer is greater than `255` (decimal), `buf` will be
2028
- * filled with `value &#x26; 255`.
2029
- *
2030
- * If the final write of a `fill()` operation falls on a multi-byte character,
2031
- * then only the bytes of that character that fit into `buf` are written:
2032
- *
2033
- * ```js
2034
- * import { Buffer } from 'node:buffer';
2035
- *
2036
- * // Fill a `Buffer` with character that takes up two bytes in UTF-8.
2037
- *
2038
- * console.log(Buffer.allocUnsafe(5).fill('\u0222'));
2039
- * // Prints: <Buffer c8 a2 c8 a2 c8>
2040
- * ```
2041
- *
2042
- * If `value` contains invalid characters, it is truncated; if no valid
2043
- * fill data remains, an exception is thrown:
2044
- *
2045
- * ```js
2046
- * import { Buffer } from 'node:buffer';
2047
- *
2048
- * const buf = Buffer.allocUnsafe(5);
2049
- *
2050
- * console.log(buf.fill('a'));
2051
- * // Prints: <Buffer 61 61 61 61 61>
2052
- * console.log(buf.fill('aazz', 'hex'));
2053
- * // Prints: <Buffer aa aa aa aa aa>
2054
- * console.log(buf.fill('zz', 'hex'));
2055
- * // Throws an exception.
2056
- * ```
2057
- * @since v0.5.0
2058
- * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`.
2059
- * @param [offset=0] Number of bytes to skip before starting to fill `buf`.
2060
- * @param [end=buf.length] Where to stop filling `buf` (not inclusive).
2061
- * @param [encoding='utf8'] The encoding for `value` if `value` is a string.
2062
- * @return A reference to `buf`.
2063
- */
2064
- fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
2065
- /**
2066
- * If `value` is:
2067
- *
2068
- * * a string, `value` is interpreted according to the character encoding in`encoding`.
2069
- * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety.
2070
- * To compare a partial `Buffer`, use `buf.subarray`.
2071
- * * a number, `value` will be interpreted as an unsigned 8-bit integer
2072
- * value between `0` and `255`.
2073
- *
2074
- * ```js
2075
- * import { Buffer } from 'node:buffer';
2076
- *
2077
- * const buf = Buffer.from('this is a buffer');
2078
- *
2079
- * console.log(buf.indexOf('this'));
2080
- * // Prints: 0
2081
- * console.log(buf.indexOf('is'));
2082
- * // Prints: 2
2083
- * console.log(buf.indexOf(Buffer.from('a buffer')));
2084
- * // Prints: 8
2085
- * console.log(buf.indexOf(97));
2086
- * // Prints: 8 (97 is the decimal ASCII value for 'a')
2087
- * console.log(buf.indexOf(Buffer.from('a buffer example')));
2088
- * // Prints: -1
2089
- * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8)));
2090
- * // Prints: 8
2091
- *
2092
- * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
2093
- *
2094
- * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le'));
2095
- * // Prints: 4
2096
- * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le'));
2097
- * // Prints: 6
2098
- * ```
2099
- *
2100
- * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value,
2101
- * an integer between 0 and 255.
2102
- *
2103
- * If `byteOffset` is not a number, it will be coerced to a number. If the result
2104
- * of coercion is `NaN` or `0`, then the entire buffer will be searched. This
2105
- * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
2106
- *
2107
- * ```js
2108
- * import { Buffer } from 'node:buffer';
2109
- *
2110
- * const b = Buffer.from('abcdef');
2111
- *
2112
- * // Passing a value that's a number, but not a valid byte.
2113
- * // Prints: 2, equivalent to searching for 99 or 'c'.
2114
- * console.log(b.indexOf(99.9));
2115
- * console.log(b.indexOf(256 + 99));
2116
- *
2117
- * // Passing a byteOffset that coerces to NaN or 0.
2118
- * // Prints: 1, searching the whole buffer.
2119
- * console.log(b.indexOf('b', undefined));
2120
- * console.log(b.indexOf('b', {}));
2121
- * console.log(b.indexOf('b', null));
2122
- * console.log(b.indexOf('b', []));
2123
- * ```
2124
- *
2125
- * If `value` is an empty string or empty `Buffer` and `byteOffset` is less
2126
- * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned.
2127
- * @since v1.5.0
2128
- * @param value What to search for.
2129
- * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
2130
- * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
2131
- * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
2132
- */
2133
- indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
2134
- /**
2135
- * Identical to `buf.indexOf()`, except the last occurrence of `value` is found
2136
- * rather than the first occurrence.
2137
- *
2138
- * ```js
2139
- * import { Buffer } from 'node:buffer';
2140
- *
2141
- * const buf = Buffer.from('this buffer is a buffer');
2142
- *
2143
- * console.log(buf.lastIndexOf('this'));
2144
- * // Prints: 0
2145
- * console.log(buf.lastIndexOf('buffer'));
2146
- * // Prints: 17
2147
- * console.log(buf.lastIndexOf(Buffer.from('buffer')));
2148
- * // Prints: 17
2149
- * console.log(buf.lastIndexOf(97));
2150
- * // Prints: 15 (97 is the decimal ASCII value for 'a')
2151
- * console.log(buf.lastIndexOf(Buffer.from('yolo')));
2152
- * // Prints: -1
2153
- * console.log(buf.lastIndexOf('buffer', 5));
2154
- * // Prints: 5
2155
- * console.log(buf.lastIndexOf('buffer', 4));
2156
- * // Prints: -1
2157
- *
2158
- * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le');
2159
- *
2160
- * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le'));
2161
- * // Prints: 6
2162
- * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le'));
2163
- * // Prints: 4
2164
- * ```
2165
- *
2166
- * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value,
2167
- * an integer between 0 and 255.
2168
- *
2169
- * If `byteOffset` is not a number, it will be coerced to a number. Any arguments
2170
- * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer.
2171
- * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf).
2172
- *
2173
- * ```js
2174
- * import { Buffer } from 'node:buffer';
2175
- *
2176
- * const b = Buffer.from('abcdef');
2177
- *
2178
- * // Passing a value that's a number, but not a valid byte.
2179
- * // Prints: 2, equivalent to searching for 99 or 'c'.
2180
- * console.log(b.lastIndexOf(99.9));
2181
- * console.log(b.lastIndexOf(256 + 99));
2182
- *
2183
- * // Passing a byteOffset that coerces to NaN.
2184
- * // Prints: 1, searching the whole buffer.
2185
- * console.log(b.lastIndexOf('b', undefined));
2186
- * console.log(b.lastIndexOf('b', {}));
2187
- *
2188
- * // Passing a byteOffset that coerces to 0.
2189
- * // Prints: -1, equivalent to passing 0.
2190
- * console.log(b.lastIndexOf('b', null));
2191
- * console.log(b.lastIndexOf('b', []));
2192
- * ```
2193
- *
2194
- * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned.
2195
- * @since v6.0.0
2196
- * @param value What to search for.
2197
- * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
2198
- * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.
2199
- * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
2200
- */
2201
- lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
2202
- /**
2203
- * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents
2204
- * of `buf`.
2205
- *
2206
- * ```js
2207
- * import { Buffer } from 'node:buffer';
2208
- *
2209
- * // Log the entire contents of a `Buffer`.
2210
- *
2211
- * const buf = Buffer.from('buffer');
2212
- *
2213
- * for (const pair of buf.entries()) {
2214
- * console.log(pair);
2215
- * }
2216
- * // Prints:
2217
- * // [0, 98]
2218
- * // [1, 117]
2219
- * // [2, 102]
2220
- * // [3, 102]
2221
- * // [4, 101]
2222
- * // [5, 114]
2223
- * ```
2224
- * @since v1.1.0
2225
- */
2226
- entries(): IterableIterator<[number, number]>;
2227
- /**
2228
- * Equivalent to `buf.indexOf() !== -1`.
2229
- *
2230
- * ```js
2231
- * import { Buffer } from 'node:buffer';
2232
- *
2233
- * const buf = Buffer.from('this is a buffer');
2234
- *
2235
- * console.log(buf.includes('this'));
2236
- * // Prints: true
2237
- * console.log(buf.includes('is'));
2238
- * // Prints: true
2239
- * console.log(buf.includes(Buffer.from('a buffer')));
2240
- * // Prints: true
2241
- * console.log(buf.includes(97));
2242
- * // Prints: true (97 is the decimal ASCII value for 'a')
2243
- * console.log(buf.includes(Buffer.from('a buffer example')));
2244
- * // Prints: false
2245
- * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8)));
2246
- * // Prints: true
2247
- * console.log(buf.includes('this', 4));
2248
- * // Prints: false
2249
- * ```
2250
- * @since v5.3.0
2251
- * @param value What to search for.
2252
- * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.
2253
- * @param [encoding='utf8'] If `value` is a string, this is its encoding.
2254
- * @return `true` if `value` was found in `buf`, `false` otherwise.
2255
- */
2256
- includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
2257
- /**
2258
- * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices).
2259
- *
2260
- * ```js
2261
- * import { Buffer } from 'node:buffer';
2262
- *
2263
- * const buf = Buffer.from('buffer');
2264
- *
2265
- * for (const key of buf.keys()) {
2266
- * console.log(key);
2267
- * }
2268
- * // Prints:
2269
- * // 0
2270
- * // 1
2271
- * // 2
2272
- * // 3
2273
- * // 4
2274
- * // 5
2275
- * ```
2276
- * @since v1.1.0
2277
- */
2278
- keys(): IterableIterator<number>;
2279
- /**
2280
- * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is
2281
- * called automatically when a `Buffer` is used in a `for..of` statement.
2282
- *
2283
- * ```js
2284
- * import { Buffer } from 'node:buffer';
2285
- *
2286
- * const buf = Buffer.from('buffer');
2287
- *
2288
- * for (const value of buf.values()) {
2289
- * console.log(value);
2290
- * }
2291
- * // Prints:
2292
- * // 98
2293
- * // 117
2294
- * // 102
2295
- * // 102
2296
- * // 101
2297
- * // 114
2298
- *
2299
- * for (const value of buf) {
2300
- * console.log(value);
2301
- * }
2302
- * // Prints:
2303
- * // 98
2304
- * // 117
2305
- * // 102
2306
- * // 102
2307
- * // 101
2308
- * // 114
2309
- * ```
2310
- * @since v1.1.0
2311
- */
2312
- values(): IterableIterator<number>;
2313
- }
2314
- var Buffer: BufferConstructor;
2315
- /**
2316
- * Decodes a string of Base64-encoded data into bytes, and encodes those bytes
2317
- * into a string using Latin-1 (ISO-8859-1).
2318
- *
2319
- * The `data` may be any JavaScript-value that can be coerced into a string.
2320
- *
2321
- * **This function is only provided for compatibility with legacy web platform APIs**
2322
- * **and should never be used in new code, because they use strings to represent**
2323
- * **binary data and predate the introduction of typed arrays in JavaScript.**
2324
- * **For code running using Node.js APIs, converting between base64-encoded strings**
2325
- * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
2326
- * @since v15.13.0, v14.17.0
2327
- * @legacy Use `Buffer.from(data, 'base64')` instead.
2328
- * @param data The Base64-encoded input string.
2329
- */
2330
- function atob(data: string): string;
2331
- /**
2332
- * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes
2333
- * into a string using Base64.
2334
- *
2335
- * The `data` may be any JavaScript-value that can be coerced into a string.
2336
- *
2337
- * **This function is only provided for compatibility with legacy web platform APIs**
2338
- * **and should never be used in new code, because they use strings to represent**
2339
- * **binary data and predate the introduction of typed arrays in JavaScript.**
2340
- * **For code running using Node.js APIs, converting between base64-encoded strings**
2341
- * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.**
2342
- * @since v15.13.0, v14.17.0
2343
- * @legacy Use `buf.toString('base64')` instead.
2344
- * @param data An ASCII (Latin1) string.
2345
- */
2346
- function btoa(data: string): string;
2347
- interface Blob extends __Blob {}
2348
- /**
2349
- * `Blob` class is a global reference for `require('node:buffer').Blob`
2350
- * https://nodejs.org/api/buffer.html#class-blob
2351
- * @since v18.0.0
2352
- */
2353
- var Blob: typeof globalThis extends {
2354
- onmessage: any;
2355
- Blob: infer T;
2356
- } ? T
2357
- : typeof NodeBlob;
2358
- }
2359
- }
2360
- declare module "node:buffer" {
2361
- export * from "buffer";
2362
- }