@alanszp/express-common-fn 12.0.2 → 12.0.3

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 (951) hide show
  1. package/package.json +6 -9
  2. package/.gitignore +0 -3
  3. package/.npmignore +0 -3
  4. package/node_modules/@alanszp/audit/.gitignore +0 -3
  5. package/node_modules/@alanszp/audit/.npmignore +0 -3
  6. package/node_modules/@alanszp/audit/LICENSE +0 -21
  7. package/node_modules/@alanszp/audit/dist/audit.d.ts +0 -9
  8. package/node_modules/@alanszp/audit/dist/audit.js +0 -25
  9. package/node_modules/@alanszp/audit/dist/audit.js.map +0 -1
  10. package/node_modules/@alanszp/audit/dist/auditWithState.d.ts +0 -10
  11. package/node_modules/@alanszp/audit/dist/auditWithState.js +0 -22
  12. package/node_modules/@alanszp/audit/dist/auditWithState.js.map +0 -1
  13. package/node_modules/@alanszp/audit/dist/errors/AuditError.d.ts +0 -3
  14. package/node_modules/@alanszp/audit/dist/errors/AuditError.js +0 -8
  15. package/node_modules/@alanszp/audit/dist/errors/AuditError.js.map +0 -1
  16. package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.d.ts +0 -9
  17. package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.js +0 -23
  18. package/node_modules/@alanszp/audit/dist/errors/MissingAuditFieldsError.js.map +0 -1
  19. package/node_modules/@alanszp/audit/dist/errors/index.d.ts +0 -2
  20. package/node_modules/@alanszp/audit/dist/errors/index.js +0 -19
  21. package/node_modules/@alanszp/audit/dist/errors/index.js.map +0 -1
  22. package/node_modules/@alanszp/audit/dist/factory.d.ts +0 -4
  23. package/node_modules/@alanszp/audit/dist/factory.js +0 -16
  24. package/node_modules/@alanszp/audit/dist/factory.js.map +0 -1
  25. package/node_modules/@alanszp/audit/dist/index.d.ts +0 -5
  26. package/node_modules/@alanszp/audit/dist/index.js +0 -22
  27. package/node_modules/@alanszp/audit/dist/index.js.map +0 -1
  28. package/node_modules/@alanszp/audit/dist/interfaces.d.ts +0 -22
  29. package/node_modules/@alanszp/audit/dist/interfaces.js +0 -18
  30. package/node_modules/@alanszp/audit/dist/interfaces.js.map +0 -1
  31. package/node_modules/@alanszp/audit/node_modules/@types/node/LICENSE +0 -21
  32. package/node_modules/@alanszp/audit/node_modules/@types/node/README.md +0 -15
  33. package/node_modules/@alanszp/audit/node_modules/@types/node/assert/strict.d.ts +0 -8
  34. package/node_modules/@alanszp/audit/node_modules/@types/node/assert.d.ts +0 -996
  35. package/node_modules/@alanszp/audit/node_modules/@types/node/async_hooks.d.ts +0 -539
  36. package/node_modules/@alanszp/audit/node_modules/@types/node/buffer.d.ts +0 -2362
  37. package/node_modules/@alanszp/audit/node_modules/@types/node/child_process.d.ts +0 -1540
  38. package/node_modules/@alanszp/audit/node_modules/@types/node/cluster.d.ts +0 -432
  39. package/node_modules/@alanszp/audit/node_modules/@types/node/console.d.ts +0 -415
  40. package/node_modules/@alanszp/audit/node_modules/@types/node/constants.d.ts +0 -19
  41. package/node_modules/@alanszp/audit/node_modules/@types/node/crypto.d.ts +0 -4487
  42. package/node_modules/@alanszp/audit/node_modules/@types/node/dgram.d.ts +0 -596
  43. package/node_modules/@alanszp/audit/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  44. package/node_modules/@alanszp/audit/node_modules/@types/node/dns/promises.d.ts +0 -425
  45. package/node_modules/@alanszp/audit/node_modules/@types/node/dns.d.ts +0 -809
  46. package/node_modules/@alanszp/audit/node_modules/@types/node/dom-events.d.ts +0 -122
  47. package/node_modules/@alanszp/audit/node_modules/@types/node/domain.d.ts +0 -170
  48. package/node_modules/@alanszp/audit/node_modules/@types/node/events.d.ts +0 -879
  49. package/node_modules/@alanszp/audit/node_modules/@types/node/fs/promises.d.ts +0 -1239
  50. package/node_modules/@alanszp/audit/node_modules/@types/node/fs.d.ts +0 -4311
  51. package/node_modules/@alanszp/audit/node_modules/@types/node/globals.d.ts +0 -411
  52. package/node_modules/@alanszp/audit/node_modules/@types/node/globals.global.d.ts +0 -1
  53. package/node_modules/@alanszp/audit/node_modules/@types/node/http.d.ts +0 -1887
  54. package/node_modules/@alanszp/audit/node_modules/@types/node/http2.d.ts +0 -2382
  55. package/node_modules/@alanszp/audit/node_modules/@types/node/https.d.ts +0 -550
  56. package/node_modules/@alanszp/audit/node_modules/@types/node/index.d.ts +0 -88
  57. package/node_modules/@alanszp/audit/node_modules/@types/node/inspector.d.ts +0 -2747
  58. package/node_modules/@alanszp/audit/node_modules/@types/node/module.d.ts +0 -315
  59. package/node_modules/@alanszp/audit/node_modules/@types/node/net.d.ts +0 -949
  60. package/node_modules/@alanszp/audit/node_modules/@types/node/os.d.ts +0 -478
  61. package/node_modules/@alanszp/audit/node_modules/@types/node/package.json +0 -229
  62. package/node_modules/@alanszp/audit/node_modules/@types/node/path.d.ts +0 -191
  63. package/node_modules/@alanszp/audit/node_modules/@types/node/perf_hooks.d.ts +0 -645
  64. package/node_modules/@alanszp/audit/node_modules/@types/node/process.d.ts +0 -1561
  65. package/node_modules/@alanszp/audit/node_modules/@types/node/punycode.d.ts +0 -117
  66. package/node_modules/@alanszp/audit/node_modules/@types/node/querystring.d.ts +0 -141
  67. package/node_modules/@alanszp/audit/node_modules/@types/node/readline/promises.d.ts +0 -150
  68. package/node_modules/@alanszp/audit/node_modules/@types/node/readline.d.ts +0 -539
  69. package/node_modules/@alanszp/audit/node_modules/@types/node/repl.d.ts +0 -430
  70. package/node_modules/@alanszp/audit/node_modules/@types/node/stream/consumers.d.ts +0 -12
  71. package/node_modules/@alanszp/audit/node_modules/@types/node/stream/promises.d.ts +0 -83
  72. package/node_modules/@alanszp/audit/node_modules/@types/node/stream/web.d.ts +0 -366
  73. package/node_modules/@alanszp/audit/node_modules/@types/node/stream.d.ts +0 -1701
  74. package/node_modules/@alanszp/audit/node_modules/@types/node/string_decoder.d.ts +0 -67
  75. package/node_modules/@alanszp/audit/node_modules/@types/node/test.d.ts +0 -1465
  76. package/node_modules/@alanszp/audit/node_modules/@types/node/timers/promises.d.ts +0 -93
  77. package/node_modules/@alanszp/audit/node_modules/@types/node/timers.d.ts +0 -240
  78. package/node_modules/@alanszp/audit/node_modules/@types/node/tls.d.ts +0 -1210
  79. package/node_modules/@alanszp/audit/node_modules/@types/node/trace_events.d.ts +0 -182
  80. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  81. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  82. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  83. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  84. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  85. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  86. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  87. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  88. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  89. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  90. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  91. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  92. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  93. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  94. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  95. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  96. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  97. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  98. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  99. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  100. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  101. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  102. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  103. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  104. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  105. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  106. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  107. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  108. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  109. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  110. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  111. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  112. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  113. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  114. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  115. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  116. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  117. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  118. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  119. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  120. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  121. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  122. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  123. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  124. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  125. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  126. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  127. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  128. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  129. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  130. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  131. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  132. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  133. package/node_modules/@alanszp/audit/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  134. package/node_modules/@alanszp/audit/node_modules/@types/node/tty.d.ts +0 -208
  135. package/node_modules/@alanszp/audit/node_modules/@types/node/url.d.ts +0 -927
  136. package/node_modules/@alanszp/audit/node_modules/@types/node/util.d.ts +0 -2183
  137. package/node_modules/@alanszp/audit/node_modules/@types/node/v8.d.ts +0 -764
  138. package/node_modules/@alanszp/audit/node_modules/@types/node/vm.d.ts +0 -903
  139. package/node_modules/@alanszp/audit/node_modules/@types/node/wasi.d.ts +0 -179
  140. package/node_modules/@alanszp/audit/node_modules/@types/node/worker_threads.d.ts +0 -691
  141. package/node_modules/@alanszp/audit/node_modules/@types/node/zlib.d.ts +0 -517
  142. package/node_modules/@alanszp/audit/package.json +0 -32
  143. package/node_modules/@alanszp/audit/src/audit.ts +0 -31
  144. package/node_modules/@alanszp/audit/src/auditWithState.ts +0 -27
  145. package/node_modules/@alanszp/audit/src/errors/AuditError.ts +0 -3
  146. package/node_modules/@alanszp/audit/src/errors/MissingAuditFieldsError.ts +0 -25
  147. package/node_modules/@alanszp/audit/src/errors/index.ts +0 -2
  148. package/node_modules/@alanszp/audit/src/factory.ts +0 -16
  149. package/node_modules/@alanszp/audit/src/index.ts +0 -5
  150. package/node_modules/@alanszp/audit/src/interfaces.ts +0 -38
  151. package/node_modules/@alanszp/audit/tsconfig.json +0 -15
  152. package/node_modules/@alanszp/errors/.gitignore +0 -3
  153. package/node_modules/@alanszp/errors/.npmignore +0 -3
  154. package/node_modules/@alanszp/errors/LICENSE +0 -21
  155. package/node_modules/@alanszp/errors/dist/BaseError.d.ts +0 -3
  156. package/node_modules/@alanszp/errors/dist/BaseError.js +0 -18
  157. package/node_modules/@alanszp/errors/dist/BaseError.js.map +0 -1
  158. package/node_modules/@alanszp/errors/dist/HttpRenderableError.d.ts +0 -4
  159. package/node_modules/@alanszp/errors/dist/HttpRenderableError.js +0 -8
  160. package/node_modules/@alanszp/errors/dist/HttpRenderableError.js.map +0 -1
  161. package/node_modules/@alanszp/errors/dist/InternalServerError.d.ts +0 -8
  162. package/node_modules/@alanszp/errors/dist/InternalServerError.js +0 -24
  163. package/node_modules/@alanszp/errors/dist/InternalServerError.js.map +0 -1
  164. package/node_modules/@alanszp/errors/dist/RenderableError.d.ts +0 -15
  165. package/node_modules/@alanszp/errors/dist/RenderableError.js +0 -27
  166. package/node_modules/@alanszp/errors/dist/RenderableError.js.map +0 -1
  167. package/node_modules/@alanszp/errors/dist/index.d.ts +0 -4
  168. package/node_modules/@alanszp/errors/dist/index.js +0 -17
  169. package/node_modules/@alanszp/errors/dist/index.js.map +0 -1
  170. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/.gitignore +0 -3
  171. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/.npmignore +0 -3
  172. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/LICENSE +0 -21
  173. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.d.ts +0 -1
  174. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.js +0 -10
  175. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/appIdentifier.js.map +0 -1
  176. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.d.ts +0 -1
  177. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.js +0 -18
  178. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/app/index.js.map +0 -1
  179. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.d.ts +0 -2
  180. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.js +0 -20
  181. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/assignKey.js.map +0 -1
  182. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.d.ts +0 -2
  183. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.js +0 -19
  184. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/index.js.map +0 -1
  185. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.d.ts +0 -3
  186. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.js +0 -26
  187. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/keepOrUpdate.js.map +0 -1
  188. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.d.ts +0 -6
  189. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.js +0 -3
  190. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/editable/types.js.map +0 -1
  191. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.d.ts +0 -4
  192. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.js +0 -21
  193. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/index.js.map +0 -1
  194. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.d.ts +0 -7
  195. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.js +0 -8
  196. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/ListResult.js.map +0 -1
  197. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.d.ts +0 -11
  198. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.js +0 -13
  199. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Orderable.js.map +0 -1
  200. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.d.ts +0 -14
  201. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.js +0 -22
  202. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/Paginable.js.map +0 -1
  203. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.d.ts +0 -3
  204. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.js +0 -20
  205. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/dist/lists/index.js.map +0 -1
  206. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/package.json +0 -25
  207. package/node_modules/@alanszp/errors/node_modules/@alanszp/core/tsconfig.json +0 -15
  208. package/node_modules/@alanszp/errors/node_modules/@types/node/LICENSE +0 -21
  209. package/node_modules/@alanszp/errors/node_modules/@types/node/README.md +0 -15
  210. package/node_modules/@alanszp/errors/node_modules/@types/node/assert/strict.d.ts +0 -8
  211. package/node_modules/@alanszp/errors/node_modules/@types/node/assert.d.ts +0 -996
  212. package/node_modules/@alanszp/errors/node_modules/@types/node/async_hooks.d.ts +0 -539
  213. package/node_modules/@alanszp/errors/node_modules/@types/node/buffer.d.ts +0 -2362
  214. package/node_modules/@alanszp/errors/node_modules/@types/node/child_process.d.ts +0 -1540
  215. package/node_modules/@alanszp/errors/node_modules/@types/node/cluster.d.ts +0 -432
  216. package/node_modules/@alanszp/errors/node_modules/@types/node/console.d.ts +0 -415
  217. package/node_modules/@alanszp/errors/node_modules/@types/node/constants.d.ts +0 -19
  218. package/node_modules/@alanszp/errors/node_modules/@types/node/crypto.d.ts +0 -4487
  219. package/node_modules/@alanszp/errors/node_modules/@types/node/dgram.d.ts +0 -596
  220. package/node_modules/@alanszp/errors/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  221. package/node_modules/@alanszp/errors/node_modules/@types/node/dns/promises.d.ts +0 -425
  222. package/node_modules/@alanszp/errors/node_modules/@types/node/dns.d.ts +0 -809
  223. package/node_modules/@alanszp/errors/node_modules/@types/node/dom-events.d.ts +0 -122
  224. package/node_modules/@alanszp/errors/node_modules/@types/node/domain.d.ts +0 -170
  225. package/node_modules/@alanszp/errors/node_modules/@types/node/events.d.ts +0 -879
  226. package/node_modules/@alanszp/errors/node_modules/@types/node/fs/promises.d.ts +0 -1239
  227. package/node_modules/@alanszp/errors/node_modules/@types/node/fs.d.ts +0 -4311
  228. package/node_modules/@alanszp/errors/node_modules/@types/node/globals.d.ts +0 -411
  229. package/node_modules/@alanszp/errors/node_modules/@types/node/globals.global.d.ts +0 -1
  230. package/node_modules/@alanszp/errors/node_modules/@types/node/http.d.ts +0 -1887
  231. package/node_modules/@alanszp/errors/node_modules/@types/node/http2.d.ts +0 -2382
  232. package/node_modules/@alanszp/errors/node_modules/@types/node/https.d.ts +0 -550
  233. package/node_modules/@alanszp/errors/node_modules/@types/node/index.d.ts +0 -88
  234. package/node_modules/@alanszp/errors/node_modules/@types/node/inspector.d.ts +0 -2747
  235. package/node_modules/@alanszp/errors/node_modules/@types/node/module.d.ts +0 -315
  236. package/node_modules/@alanszp/errors/node_modules/@types/node/net.d.ts +0 -949
  237. package/node_modules/@alanszp/errors/node_modules/@types/node/os.d.ts +0 -478
  238. package/node_modules/@alanszp/errors/node_modules/@types/node/package.json +0 -229
  239. package/node_modules/@alanszp/errors/node_modules/@types/node/path.d.ts +0 -191
  240. package/node_modules/@alanszp/errors/node_modules/@types/node/perf_hooks.d.ts +0 -645
  241. package/node_modules/@alanszp/errors/node_modules/@types/node/process.d.ts +0 -1561
  242. package/node_modules/@alanszp/errors/node_modules/@types/node/punycode.d.ts +0 -117
  243. package/node_modules/@alanszp/errors/node_modules/@types/node/querystring.d.ts +0 -141
  244. package/node_modules/@alanszp/errors/node_modules/@types/node/readline/promises.d.ts +0 -150
  245. package/node_modules/@alanszp/errors/node_modules/@types/node/readline.d.ts +0 -539
  246. package/node_modules/@alanszp/errors/node_modules/@types/node/repl.d.ts +0 -430
  247. package/node_modules/@alanszp/errors/node_modules/@types/node/stream/consumers.d.ts +0 -12
  248. package/node_modules/@alanszp/errors/node_modules/@types/node/stream/promises.d.ts +0 -83
  249. package/node_modules/@alanszp/errors/node_modules/@types/node/stream/web.d.ts +0 -366
  250. package/node_modules/@alanszp/errors/node_modules/@types/node/stream.d.ts +0 -1701
  251. package/node_modules/@alanszp/errors/node_modules/@types/node/string_decoder.d.ts +0 -67
  252. package/node_modules/@alanszp/errors/node_modules/@types/node/test.d.ts +0 -1465
  253. package/node_modules/@alanszp/errors/node_modules/@types/node/timers/promises.d.ts +0 -93
  254. package/node_modules/@alanszp/errors/node_modules/@types/node/timers.d.ts +0 -240
  255. package/node_modules/@alanszp/errors/node_modules/@types/node/tls.d.ts +0 -1210
  256. package/node_modules/@alanszp/errors/node_modules/@types/node/trace_events.d.ts +0 -182
  257. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  258. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  259. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  260. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  261. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  262. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  263. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  264. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  265. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  266. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  267. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  268. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  269. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  270. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  271. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  272. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  273. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  274. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  275. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  276. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  277. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  278. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  279. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  280. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  281. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  282. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  283. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  284. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  285. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  286. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  287. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  288. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  289. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  290. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  291. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  292. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  293. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  294. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  295. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  296. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  297. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  298. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  299. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  300. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  301. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  302. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  303. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  304. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  305. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  306. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  307. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  308. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  309. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  310. package/node_modules/@alanszp/errors/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  311. package/node_modules/@alanszp/errors/node_modules/@types/node/tty.d.ts +0 -208
  312. package/node_modules/@alanszp/errors/node_modules/@types/node/url.d.ts +0 -927
  313. package/node_modules/@alanszp/errors/node_modules/@types/node/util.d.ts +0 -2183
  314. package/node_modules/@alanszp/errors/node_modules/@types/node/v8.d.ts +0 -764
  315. package/node_modules/@alanszp/errors/node_modules/@types/node/vm.d.ts +0 -903
  316. package/node_modules/@alanszp/errors/node_modules/@types/node/wasi.d.ts +0 -179
  317. package/node_modules/@alanszp/errors/node_modules/@types/node/worker_threads.d.ts +0 -691
  318. package/node_modules/@alanszp/errors/node_modules/@types/node/zlib.d.ts +0 -517
  319. package/node_modules/@alanszp/errors/package.json +0 -33
  320. package/node_modules/@alanszp/errors/src/BaseError.ts +0 -14
  321. package/node_modules/@alanszp/errors/src/HttpRenderableError.ts +0 -5
  322. package/node_modules/@alanszp/errors/src/InternalServerError.ts +0 -32
  323. package/node_modules/@alanszp/errors/src/RenderableError.ts +0 -37
  324. package/node_modules/@alanszp/errors/src/index.ts +0 -4
  325. package/node_modules/@alanszp/errors/tsconfig.json +0 -15
  326. package/node_modules/@alanszp/express/.gitignore +0 -3
  327. package/node_modules/@alanszp/express/.npmignore +0 -3
  328. package/node_modules/@alanszp/express/LICENSE +0 -21
  329. package/node_modules/@alanszp/express/babel.config.js +0 -7
  330. package/node_modules/@alanszp/express/dist/helpers/getIp.d.ts +0 -2
  331. package/node_modules/@alanszp/express/dist/helpers/getIp.js +0 -9
  332. package/node_modules/@alanszp/express/dist/helpers/getIp.js.map +0 -1
  333. package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.d.ts +0 -2
  334. package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.js +0 -10
  335. package/node_modules/@alanszp/express/dist/helpers/getRequestLogger.js.map +0 -1
  336. package/node_modules/@alanszp/express/dist/helpers/now.d.ts +0 -1
  337. package/node_modules/@alanszp/express/dist/helpers/now.js +0 -8
  338. package/node_modules/@alanszp/express/dist/helpers/now.js.map +0 -1
  339. package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.d.ts +0 -4
  340. package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.js +0 -32
  341. package/node_modules/@alanszp/express/dist/helpers/renderErrorJson.js.map +0 -1
  342. package/node_modules/@alanszp/express/dist/index.d.ts +0 -10
  343. package/node_modules/@alanszp/express/dist/index.js +0 -23
  344. package/node_modules/@alanszp/express/dist/index.js.map +0 -1
  345. package/node_modules/@alanszp/express/dist/middlewares/accessLogger.d.ts +0 -3
  346. package/node_modules/@alanszp/express/dist/middlewares/accessLogger.js +0 -30
  347. package/node_modules/@alanszp/express/dist/middlewares/accessLogger.js.map +0 -1
  348. package/node_modules/@alanszp/express/dist/middlewares/auditLog.d.ts +0 -8
  349. package/node_modules/@alanszp/express/dist/middlewares/auditLog.js +0 -44
  350. package/node_modules/@alanszp/express/dist/middlewares/auditLog.js.map +0 -1
  351. package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.d.ts +0 -3
  352. package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.js +0 -45
  353. package/node_modules/@alanszp/express/dist/middlewares/authedForOrg.js.map +0 -1
  354. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.d.ts +0 -25
  355. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.js +0 -115
  356. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.js.map +0 -1
  357. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.d.ts +0 -1
  358. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.js +0 -308
  359. package/node_modules/@alanszp/express/dist/middlewares/authenticateUser.test.js.map +0 -1
  360. package/node_modules/@alanszp/express/dist/middlewares/createContext.d.ts +0 -6
  361. package/node_modules/@alanszp/express/dist/middlewares/createContext.js +0 -35
  362. package/node_modules/@alanszp/express/dist/middlewares/createContext.js.map +0 -1
  363. package/node_modules/@alanszp/express/dist/middlewares/createContext.test.d.ts +0 -1
  364. package/node_modules/@alanszp/express/dist/middlewares/createContext.test.js +0 -50
  365. package/node_modules/@alanszp/express/dist/middlewares/createContext.test.js.map +0 -1
  366. package/node_modules/@alanszp/express/dist/middlewares/hasRoles.d.ts +0 -3
  367. package/node_modules/@alanszp/express/dist/middlewares/hasRoles.js +0 -21
  368. package/node_modules/@alanszp/express/dist/middlewares/hasRoles.js.map +0 -1
  369. package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.d.ts +0 -4
  370. package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.js +0 -22
  371. package/node_modules/@alanszp/express/dist/middlewares/jsonBodyParser.js.map +0 -1
  372. package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.d.ts +0 -4
  373. package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.js +0 -10
  374. package/node_modules/@alanszp/express/dist/middlewares/returnInternalServerError.js.map +0 -1
  375. package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.d.ts +0 -3
  376. package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.js +0 -9
  377. package/node_modules/@alanszp/express/dist/middlewares/returnNotFound.js.map +0 -1
  378. package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.d.ts +0 -8
  379. package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.js +0 -30
  380. package/node_modules/@alanszp/express/dist/test/mocks/authOptionsMocks.js.map +0 -1
  381. package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.d.ts +0 -6
  382. package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.js +0 -26
  383. package/node_modules/@alanszp/express/dist/test/mocks/expressMocks.js.map +0 -1
  384. package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.d.ts +0 -3
  385. package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.js +0 -21
  386. package/node_modules/@alanszp/express/dist/test/mocks/jwtUserMocks.js.map +0 -1
  387. package/node_modules/@alanszp/express/dist/test/setup.d.ts +0 -1
  388. package/node_modules/@alanszp/express/dist/test/setup.js +0 -5
  389. package/node_modules/@alanszp/express/dist/test/setup.js.map +0 -1
  390. package/node_modules/@alanszp/express/dist/test/setup.test.d.ts +0 -1
  391. package/node_modules/@alanszp/express/dist/test/setup.test.js +0 -14
  392. package/node_modules/@alanszp/express/dist/test/setup.test.js.map +0 -1
  393. package/node_modules/@alanszp/express/dist/types/AuthMethod.d.ts +0 -10
  394. package/node_modules/@alanszp/express/dist/types/AuthMethod.js +0 -3
  395. package/node_modules/@alanszp/express/dist/types/AuthMethod.js.map +0 -1
  396. package/node_modules/@alanszp/express/dist/types/GenericRequest.d.ts +0 -2
  397. package/node_modules/@alanszp/express/dist/types/GenericRequest.js +0 -3
  398. package/node_modules/@alanszp/express/dist/types/GenericRequest.js.map +0 -1
  399. package/node_modules/@alanszp/express/jest.config.js +0 -10
  400. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/LICENSE +0 -21
  401. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/README.md +0 -5
  402. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/index.d.ts +0 -93
  403. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/index.js +0 -37
  404. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/jasmineUtils.js +0 -282
  405. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/types.js +0 -1
  406. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/build/utils.js +0 -457
  407. package/node_modules/@alanszp/express/node_modules/@jest/expect-utils/package.json +0 -33
  408. package/node_modules/@alanszp/express/node_modules/@jest/types/LICENSE +0 -21
  409. package/node_modules/@alanszp/express/node_modules/@jest/types/README.md +0 -30
  410. package/node_modules/@alanszp/express/node_modules/@jest/types/build/Circus.js +0 -1
  411. package/node_modules/@alanszp/express/node_modules/@jest/types/build/Config.js +0 -1
  412. package/node_modules/@alanszp/express/node_modules/@jest/types/build/Global.js +0 -1
  413. package/node_modules/@alanszp/express/node_modules/@jest/types/build/TestResult.js +0 -1
  414. package/node_modules/@alanszp/express/node_modules/@jest/types/build/Transform.js +0 -1
  415. package/node_modules/@alanszp/express/node_modules/@jest/types/build/index.d.ts +0 -1166
  416. package/node_modules/@alanszp/express/node_modules/@jest/types/build/index.js +0 -1
  417. package/node_modules/@alanszp/express/node_modules/@jest/types/package.json +0 -38
  418. package/node_modules/@alanszp/express/node_modules/@types/jest/LICENSE +0 -21
  419. package/node_modules/@alanszp/express/node_modules/@types/jest/README.md +0 -17
  420. package/node_modules/@alanszp/express/node_modules/@types/jest/index.d.ts +0 -1608
  421. package/node_modules/@alanszp/express/node_modules/@types/jest/package.json +0 -159
  422. package/node_modules/@alanszp/express/node_modules/@types/node/LICENSE +0 -21
  423. package/node_modules/@alanszp/express/node_modules/@types/node/README.md +0 -15
  424. package/node_modules/@alanszp/express/node_modules/@types/node/assert/strict.d.ts +0 -8
  425. package/node_modules/@alanszp/express/node_modules/@types/node/assert.d.ts +0 -996
  426. package/node_modules/@alanszp/express/node_modules/@types/node/async_hooks.d.ts +0 -539
  427. package/node_modules/@alanszp/express/node_modules/@types/node/buffer.d.ts +0 -2362
  428. package/node_modules/@alanszp/express/node_modules/@types/node/child_process.d.ts +0 -1540
  429. package/node_modules/@alanszp/express/node_modules/@types/node/cluster.d.ts +0 -432
  430. package/node_modules/@alanszp/express/node_modules/@types/node/console.d.ts +0 -415
  431. package/node_modules/@alanszp/express/node_modules/@types/node/constants.d.ts +0 -19
  432. package/node_modules/@alanszp/express/node_modules/@types/node/crypto.d.ts +0 -4487
  433. package/node_modules/@alanszp/express/node_modules/@types/node/dgram.d.ts +0 -596
  434. package/node_modules/@alanszp/express/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  435. package/node_modules/@alanszp/express/node_modules/@types/node/dns/promises.d.ts +0 -425
  436. package/node_modules/@alanszp/express/node_modules/@types/node/dns.d.ts +0 -809
  437. package/node_modules/@alanszp/express/node_modules/@types/node/dom-events.d.ts +0 -122
  438. package/node_modules/@alanszp/express/node_modules/@types/node/domain.d.ts +0 -170
  439. package/node_modules/@alanszp/express/node_modules/@types/node/events.d.ts +0 -879
  440. package/node_modules/@alanszp/express/node_modules/@types/node/fs/promises.d.ts +0 -1239
  441. package/node_modules/@alanszp/express/node_modules/@types/node/fs.d.ts +0 -4311
  442. package/node_modules/@alanszp/express/node_modules/@types/node/globals.d.ts +0 -411
  443. package/node_modules/@alanszp/express/node_modules/@types/node/globals.global.d.ts +0 -1
  444. package/node_modules/@alanszp/express/node_modules/@types/node/http.d.ts +0 -1887
  445. package/node_modules/@alanszp/express/node_modules/@types/node/http2.d.ts +0 -2382
  446. package/node_modules/@alanszp/express/node_modules/@types/node/https.d.ts +0 -550
  447. package/node_modules/@alanszp/express/node_modules/@types/node/index.d.ts +0 -88
  448. package/node_modules/@alanszp/express/node_modules/@types/node/inspector.d.ts +0 -2747
  449. package/node_modules/@alanszp/express/node_modules/@types/node/module.d.ts +0 -315
  450. package/node_modules/@alanszp/express/node_modules/@types/node/net.d.ts +0 -949
  451. package/node_modules/@alanszp/express/node_modules/@types/node/os.d.ts +0 -478
  452. package/node_modules/@alanszp/express/node_modules/@types/node/package.json +0 -229
  453. package/node_modules/@alanszp/express/node_modules/@types/node/path.d.ts +0 -191
  454. package/node_modules/@alanszp/express/node_modules/@types/node/perf_hooks.d.ts +0 -645
  455. package/node_modules/@alanszp/express/node_modules/@types/node/process.d.ts +0 -1561
  456. package/node_modules/@alanszp/express/node_modules/@types/node/punycode.d.ts +0 -117
  457. package/node_modules/@alanszp/express/node_modules/@types/node/querystring.d.ts +0 -141
  458. package/node_modules/@alanszp/express/node_modules/@types/node/readline/promises.d.ts +0 -150
  459. package/node_modules/@alanszp/express/node_modules/@types/node/readline.d.ts +0 -539
  460. package/node_modules/@alanszp/express/node_modules/@types/node/repl.d.ts +0 -430
  461. package/node_modules/@alanszp/express/node_modules/@types/node/stream/consumers.d.ts +0 -12
  462. package/node_modules/@alanszp/express/node_modules/@types/node/stream/promises.d.ts +0 -83
  463. package/node_modules/@alanszp/express/node_modules/@types/node/stream/web.d.ts +0 -366
  464. package/node_modules/@alanszp/express/node_modules/@types/node/stream.d.ts +0 -1701
  465. package/node_modules/@alanszp/express/node_modules/@types/node/string_decoder.d.ts +0 -67
  466. package/node_modules/@alanszp/express/node_modules/@types/node/test.d.ts +0 -1465
  467. package/node_modules/@alanszp/express/node_modules/@types/node/timers/promises.d.ts +0 -93
  468. package/node_modules/@alanszp/express/node_modules/@types/node/timers.d.ts +0 -240
  469. package/node_modules/@alanszp/express/node_modules/@types/node/tls.d.ts +0 -1210
  470. package/node_modules/@alanszp/express/node_modules/@types/node/trace_events.d.ts +0 -182
  471. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  472. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  473. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  474. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  475. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  476. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  477. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  478. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  479. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  480. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  481. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  482. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  483. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  484. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  485. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  486. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  487. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  488. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  489. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  490. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  491. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  492. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  493. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  494. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  495. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  496. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  497. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  498. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  499. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  500. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  501. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  502. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  503. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  504. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  505. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  506. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  507. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  508. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  509. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  510. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  511. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  512. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  513. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  514. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  515. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  516. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  517. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  518. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  519. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  520. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  521. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  522. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  523. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  524. package/node_modules/@alanszp/express/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  525. package/node_modules/@alanszp/express/node_modules/@types/node/tty.d.ts +0 -208
  526. package/node_modules/@alanszp/express/node_modules/@types/node/url.d.ts +0 -927
  527. package/node_modules/@alanszp/express/node_modules/@types/node/util.d.ts +0 -2183
  528. package/node_modules/@alanszp/express/node_modules/@types/node/v8.d.ts +0 -764
  529. package/node_modules/@alanszp/express/node_modules/@types/node/vm.d.ts +0 -903
  530. package/node_modules/@alanszp/express/node_modules/@types/node/wasi.d.ts +0 -179
  531. package/node_modules/@alanszp/express/node_modules/@types/node/worker_threads.d.ts +0 -691
  532. package/node_modules/@alanszp/express/node_modules/@types/node/zlib.d.ts +0 -517
  533. package/node_modules/@alanszp/express/package.json +0 -49
  534. package/node_modules/@alanszp/express/src/helpers/getIp.ts +0 -5
  535. package/node_modules/@alanszp/express/src/helpers/getRequestLogger.ts +0 -6
  536. package/node_modules/@alanszp/express/src/helpers/now.ts +0 -3
  537. package/node_modules/@alanszp/express/src/helpers/renderErrorJson.ts +0 -29
  538. package/node_modules/@alanszp/express/src/index.ts +0 -10
  539. package/node_modules/@alanszp/express/src/middlewares/accessLogger.ts +0 -34
  540. package/node_modules/@alanszp/express/src/middlewares/auditLog.ts +0 -52
  541. package/node_modules/@alanszp/express/src/middlewares/authedForOrg.ts +0 -50
  542. package/node_modules/@alanszp/express/src/middlewares/authenticateUser.test.ts +0 -403
  543. package/node_modules/@alanszp/express/src/middlewares/authenticateUser.ts +0 -171
  544. package/node_modules/@alanszp/express/src/middlewares/createContext.test.ts +0 -85
  545. package/node_modules/@alanszp/express/src/middlewares/createContext.ts +0 -49
  546. package/node_modules/@alanszp/express/src/middlewares/hasRoles.ts +0 -24
  547. package/node_modules/@alanszp/express/src/middlewares/jsonBodyParser.ts +0 -22
  548. package/node_modules/@alanszp/express/src/middlewares/returnInternalServerError.ts +0 -15
  549. package/node_modules/@alanszp/express/src/middlewares/returnNotFound.ts +0 -11
  550. package/node_modules/@alanszp/express/src/test/mocks/authOptionsMocks.ts +0 -35
  551. package/node_modules/@alanszp/express/src/test/mocks/expressMocks.ts +0 -33
  552. package/node_modules/@alanszp/express/src/test/mocks/jwtUserMocks.ts +0 -19
  553. package/node_modules/@alanszp/express/src/test/setup.test.ts +0 -15
  554. package/node_modules/@alanszp/express/src/test/setup.ts +0 -3
  555. package/node_modules/@alanszp/express/src/types/AuthMethod.ts +0 -27
  556. package/node_modules/@alanszp/express/src/types/GenericRequest.ts +0 -3
  557. package/node_modules/@alanszp/express/src/types/custom.d.ts +0 -20
  558. package/node_modules/@alanszp/express/tsconfig.json +0 -18
  559. package/node_modules/@alanszp/jwt/.gitignore +0 -3
  560. package/node_modules/@alanszp/jwt/.npmignore +0 -3
  561. package/node_modules/@alanszp/jwt/LICENSE +0 -21
  562. package/node_modules/@alanszp/jwt/dist/JWTUser.d.ts +0 -31
  563. package/node_modules/@alanszp/jwt/dist/JWTUser.js +0 -62
  564. package/node_modules/@alanszp/jwt/dist/JWTUser.js.map +0 -1
  565. package/node_modules/@alanszp/jwt/dist/index.d.ts +0 -3
  566. package/node_modules/@alanszp/jwt/dist/index.js +0 -16
  567. package/node_modules/@alanszp/jwt/dist/index.js.map +0 -1
  568. package/node_modules/@alanszp/jwt/dist/jwt.d.ts +0 -11
  569. package/node_modules/@alanszp/jwt/dist/jwt.js +0 -67
  570. package/node_modules/@alanszp/jwt/dist/jwt.js.map +0 -1
  571. package/node_modules/@alanszp/jwt/dist/types.d.ts +0 -26
  572. package/node_modules/@alanszp/jwt/dist/types.js +0 -3
  573. package/node_modules/@alanszp/jwt/dist/types.js.map +0 -1
  574. package/node_modules/@alanszp/jwt/node_modules/@types/node/LICENSE +0 -21
  575. package/node_modules/@alanszp/jwt/node_modules/@types/node/README.md +0 -15
  576. package/node_modules/@alanszp/jwt/node_modules/@types/node/assert/strict.d.ts +0 -8
  577. package/node_modules/@alanszp/jwt/node_modules/@types/node/assert.d.ts +0 -996
  578. package/node_modules/@alanszp/jwt/node_modules/@types/node/async_hooks.d.ts +0 -539
  579. package/node_modules/@alanszp/jwt/node_modules/@types/node/buffer.d.ts +0 -2362
  580. package/node_modules/@alanszp/jwt/node_modules/@types/node/child_process.d.ts +0 -1540
  581. package/node_modules/@alanszp/jwt/node_modules/@types/node/cluster.d.ts +0 -432
  582. package/node_modules/@alanszp/jwt/node_modules/@types/node/console.d.ts +0 -415
  583. package/node_modules/@alanszp/jwt/node_modules/@types/node/constants.d.ts +0 -19
  584. package/node_modules/@alanszp/jwt/node_modules/@types/node/crypto.d.ts +0 -4487
  585. package/node_modules/@alanszp/jwt/node_modules/@types/node/dgram.d.ts +0 -596
  586. package/node_modules/@alanszp/jwt/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  587. package/node_modules/@alanszp/jwt/node_modules/@types/node/dns/promises.d.ts +0 -425
  588. package/node_modules/@alanszp/jwt/node_modules/@types/node/dns.d.ts +0 -809
  589. package/node_modules/@alanszp/jwt/node_modules/@types/node/dom-events.d.ts +0 -122
  590. package/node_modules/@alanszp/jwt/node_modules/@types/node/domain.d.ts +0 -170
  591. package/node_modules/@alanszp/jwt/node_modules/@types/node/events.d.ts +0 -879
  592. package/node_modules/@alanszp/jwt/node_modules/@types/node/fs/promises.d.ts +0 -1239
  593. package/node_modules/@alanszp/jwt/node_modules/@types/node/fs.d.ts +0 -4311
  594. package/node_modules/@alanszp/jwt/node_modules/@types/node/globals.d.ts +0 -411
  595. package/node_modules/@alanszp/jwt/node_modules/@types/node/globals.global.d.ts +0 -1
  596. package/node_modules/@alanszp/jwt/node_modules/@types/node/http.d.ts +0 -1887
  597. package/node_modules/@alanszp/jwt/node_modules/@types/node/http2.d.ts +0 -2382
  598. package/node_modules/@alanszp/jwt/node_modules/@types/node/https.d.ts +0 -550
  599. package/node_modules/@alanszp/jwt/node_modules/@types/node/index.d.ts +0 -88
  600. package/node_modules/@alanszp/jwt/node_modules/@types/node/inspector.d.ts +0 -2747
  601. package/node_modules/@alanszp/jwt/node_modules/@types/node/module.d.ts +0 -315
  602. package/node_modules/@alanszp/jwt/node_modules/@types/node/net.d.ts +0 -949
  603. package/node_modules/@alanszp/jwt/node_modules/@types/node/os.d.ts +0 -478
  604. package/node_modules/@alanszp/jwt/node_modules/@types/node/package.json +0 -229
  605. package/node_modules/@alanszp/jwt/node_modules/@types/node/path.d.ts +0 -191
  606. package/node_modules/@alanszp/jwt/node_modules/@types/node/perf_hooks.d.ts +0 -645
  607. package/node_modules/@alanszp/jwt/node_modules/@types/node/process.d.ts +0 -1561
  608. package/node_modules/@alanszp/jwt/node_modules/@types/node/punycode.d.ts +0 -117
  609. package/node_modules/@alanszp/jwt/node_modules/@types/node/querystring.d.ts +0 -141
  610. package/node_modules/@alanszp/jwt/node_modules/@types/node/readline/promises.d.ts +0 -150
  611. package/node_modules/@alanszp/jwt/node_modules/@types/node/readline.d.ts +0 -539
  612. package/node_modules/@alanszp/jwt/node_modules/@types/node/repl.d.ts +0 -430
  613. package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/consumers.d.ts +0 -12
  614. package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/promises.d.ts +0 -83
  615. package/node_modules/@alanszp/jwt/node_modules/@types/node/stream/web.d.ts +0 -366
  616. package/node_modules/@alanszp/jwt/node_modules/@types/node/stream.d.ts +0 -1701
  617. package/node_modules/@alanszp/jwt/node_modules/@types/node/string_decoder.d.ts +0 -67
  618. package/node_modules/@alanszp/jwt/node_modules/@types/node/test.d.ts +0 -1465
  619. package/node_modules/@alanszp/jwt/node_modules/@types/node/timers/promises.d.ts +0 -93
  620. package/node_modules/@alanszp/jwt/node_modules/@types/node/timers.d.ts +0 -240
  621. package/node_modules/@alanszp/jwt/node_modules/@types/node/tls.d.ts +0 -1210
  622. package/node_modules/@alanszp/jwt/node_modules/@types/node/trace_events.d.ts +0 -182
  623. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  624. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  625. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  626. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  627. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  628. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  629. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  630. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  631. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  632. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  633. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  634. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  635. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  636. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  637. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  638. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  639. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  640. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  641. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  642. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  643. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  644. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  645. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  646. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  647. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  648. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  649. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  650. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  651. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  652. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  653. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  654. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  655. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  656. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  657. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  658. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  659. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  660. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  661. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  662. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  663. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  664. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  665. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  666. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  667. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  668. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  669. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  670. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  671. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  672. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  673. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  674. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  675. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  676. package/node_modules/@alanszp/jwt/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  677. package/node_modules/@alanszp/jwt/node_modules/@types/node/tty.d.ts +0 -208
  678. package/node_modules/@alanszp/jwt/node_modules/@types/node/url.d.ts +0 -927
  679. package/node_modules/@alanszp/jwt/node_modules/@types/node/util.d.ts +0 -2183
  680. package/node_modules/@alanszp/jwt/node_modules/@types/node/v8.d.ts +0 -764
  681. package/node_modules/@alanszp/jwt/node_modules/@types/node/vm.d.ts +0 -903
  682. package/node_modules/@alanszp/jwt/node_modules/@types/node/wasi.d.ts +0 -179
  683. package/node_modules/@alanszp/jwt/node_modules/@types/node/worker_threads.d.ts +0 -691
  684. package/node_modules/@alanszp/jwt/node_modules/@types/node/zlib.d.ts +0 -517
  685. package/node_modules/@alanszp/jwt/package.json +0 -29
  686. package/node_modules/@alanszp/jwt/src/JWTUser.ts +0 -85
  687. package/node_modules/@alanszp/jwt/src/index.ts +0 -3
  688. package/node_modules/@alanszp/jwt/src/jwt.ts +0 -81
  689. package/node_modules/@alanszp/jwt/src/types.ts +0 -31
  690. package/node_modules/@alanszp/jwt/tsconfig.json +0 -15
  691. package/node_modules/@alanszp/logger/.gitignore +0 -3
  692. package/node_modules/@alanszp/logger/.npmignore +0 -3
  693. package/node_modules/@alanszp/logger/LICENSE +0 -21
  694. package/node_modules/@alanszp/logger/dist/config.d.ts +0 -28
  695. package/node_modules/@alanszp/logger/dist/config.js +0 -3
  696. package/node_modules/@alanszp/logger/dist/config.js.map +0 -1
  697. package/node_modules/@alanszp/logger/dist/factory.d.ts +0 -5
  698. package/node_modules/@alanszp/logger/dist/factory.js +0 -55
  699. package/node_modules/@alanszp/logger/dist/factory.js.map +0 -1
  700. package/node_modules/@alanszp/logger/dist/index.d.ts +0 -5
  701. package/node_modules/@alanszp/logger/dist/index.js +0 -20
  702. package/node_modules/@alanszp/logger/dist/index.js.map +0 -1
  703. package/node_modules/@alanszp/logger/dist/interfaces.d.ts +0 -23
  704. package/node_modules/@alanszp/logger/dist/interfaces.js +0 -18
  705. package/node_modules/@alanszp/logger/dist/interfaces.js.map +0 -1
  706. package/node_modules/@alanszp/logger/dist/logger.d.ts +0 -14
  707. package/node_modules/@alanszp/logger/dist/logger.js +0 -45
  708. package/node_modules/@alanszp/logger/dist/logger.js.map +0 -1
  709. package/node_modules/@alanszp/logger/dist/mock.d.ts +0 -11
  710. package/node_modules/@alanszp/logger/dist/mock.js +0 -32
  711. package/node_modules/@alanszp/logger/dist/mock.js.map +0 -1
  712. package/node_modules/@alanszp/logger/dist/serializer.d.ts +0 -5
  713. package/node_modules/@alanszp/logger/dist/serializer.js +0 -67
  714. package/node_modules/@alanszp/logger/dist/serializer.js.map +0 -1
  715. package/node_modules/@alanszp/logger/dist/slackBunyan.d.ts +0 -16
  716. package/node_modules/@alanszp/logger/dist/slackBunyan.js +0 -108
  717. package/node_modules/@alanszp/logger/dist/slackBunyan.js.map +0 -1
  718. package/node_modules/@alanszp/logger/node_modules/@types/node/LICENSE +0 -21
  719. package/node_modules/@alanszp/logger/node_modules/@types/node/README.md +0 -15
  720. package/node_modules/@alanszp/logger/node_modules/@types/node/assert/strict.d.ts +0 -8
  721. package/node_modules/@alanszp/logger/node_modules/@types/node/assert.d.ts +0 -996
  722. package/node_modules/@alanszp/logger/node_modules/@types/node/async_hooks.d.ts +0 -539
  723. package/node_modules/@alanszp/logger/node_modules/@types/node/buffer.d.ts +0 -2362
  724. package/node_modules/@alanszp/logger/node_modules/@types/node/child_process.d.ts +0 -1540
  725. package/node_modules/@alanszp/logger/node_modules/@types/node/cluster.d.ts +0 -432
  726. package/node_modules/@alanszp/logger/node_modules/@types/node/console.d.ts +0 -415
  727. package/node_modules/@alanszp/logger/node_modules/@types/node/constants.d.ts +0 -19
  728. package/node_modules/@alanszp/logger/node_modules/@types/node/crypto.d.ts +0 -4487
  729. package/node_modules/@alanszp/logger/node_modules/@types/node/dgram.d.ts +0 -596
  730. package/node_modules/@alanszp/logger/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  731. package/node_modules/@alanszp/logger/node_modules/@types/node/dns/promises.d.ts +0 -425
  732. package/node_modules/@alanszp/logger/node_modules/@types/node/dns.d.ts +0 -809
  733. package/node_modules/@alanszp/logger/node_modules/@types/node/dom-events.d.ts +0 -122
  734. package/node_modules/@alanszp/logger/node_modules/@types/node/domain.d.ts +0 -170
  735. package/node_modules/@alanszp/logger/node_modules/@types/node/events.d.ts +0 -879
  736. package/node_modules/@alanszp/logger/node_modules/@types/node/fs/promises.d.ts +0 -1239
  737. package/node_modules/@alanszp/logger/node_modules/@types/node/fs.d.ts +0 -4311
  738. package/node_modules/@alanszp/logger/node_modules/@types/node/globals.d.ts +0 -411
  739. package/node_modules/@alanszp/logger/node_modules/@types/node/globals.global.d.ts +0 -1
  740. package/node_modules/@alanszp/logger/node_modules/@types/node/http.d.ts +0 -1887
  741. package/node_modules/@alanszp/logger/node_modules/@types/node/http2.d.ts +0 -2382
  742. package/node_modules/@alanszp/logger/node_modules/@types/node/https.d.ts +0 -550
  743. package/node_modules/@alanszp/logger/node_modules/@types/node/index.d.ts +0 -88
  744. package/node_modules/@alanszp/logger/node_modules/@types/node/inspector.d.ts +0 -2747
  745. package/node_modules/@alanszp/logger/node_modules/@types/node/module.d.ts +0 -315
  746. package/node_modules/@alanszp/logger/node_modules/@types/node/net.d.ts +0 -949
  747. package/node_modules/@alanszp/logger/node_modules/@types/node/os.d.ts +0 -478
  748. package/node_modules/@alanszp/logger/node_modules/@types/node/package.json +0 -229
  749. package/node_modules/@alanszp/logger/node_modules/@types/node/path.d.ts +0 -191
  750. package/node_modules/@alanszp/logger/node_modules/@types/node/perf_hooks.d.ts +0 -645
  751. package/node_modules/@alanszp/logger/node_modules/@types/node/process.d.ts +0 -1561
  752. package/node_modules/@alanszp/logger/node_modules/@types/node/punycode.d.ts +0 -117
  753. package/node_modules/@alanszp/logger/node_modules/@types/node/querystring.d.ts +0 -141
  754. package/node_modules/@alanszp/logger/node_modules/@types/node/readline/promises.d.ts +0 -150
  755. package/node_modules/@alanszp/logger/node_modules/@types/node/readline.d.ts +0 -539
  756. package/node_modules/@alanszp/logger/node_modules/@types/node/repl.d.ts +0 -430
  757. package/node_modules/@alanszp/logger/node_modules/@types/node/stream/consumers.d.ts +0 -12
  758. package/node_modules/@alanszp/logger/node_modules/@types/node/stream/promises.d.ts +0 -83
  759. package/node_modules/@alanszp/logger/node_modules/@types/node/stream/web.d.ts +0 -366
  760. package/node_modules/@alanszp/logger/node_modules/@types/node/stream.d.ts +0 -1701
  761. package/node_modules/@alanszp/logger/node_modules/@types/node/string_decoder.d.ts +0 -67
  762. package/node_modules/@alanszp/logger/node_modules/@types/node/test.d.ts +0 -1465
  763. package/node_modules/@alanszp/logger/node_modules/@types/node/timers/promises.d.ts +0 -93
  764. package/node_modules/@alanszp/logger/node_modules/@types/node/timers.d.ts +0 -240
  765. package/node_modules/@alanszp/logger/node_modules/@types/node/tls.d.ts +0 -1210
  766. package/node_modules/@alanszp/logger/node_modules/@types/node/trace_events.d.ts +0 -182
  767. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  768. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  769. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  770. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  771. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  772. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  773. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  774. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  775. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  776. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  777. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  778. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  779. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  780. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  781. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  782. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  783. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  784. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  785. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  786. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  787. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  788. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  789. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  790. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  791. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  792. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  793. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  794. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  795. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  796. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  797. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  798. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  799. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  800. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  801. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  802. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  803. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  804. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  805. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  806. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  807. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  808. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  809. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  810. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  811. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  812. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  813. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  814. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  815. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  816. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  817. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  818. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  819. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  820. package/node_modules/@alanszp/logger/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  821. package/node_modules/@alanszp/logger/node_modules/@types/node/tty.d.ts +0 -208
  822. package/node_modules/@alanszp/logger/node_modules/@types/node/url.d.ts +0 -927
  823. package/node_modules/@alanszp/logger/node_modules/@types/node/util.d.ts +0 -2183
  824. package/node_modules/@alanszp/logger/node_modules/@types/node/v8.d.ts +0 -764
  825. package/node_modules/@alanszp/logger/node_modules/@types/node/vm.d.ts +0 -903
  826. package/node_modules/@alanszp/logger/node_modules/@types/node/wasi.d.ts +0 -179
  827. package/node_modules/@alanszp/logger/node_modules/@types/node/worker_threads.d.ts +0 -691
  828. package/node_modules/@alanszp/logger/node_modules/@types/node/zlib.d.ts +0 -517
  829. package/node_modules/@alanszp/logger/package.json +0 -35
  830. package/node_modules/@alanszp/logger/src/config.ts +0 -34
  831. package/node_modules/@alanszp/logger/src/factory.ts +0 -68
  832. package/node_modules/@alanszp/logger/src/index.ts +0 -5
  833. package/node_modules/@alanszp/logger/src/interfaces.ts +0 -26
  834. package/node_modules/@alanszp/logger/src/logger.ts +0 -54
  835. package/node_modules/@alanszp/logger/src/mock.ts +0 -35
  836. package/node_modules/@alanszp/logger/src/serializer.ts +0 -65
  837. package/node_modules/@alanszp/logger/src/slackBunyan.ts +0 -133
  838. package/node_modules/@alanszp/logger/tsconfig.json +0 -15
  839. package/node_modules/@types/node/LICENSE +0 -21
  840. package/node_modules/@types/node/README.md +0 -15
  841. package/node_modules/@types/node/assert/strict.d.ts +0 -8
  842. package/node_modules/@types/node/assert.d.ts +0 -996
  843. package/node_modules/@types/node/async_hooks.d.ts +0 -539
  844. package/node_modules/@types/node/buffer.d.ts +0 -2362
  845. package/node_modules/@types/node/child_process.d.ts +0 -1540
  846. package/node_modules/@types/node/cluster.d.ts +0 -432
  847. package/node_modules/@types/node/console.d.ts +0 -415
  848. package/node_modules/@types/node/constants.d.ts +0 -19
  849. package/node_modules/@types/node/crypto.d.ts +0 -4487
  850. package/node_modules/@types/node/dgram.d.ts +0 -596
  851. package/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
  852. package/node_modules/@types/node/dns/promises.d.ts +0 -425
  853. package/node_modules/@types/node/dns.d.ts +0 -809
  854. package/node_modules/@types/node/dom-events.d.ts +0 -122
  855. package/node_modules/@types/node/domain.d.ts +0 -170
  856. package/node_modules/@types/node/events.d.ts +0 -879
  857. package/node_modules/@types/node/fs/promises.d.ts +0 -1239
  858. package/node_modules/@types/node/fs.d.ts +0 -4311
  859. package/node_modules/@types/node/globals.d.ts +0 -411
  860. package/node_modules/@types/node/globals.global.d.ts +0 -1
  861. package/node_modules/@types/node/http.d.ts +0 -1887
  862. package/node_modules/@types/node/http2.d.ts +0 -2382
  863. package/node_modules/@types/node/https.d.ts +0 -550
  864. package/node_modules/@types/node/index.d.ts +0 -88
  865. package/node_modules/@types/node/inspector.d.ts +0 -2747
  866. package/node_modules/@types/node/module.d.ts +0 -315
  867. package/node_modules/@types/node/net.d.ts +0 -949
  868. package/node_modules/@types/node/os.d.ts +0 -478
  869. package/node_modules/@types/node/package.json +0 -229
  870. package/node_modules/@types/node/path.d.ts +0 -191
  871. package/node_modules/@types/node/perf_hooks.d.ts +0 -645
  872. package/node_modules/@types/node/process.d.ts +0 -1561
  873. package/node_modules/@types/node/punycode.d.ts +0 -117
  874. package/node_modules/@types/node/querystring.d.ts +0 -141
  875. package/node_modules/@types/node/readline/promises.d.ts +0 -150
  876. package/node_modules/@types/node/readline.d.ts +0 -539
  877. package/node_modules/@types/node/repl.d.ts +0 -430
  878. package/node_modules/@types/node/stream/consumers.d.ts +0 -12
  879. package/node_modules/@types/node/stream/promises.d.ts +0 -83
  880. package/node_modules/@types/node/stream/web.d.ts +0 -366
  881. package/node_modules/@types/node/stream.d.ts +0 -1701
  882. package/node_modules/@types/node/string_decoder.d.ts +0 -67
  883. package/node_modules/@types/node/test.d.ts +0 -1465
  884. package/node_modules/@types/node/timers/promises.d.ts +0 -93
  885. package/node_modules/@types/node/timers.d.ts +0 -240
  886. package/node_modules/@types/node/tls.d.ts +0 -1210
  887. package/node_modules/@types/node/trace_events.d.ts +0 -182
  888. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  889. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  890. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  891. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  892. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  893. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  894. package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  895. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  896. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
  897. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
  898. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
  899. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  900. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  901. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  902. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  903. package/node_modules/@types/node/ts4.8/events.d.ts +0 -879
  904. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
  905. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
  906. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
  907. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  908. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
  909. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  910. package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  911. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  912. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  913. package/node_modules/@types/node/ts4.8/module.d.ts +0 -315
  914. package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  915. package/node_modules/@types/node/ts4.8/os.d.ts +0 -478
  916. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  917. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
  918. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
  919. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  920. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  921. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  922. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  923. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  924. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  925. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  926. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
  927. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  928. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  929. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
  930. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  931. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  932. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  933. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  934. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  935. package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  936. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
  937. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
  938. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
  939. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
  940. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  941. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  942. package/node_modules/@types/node/tty.d.ts +0 -208
  943. package/node_modules/@types/node/url.d.ts +0 -927
  944. package/node_modules/@types/node/util.d.ts +0 -2183
  945. package/node_modules/@types/node/v8.d.ts +0 -764
  946. package/node_modules/@types/node/vm.d.ts +0 -903
  947. package/node_modules/@types/node/wasi.d.ts +0 -179
  948. package/node_modules/@types/node/worker_threads.d.ts +0 -691
  949. package/node_modules/@types/node/zlib.d.ts +0 -517
  950. package/src/commonErrorsHandler.ts +0 -105
  951. 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
- }