@loaders.gl/parquet 4.0.0-alpha.9 → 4.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/dist/dist.min.js +21 -32
  2. package/dist/dist.min.js.map +3 -3
  3. package/dist/es5/buffer-polyfill/buffer-polyfill.browser.js +12 -0
  4. package/dist/es5/buffer-polyfill/buffer-polyfill.browser.js.map +1 -0
  5. package/dist/es5/buffer-polyfill/buffer-polyfill.node.js +16 -0
  6. package/dist/es5/buffer-polyfill/buffer-polyfill.node.js.map +1 -0
  7. package/dist/es5/buffer-polyfill/buffer.js +1665 -0
  8. package/dist/es5/buffer-polyfill/buffer.js.map +1 -0
  9. package/dist/es5/buffer-polyfill/index.js +27 -0
  10. package/dist/es5/buffer-polyfill/index.js.map +1 -0
  11. package/dist/es5/buffer-polyfill/install-buffer-polyfill.js +10 -0
  12. package/dist/es5/buffer-polyfill/install-buffer-polyfill.js.map +1 -0
  13. package/dist/es5/index.js +25 -28
  14. package/dist/es5/index.js.map +1 -1
  15. package/dist/es5/lib/geo/decode-geo-column.js +53 -0
  16. package/dist/es5/lib/geo/decode-geo-column.js.map +1 -0
  17. package/dist/es5/lib/geo/decode-geo-metadata.js +52 -16
  18. package/dist/es5/lib/geo/decode-geo-metadata.js.map +1 -1
  19. package/dist/es5/lib/geo/{geoparquet-schema.js → geoparquet-metadata-schema.js} +4 -4
  20. package/dist/es5/lib/geo/geoparquet-metadata-schema.js.map +1 -0
  21. package/dist/es5/lib/geo/geoparquet-metadata-schema.json +60 -0
  22. package/dist/es5/lib/parsers/get-parquet-schema.js +41 -0
  23. package/dist/es5/lib/parsers/get-parquet-schema.js.map +1 -0
  24. package/dist/es5/lib/parsers/parse-parquet-to-columns.js +71 -72
  25. package/dist/es5/lib/parsers/parse-parquet-to-columns.js.map +1 -1
  26. package/dist/es5/lib/parsers/parse-parquet-to-rows.js +95 -62
  27. package/dist/es5/lib/parsers/parse-parquet-to-rows.js.map +1 -1
  28. package/dist/es5/parquet-loader.js +14 -14
  29. package/dist/es5/parquet-loader.js.map +1 -1
  30. package/dist/es5/parquet-wasm-loader.js +8 -11
  31. package/dist/es5/parquet-wasm-loader.js.map +1 -1
  32. package/dist/es5/parquet-wasm-writer.js +6 -7
  33. package/dist/es5/parquet-wasm-writer.js.map +1 -1
  34. package/dist/es5/parquet-writer.js +2 -3
  35. package/dist/es5/parquet-writer.js.map +1 -1
  36. package/dist/es5/parquetjs/codecs/plain.js.map +1 -1
  37. package/dist/es5/parquetjs/codecs/rle.js.map +1 -1
  38. package/dist/es5/parquetjs/encoder/parquet-encoder.js.map +1 -1
  39. package/dist/es5/parquetjs/parquet-thrift/index.js +75 -0
  40. package/dist/es5/parquetjs/parquet-thrift/index.js.map +1 -1
  41. package/dist/es5/parquetjs/parser/decoders.js +53 -36
  42. package/dist/es5/parquetjs/parser/decoders.js.map +1 -1
  43. package/dist/es5/parquetjs/parser/parquet-reader.js +15 -13
  44. package/dist/es5/parquetjs/parser/parquet-reader.js.map +1 -1
  45. package/dist/es5/parquetjs/schema/declare.js.map +1 -1
  46. package/dist/es5/parquetjs/utils/read-utils.js +6 -7
  47. package/dist/es5/parquetjs/utils/read-utils.js.map +1 -1
  48. package/dist/esm/buffer-polyfill/buffer-polyfill.browser.js +6 -0
  49. package/dist/esm/buffer-polyfill/buffer-polyfill.browser.js.map +1 -0
  50. package/dist/esm/buffer-polyfill/buffer-polyfill.node.js +10 -0
  51. package/dist/esm/buffer-polyfill/buffer-polyfill.node.js.map +1 -0
  52. package/dist/esm/buffer-polyfill/buffer.js +1489 -0
  53. package/dist/esm/buffer-polyfill/buffer.js.map +1 -0
  54. package/dist/esm/buffer-polyfill/index.js +4 -0
  55. package/dist/esm/buffer-polyfill/index.js.map +1 -0
  56. package/dist/esm/buffer-polyfill/install-buffer-polyfill.js +3 -0
  57. package/dist/esm/buffer-polyfill/install-buffer-polyfill.js.map +1 -0
  58. package/dist/esm/index.js +4 -10
  59. package/dist/esm/index.js.map +1 -1
  60. package/dist/esm/lib/geo/decode-geo-column.js +47 -0
  61. package/dist/esm/lib/geo/decode-geo-column.js.map +1 -0
  62. package/dist/esm/lib/geo/decode-geo-metadata.js +32 -5
  63. package/dist/esm/lib/geo/decode-geo-metadata.js.map +1 -1
  64. package/dist/esm/lib/geo/{geoparquet-schema.js → geoparquet-metadata-schema.js} +2 -2
  65. package/dist/esm/lib/geo/geoparquet-metadata-schema.js.map +1 -0
  66. package/dist/esm/lib/geo/geoparquet-metadata-schema.json +60 -0
  67. package/dist/esm/lib/parsers/get-parquet-schema.js +11 -0
  68. package/dist/esm/lib/parsers/get-parquet-schema.js.map +1 -0
  69. package/dist/esm/lib/parsers/parse-parquet-to-columns.js +10 -11
  70. package/dist/esm/lib/parsers/parse-parquet-to-columns.js.map +1 -1
  71. package/dist/esm/lib/parsers/parse-parquet-to-rows.js +32 -7
  72. package/dist/esm/lib/parsers/parse-parquet-to-rows.js.map +1 -1
  73. package/dist/esm/parquet-loader.js +12 -12
  74. package/dist/esm/parquet-loader.js.map +1 -1
  75. package/dist/esm/parquet-wasm-loader.js +7 -9
  76. package/dist/esm/parquet-wasm-loader.js.map +1 -1
  77. package/dist/esm/parquet-wasm-writer.js +6 -7
  78. package/dist/esm/parquet-wasm-writer.js.map +1 -1
  79. package/dist/esm/parquet-writer.js +2 -3
  80. package/dist/esm/parquet-writer.js.map +1 -1
  81. package/dist/esm/parquetjs/codecs/plain.js.map +1 -1
  82. package/dist/esm/parquetjs/codecs/rle.js.map +1 -1
  83. package/dist/esm/parquetjs/encoder/parquet-encoder.js.map +1 -1
  84. package/dist/esm/parquetjs/parquet-thrift/index.js +2 -0
  85. package/dist/esm/parquetjs/parquet-thrift/index.js.map +1 -1
  86. package/dist/esm/parquetjs/parser/decoders.js +48 -32
  87. package/dist/esm/parquetjs/parser/decoders.js.map +1 -1
  88. package/dist/esm/parquetjs/parser/parquet-reader.js +14 -12
  89. package/dist/esm/parquetjs/parser/parquet-reader.js.map +1 -1
  90. package/dist/esm/parquetjs/schema/declare.js.map +1 -1
  91. package/dist/esm/parquetjs/utils/read-utils.js +1 -1
  92. package/dist/esm/parquetjs/utils/read-utils.js.map +1 -1
  93. package/dist/parquet-worker.js +23 -34
  94. package/dist/parquet-worker.js.map +3 -3
  95. package/dist/src/buffer-polyfill/buffer-polyfill.browser.d.ts +4 -0
  96. package/dist/src/buffer-polyfill/buffer-polyfill.browser.d.ts.map +1 -0
  97. package/dist/src/buffer-polyfill/buffer-polyfill.node.d.ts +4 -0
  98. package/dist/src/buffer-polyfill/buffer-polyfill.node.d.ts.map +1 -0
  99. package/dist/src/buffer-polyfill/buffer.d.ts +222 -0
  100. package/dist/src/buffer-polyfill/buffer.d.ts.map +1 -0
  101. package/dist/src/buffer-polyfill/index.d.ts +4 -0
  102. package/dist/src/buffer-polyfill/index.d.ts.map +1 -0
  103. package/dist/src/buffer-polyfill/install-buffer-polyfill.d.ts +30 -0
  104. package/dist/src/buffer-polyfill/install-buffer-polyfill.d.ts.map +1 -0
  105. package/dist/src/bundle.d.ts.map +1 -0
  106. package/dist/src/constants.d.ts.map +1 -0
  107. package/dist/{index.d.ts → src/index.d.ts} +6 -10
  108. package/dist/src/index.d.ts.map +1 -0
  109. package/dist/src/lib/arrow/convert-columns-to-row-group.d.ts.map +1 -0
  110. package/dist/src/lib/arrow/convert-row-group-to-columns.d.ts.map +1 -0
  111. package/dist/src/lib/arrow/convert-schema-from-parquet.d.ts.map +1 -0
  112. package/dist/src/lib/arrow/convert-schema-to-parquet.d.ts.map +1 -0
  113. package/dist/src/lib/geo/decode-geo-column.d.ts +4 -0
  114. package/dist/src/lib/geo/decode-geo-column.d.ts.map +1 -0
  115. package/dist/src/lib/geo/decode-geo-metadata.d.ts +44 -0
  116. package/dist/src/lib/geo/decode-geo-metadata.d.ts.map +1 -0
  117. package/dist/{lib/geo/geoparquet-schema.d.ts → src/lib/geo/geoparquet-metadata-schema.d.ts} +2 -3
  118. package/dist/src/lib/geo/geoparquet-metadata-schema.d.ts.map +1 -0
  119. package/dist/src/lib/parsers/get-parquet-schema.d.ts +4 -0
  120. package/dist/src/lib/parsers/get-parquet-schema.d.ts.map +1 -0
  121. package/dist/src/lib/parsers/parse-parquet-to-columns.d.ts +6 -0
  122. package/dist/src/lib/parsers/parse-parquet-to-columns.d.ts.map +1 -0
  123. package/dist/src/lib/parsers/parse-parquet-to-rows.d.ts +6 -0
  124. package/dist/src/lib/parsers/parse-parquet-to-rows.d.ts.map +1 -0
  125. package/dist/src/lib/wasm/encode-parquet-wasm.d.ts.map +1 -0
  126. package/dist/src/lib/wasm/load-wasm/index.d.ts.map +1 -0
  127. package/dist/src/lib/wasm/load-wasm/load-wasm-browser.d.ts.map +1 -0
  128. package/dist/src/lib/wasm/load-wasm/load-wasm-node.d.ts.map +1 -0
  129. package/dist/src/lib/wasm/parse-parquet-wasm.d.ts.map +1 -0
  130. package/dist/src/parquet-loader.d.ts +22 -0
  131. package/dist/src/parquet-loader.d.ts.map +1 -0
  132. package/dist/src/parquet-wasm-loader.d.ts +12 -0
  133. package/dist/src/parquet-wasm-loader.d.ts.map +1 -0
  134. package/dist/src/parquet-wasm-writer.d.ts +6 -0
  135. package/dist/src/parquet-wasm-writer.d.ts.map +1 -0
  136. package/dist/src/parquet-writer.d.ts.map +1 -0
  137. package/dist/src/parquetjs/codecs/declare.d.ts.map +1 -0
  138. package/dist/src/parquetjs/codecs/dictionary.d.ts.map +1 -0
  139. package/dist/src/parquetjs/codecs/index.d.ts.map +1 -0
  140. package/dist/src/parquetjs/codecs/plain.d.ts.map +1 -0
  141. package/dist/src/parquetjs/codecs/rle.d.ts.map +1 -0
  142. package/dist/src/parquetjs/compression.d.ts.map +1 -0
  143. package/dist/src/parquetjs/encoder/parquet-encoder.d.ts.map +1 -0
  144. package/dist/src/parquetjs/parquet-thrift/BoundaryOrder.d.ts.map +1 -0
  145. package/dist/src/parquetjs/parquet-thrift/BsonType.d.ts.map +1 -0
  146. package/dist/src/parquetjs/parquet-thrift/ColumnChunk.d.ts.map +1 -0
  147. package/dist/src/parquetjs/parquet-thrift/ColumnIndex.d.ts.map +1 -0
  148. package/dist/src/parquetjs/parquet-thrift/ColumnMetaData.d.ts.map +1 -0
  149. package/dist/src/parquetjs/parquet-thrift/ColumnOrder.d.ts.map +1 -0
  150. package/dist/src/parquetjs/parquet-thrift/CompressionCodec.d.ts.map +1 -0
  151. package/dist/src/parquetjs/parquet-thrift/ConvertedType.d.ts.map +1 -0
  152. package/dist/src/parquetjs/parquet-thrift/DataPageHeader.d.ts.map +1 -0
  153. package/dist/src/parquetjs/parquet-thrift/DataPageHeaderV2.d.ts.map +1 -0
  154. package/dist/src/parquetjs/parquet-thrift/DateType.d.ts.map +1 -0
  155. package/dist/src/parquetjs/parquet-thrift/DecimalType.d.ts.map +1 -0
  156. package/dist/src/parquetjs/parquet-thrift/DictionaryPageHeader.d.ts.map +1 -0
  157. package/dist/src/parquetjs/parquet-thrift/Encoding.d.ts.map +1 -0
  158. package/dist/src/parquetjs/parquet-thrift/EnumType.d.ts.map +1 -0
  159. package/dist/src/parquetjs/parquet-thrift/FieldRepetitionType.d.ts.map +1 -0
  160. package/dist/src/parquetjs/parquet-thrift/FileMetaData.d.ts.map +1 -0
  161. package/dist/src/parquetjs/parquet-thrift/IndexPageHeader.d.ts.map +1 -0
  162. package/dist/src/parquetjs/parquet-thrift/IntType.d.ts.map +1 -0
  163. package/dist/src/parquetjs/parquet-thrift/JsonType.d.ts.map +1 -0
  164. package/dist/src/parquetjs/parquet-thrift/KeyValue.d.ts.map +1 -0
  165. package/dist/src/parquetjs/parquet-thrift/ListType.d.ts.map +1 -0
  166. package/dist/src/parquetjs/parquet-thrift/LogicalType.d.ts.map +1 -0
  167. package/dist/src/parquetjs/parquet-thrift/MapType.d.ts.map +1 -0
  168. package/dist/src/parquetjs/parquet-thrift/MicroSeconds.d.ts.map +1 -0
  169. package/dist/src/parquetjs/parquet-thrift/MilliSeconds.d.ts.map +1 -0
  170. package/dist/src/parquetjs/parquet-thrift/NullType.d.ts.map +1 -0
  171. package/dist/src/parquetjs/parquet-thrift/OffsetIndex.d.ts.map +1 -0
  172. package/dist/src/parquetjs/parquet-thrift/PageEncodingStats.d.ts.map +1 -0
  173. package/dist/src/parquetjs/parquet-thrift/PageHeader.d.ts.map +1 -0
  174. package/dist/src/parquetjs/parquet-thrift/PageLocation.d.ts.map +1 -0
  175. package/dist/src/parquetjs/parquet-thrift/PageType.d.ts.map +1 -0
  176. package/dist/src/parquetjs/parquet-thrift/RowGroup.d.ts.map +1 -0
  177. package/dist/src/parquetjs/parquet-thrift/SchemaElement.d.ts.map +1 -0
  178. package/dist/src/parquetjs/parquet-thrift/SortingColumn.d.ts.map +1 -0
  179. package/dist/src/parquetjs/parquet-thrift/Statistics.d.ts.map +1 -0
  180. package/dist/src/parquetjs/parquet-thrift/StringType.d.ts.map +1 -0
  181. package/dist/src/parquetjs/parquet-thrift/TimeType.d.ts.map +1 -0
  182. package/dist/src/parquetjs/parquet-thrift/TimeUnit.d.ts.map +1 -0
  183. package/dist/src/parquetjs/parquet-thrift/TimestampType.d.ts.map +1 -0
  184. package/dist/src/parquetjs/parquet-thrift/Type.d.ts.map +1 -0
  185. package/dist/src/parquetjs/parquet-thrift/TypeDefinedOrder.d.ts.map +1 -0
  186. package/dist/src/parquetjs/parquet-thrift/UUIDType.d.ts.map +1 -0
  187. package/dist/{parquetjs → src/parquetjs}/parquet-thrift/index.d.ts +2 -0
  188. package/dist/src/parquetjs/parquet-thrift/index.d.ts.map +1 -0
  189. package/dist/{parquetjs → src/parquetjs}/parser/decoders.d.ts +4 -4
  190. package/dist/src/parquetjs/parser/decoders.d.ts.map +1 -0
  191. package/dist/{parquetjs → src/parquetjs}/parser/parquet-reader.d.ts +5 -3
  192. package/dist/src/parquetjs/parser/parquet-reader.d.ts.map +1 -0
  193. package/dist/{parquetjs → src/parquetjs}/schema/declare.d.ts +3 -1
  194. package/dist/src/parquetjs/schema/declare.d.ts.map +1 -0
  195. package/dist/src/parquetjs/schema/schema.d.ts.map +1 -0
  196. package/dist/src/parquetjs/schema/shred.d.ts.map +1 -0
  197. package/dist/src/parquetjs/schema/types.d.ts.map +1 -0
  198. package/dist/src/parquetjs/utils/file-utils.d.ts.map +1 -0
  199. package/dist/src/parquetjs/utils/read-utils.d.ts.map +1 -0
  200. package/dist/src/workers/parquet-worker.d.ts.map +1 -0
  201. package/dist/tsconfig.tsbuildinfo +1 -0
  202. package/package.json +21 -9
  203. package/src/buffer-polyfill/buffer-polyfill.browser.ts +11 -0
  204. package/src/buffer-polyfill/buffer-polyfill.node.ts +15 -0
  205. package/src/buffer-polyfill/buffer.ts +2207 -0
  206. package/src/buffer-polyfill/index.ts +8 -0
  207. package/src/buffer-polyfill/install-buffer-polyfill.ts +3 -0
  208. package/src/index.ts +31 -17
  209. package/src/lib/geo/decode-geo-column.ts +54 -0
  210. package/src/lib/geo/decode-geo-metadata.ts +81 -15
  211. package/src/lib/geo/geoparquet-metadata-schema.json +60 -0
  212. package/src/lib/geo/{geoparquet-schema.ts → geoparquet-metadata-schema.ts} +1 -1
  213. package/src/lib/parsers/get-parquet-schema.ts +14 -0
  214. package/src/lib/parsers/parse-parquet-to-columns.ts +15 -13
  215. package/src/lib/parsers/parse-parquet-to-rows.ts +39 -11
  216. package/src/parquet-loader.ts +29 -16
  217. package/src/parquet-wasm-loader.ts +13 -13
  218. package/src/parquet-wasm-writer.ts +10 -8
  219. package/src/parquet-writer.ts +1 -3
  220. package/src/parquetjs/codecs/plain.ts +1 -0
  221. package/src/parquetjs/codecs/rle.ts +2 -0
  222. package/src/parquetjs/encoder/parquet-encoder.ts +1 -0
  223. package/src/parquetjs/parquet-thrift/index.ts +4 -0
  224. package/src/parquetjs/parser/decoders.ts +63 -41
  225. package/src/parquetjs/parser/parquet-reader.ts +19 -14
  226. package/src/parquetjs/schema/declare.ts +3 -1
  227. package/src/parquetjs/utils/read-utils.ts +2 -2
  228. package/dist/bundle.d.ts.map +0 -1
  229. package/dist/bundle.js +0 -5
  230. package/dist/constants.d.ts.map +0 -1
  231. package/dist/constants.js +0 -18
  232. package/dist/es5/lib/geo/geoparquet-schema.js.map +0 -1
  233. package/dist/esm/lib/geo/geoparquet-schema.js.map +0 -1
  234. package/dist/index.d.ts.map +0 -1
  235. package/dist/index.js +0 -58
  236. package/dist/lib/arrow/convert-columns-to-row-group.d.ts.map +0 -1
  237. package/dist/lib/arrow/convert-columns-to-row-group.js +0 -1
  238. package/dist/lib/arrow/convert-row-group-to-columns.d.ts.map +0 -1
  239. package/dist/lib/arrow/convert-row-group-to-columns.js +0 -12
  240. package/dist/lib/arrow/convert-schema-from-parquet.d.ts.map +0 -1
  241. package/dist/lib/arrow/convert-schema-from-parquet.js +0 -86
  242. package/dist/lib/arrow/convert-schema-to-parquet.d.ts.map +0 -1
  243. package/dist/lib/arrow/convert-schema-to-parquet.js +0 -71
  244. package/dist/lib/geo/decode-geo-metadata.d.ts +0 -31
  245. package/dist/lib/geo/decode-geo-metadata.d.ts.map +0 -1
  246. package/dist/lib/geo/decode-geo-metadata.js +0 -77
  247. package/dist/lib/geo/geoparquet-schema.d.ts.map +0 -1
  248. package/dist/lib/geo/geoparquet-schema.js +0 -69
  249. package/dist/lib/parsers/parse-parquet-to-columns.d.ts +0 -5
  250. package/dist/lib/parsers/parse-parquet-to-columns.d.ts.map +0 -1
  251. package/dist/lib/parsers/parse-parquet-to-columns.js +0 -46
  252. package/dist/lib/parsers/parse-parquet-to-rows.d.ts +0 -5
  253. package/dist/lib/parsers/parse-parquet-to-rows.d.ts.map +0 -1
  254. package/dist/lib/parsers/parse-parquet-to-rows.js +0 -37
  255. package/dist/lib/wasm/encode-parquet-wasm.d.ts.map +0 -1
  256. package/dist/lib/wasm/encode-parquet-wasm.js +0 -30
  257. package/dist/lib/wasm/load-wasm/index.d.ts.map +0 -1
  258. package/dist/lib/wasm/load-wasm/index.js +0 -5
  259. package/dist/lib/wasm/load-wasm/load-wasm-browser.d.ts.map +0 -1
  260. package/dist/lib/wasm/load-wasm/load-wasm-browser.js +0 -38
  261. package/dist/lib/wasm/load-wasm/load-wasm-node.d.ts.map +0 -1
  262. package/dist/lib/wasm/load-wasm/load-wasm-node.js +0 -31
  263. package/dist/lib/wasm/parse-parquet-wasm.d.ts.map +0 -1
  264. package/dist/lib/wasm/parse-parquet-wasm.js +0 -27
  265. package/dist/parquet-loader.d.ts +0 -14
  266. package/dist/parquet-loader.d.ts.map +0 -1
  267. package/dist/parquet-loader.js +0 -41
  268. package/dist/parquet-wasm-loader.d.ts +0 -23
  269. package/dist/parquet-wasm-loader.d.ts.map +0 -1
  270. package/dist/parquet-wasm-loader.js +0 -27
  271. package/dist/parquet-wasm-writer.d.ts +0 -3
  272. package/dist/parquet-wasm-writer.d.ts.map +0 -1
  273. package/dist/parquet-wasm-writer.js +0 -23
  274. package/dist/parquet-writer.d.ts.map +0 -1
  275. package/dist/parquet-writer.js +0 -22
  276. package/dist/parquetjs/codecs/declare.d.ts.map +0 -1
  277. package/dist/parquetjs/codecs/declare.js +0 -2
  278. package/dist/parquetjs/codecs/dictionary.d.ts.map +0 -1
  279. package/dist/parquetjs/codecs/dictionary.js +0 -14
  280. package/dist/parquetjs/codecs/index.d.ts.map +0 -1
  281. package/dist/parquetjs/codecs/index.js +0 -55
  282. package/dist/parquetjs/codecs/plain.d.ts.map +0 -1
  283. package/dist/parquetjs/codecs/plain.js +0 -211
  284. package/dist/parquetjs/codecs/rle.d.ts.map +0 -1
  285. package/dist/parquetjs/codecs/rle.js +0 -145
  286. package/dist/parquetjs/compression.d.ts.map +0 -1
  287. package/dist/parquetjs/compression.js +0 -183
  288. package/dist/parquetjs/encoder/parquet-encoder.d.ts.map +0 -1
  289. package/dist/parquetjs/encoder/parquet-encoder.js +0 -484
  290. package/dist/parquetjs/parquet-thrift/BoundaryOrder.d.ts.map +0 -1
  291. package/dist/parquetjs/parquet-thrift/BoundaryOrder.js +0 -15
  292. package/dist/parquetjs/parquet-thrift/BsonType.d.ts.map +0 -1
  293. package/dist/parquetjs/parquet-thrift/BsonType.js +0 -62
  294. package/dist/parquetjs/parquet-thrift/ColumnChunk.d.ts.map +0 -1
  295. package/dist/parquetjs/parquet-thrift/ColumnChunk.js +0 -211
  296. package/dist/parquetjs/parquet-thrift/ColumnIndex.d.ts.map +0 -1
  297. package/dist/parquetjs/parquet-thrift/ColumnIndex.js +0 -217
  298. package/dist/parquetjs/parquet-thrift/ColumnMetaData.d.ts.map +0 -1
  299. package/dist/parquetjs/parquet-thrift/ColumnMetaData.js +0 -402
  300. package/dist/parquetjs/parquet-thrift/ColumnOrder.d.ts.map +0 -1
  301. package/dist/parquetjs/parquet-thrift/ColumnOrder.js +0 -108
  302. package/dist/parquetjs/parquet-thrift/CompressionCodec.d.ts.map +0 -1
  303. package/dist/parquetjs/parquet-thrift/CompressionCodec.js +0 -20
  304. package/dist/parquetjs/parquet-thrift/ConvertedType.d.ts.map +0 -1
  305. package/dist/parquetjs/parquet-thrift/ConvertedType.js +0 -34
  306. package/dist/parquetjs/parquet-thrift/DataPageHeader.d.ts.map +0 -1
  307. package/dist/parquetjs/parquet-thrift/DataPageHeader.js +0 -170
  308. package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.d.ts.map +0 -1
  309. package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.js +0 -230
  310. package/dist/parquetjs/parquet-thrift/DateType.d.ts.map +0 -1
  311. package/dist/parquetjs/parquet-thrift/DateType.js +0 -62
  312. package/dist/parquetjs/parquet-thrift/DecimalType.d.ts.map +0 -1
  313. package/dist/parquetjs/parquet-thrift/DecimalType.js +0 -109
  314. package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.d.ts.map +0 -1
  315. package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.js +0 -126
  316. package/dist/parquetjs/parquet-thrift/Encoding.d.ts.map +0 -1
  317. package/dist/parquetjs/parquet-thrift/Encoding.js +0 -20
  318. package/dist/parquetjs/parquet-thrift/EnumType.d.ts.map +0 -1
  319. package/dist/parquetjs/parquet-thrift/EnumType.js +0 -62
  320. package/dist/parquetjs/parquet-thrift/FieldRepetitionType.d.ts.map +0 -1
  321. package/dist/parquetjs/parquet-thrift/FieldRepetitionType.js +0 -15
  322. package/dist/parquetjs/parquet-thrift/FileMetaData.d.ts.map +0 -1
  323. package/dist/parquetjs/parquet-thrift/FileMetaData.js +0 -260
  324. package/dist/parquetjs/parquet-thrift/IndexPageHeader.d.ts.map +0 -1
  325. package/dist/parquetjs/parquet-thrift/IndexPageHeader.js +0 -62
  326. package/dist/parquetjs/parquet-thrift/IntType.d.ts.map +0 -1
  327. package/dist/parquetjs/parquet-thrift/IntType.js +0 -109
  328. package/dist/parquetjs/parquet-thrift/JsonType.d.ts.map +0 -1
  329. package/dist/parquetjs/parquet-thrift/JsonType.js +0 -62
  330. package/dist/parquetjs/parquet-thrift/KeyValue.d.ts.map +0 -1
  331. package/dist/parquetjs/parquet-thrift/KeyValue.js +0 -106
  332. package/dist/parquetjs/parquet-thrift/ListType.d.ts.map +0 -1
  333. package/dist/parquetjs/parquet-thrift/ListType.js +0 -62
  334. package/dist/parquetjs/parquet-thrift/LogicalType.d.ts.map +0 -1
  335. package/dist/parquetjs/parquet-thrift/LogicalType.js +0 -384
  336. package/dist/parquetjs/parquet-thrift/MapType.d.ts.map +0 -1
  337. package/dist/parquetjs/parquet-thrift/MapType.js +0 -62
  338. package/dist/parquetjs/parquet-thrift/MicroSeconds.d.ts.map +0 -1
  339. package/dist/parquetjs/parquet-thrift/MicroSeconds.js +0 -62
  340. package/dist/parquetjs/parquet-thrift/MilliSeconds.d.ts.map +0 -1
  341. package/dist/parquetjs/parquet-thrift/MilliSeconds.js +0 -62
  342. package/dist/parquetjs/parquet-thrift/NullType.d.ts.map +0 -1
  343. package/dist/parquetjs/parquet-thrift/NullType.js +0 -62
  344. package/dist/parquetjs/parquet-thrift/OffsetIndex.d.ts.map +0 -1
  345. package/dist/parquetjs/parquet-thrift/OffsetIndex.js +0 -101
  346. package/dist/parquetjs/parquet-thrift/PageEncodingStats.d.ts.map +0 -1
  347. package/dist/parquetjs/parquet-thrift/PageEncodingStats.js +0 -131
  348. package/dist/parquetjs/parquet-thrift/PageHeader.d.ts.map +0 -1
  349. package/dist/parquetjs/parquet-thrift/PageHeader.js +0 -220
  350. package/dist/parquetjs/parquet-thrift/PageLocation.d.ts.map +0 -1
  351. package/dist/parquetjs/parquet-thrift/PageLocation.js +0 -145
  352. package/dist/parquetjs/parquet-thrift/PageType.d.ts.map +0 -1
  353. package/dist/parquetjs/parquet-thrift/PageType.js +0 -16
  354. package/dist/parquetjs/parquet-thrift/RowGroup.d.ts.map +0 -1
  355. package/dist/parquetjs/parquet-thrift/RowGroup.js +0 -186
  356. package/dist/parquetjs/parquet-thrift/SchemaElement.d.ts.map +0 -1
  357. package/dist/parquetjs/parquet-thrift/SchemaElement.js +0 -243
  358. package/dist/parquetjs/parquet-thrift/SortingColumn.d.ts.map +0 -1
  359. package/dist/parquetjs/parquet-thrift/SortingColumn.js +0 -131
  360. package/dist/parquetjs/parquet-thrift/Statistics.d.ts.map +0 -1
  361. package/dist/parquetjs/parquet-thrift/Statistics.js +0 -180
  362. package/dist/parquetjs/parquet-thrift/StringType.d.ts.map +0 -1
  363. package/dist/parquetjs/parquet-thrift/StringType.js +0 -62
  364. package/dist/parquetjs/parquet-thrift/TimeType.d.ts.map +0 -1
  365. package/dist/parquetjs/parquet-thrift/TimeType.js +0 -110
  366. package/dist/parquetjs/parquet-thrift/TimeUnit.d.ts.map +0 -1
  367. package/dist/parquetjs/parquet-thrift/TimeUnit.js +0 -131
  368. package/dist/parquetjs/parquet-thrift/TimestampType.d.ts.map +0 -1
  369. package/dist/parquetjs/parquet-thrift/TimestampType.js +0 -110
  370. package/dist/parquetjs/parquet-thrift/Type.d.ts.map +0 -1
  371. package/dist/parquetjs/parquet-thrift/Type.js +0 -20
  372. package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.d.ts.map +0 -1
  373. package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.js +0 -62
  374. package/dist/parquetjs/parquet-thrift/UUIDType.d.ts.map +0 -1
  375. package/dist/parquetjs/parquet-thrift/UUIDType.js +0 -62
  376. package/dist/parquetjs/parquet-thrift/index.d.ts.map +0 -1
  377. package/dist/parquetjs/parquet-thrift/index.js +0 -65
  378. package/dist/parquetjs/parser/decoders.d.ts.map +0 -1
  379. package/dist/parquetjs/parser/decoders.js +0 -318
  380. package/dist/parquetjs/parser/parquet-reader.d.ts.map +0 -1
  381. package/dist/parquetjs/parser/parquet-reader.js +0 -200
  382. package/dist/parquetjs/schema/declare.d.ts.map +0 -1
  383. package/dist/parquetjs/schema/declare.js +0 -12
  384. package/dist/parquetjs/schema/schema.d.ts.map +0 -1
  385. package/dist/parquetjs/schema/schema.js +0 -162
  386. package/dist/parquetjs/schema/shred.d.ts.map +0 -1
  387. package/dist/parquetjs/schema/shred.js +0 -355
  388. package/dist/parquetjs/schema/types.d.ts.map +0 -1
  389. package/dist/parquetjs/schema/types.js +0 -416
  390. package/dist/parquetjs/utils/file-utils.d.ts.map +0 -1
  391. package/dist/parquetjs/utils/file-utils.js +0 -43
  392. package/dist/parquetjs/utils/read-utils.d.ts.map +0 -1
  393. package/dist/parquetjs/utils/read-utils.js +0 -109
  394. package/dist/workers/parquet-worker.d.ts.map +0 -1
  395. package/dist/workers/parquet-worker.js +0 -5
  396. /package/dist/{bundle.d.ts → src/bundle.d.ts} +0 -0
  397. /package/dist/{constants.d.ts → src/constants.d.ts} +0 -0
  398. /package/dist/{lib → src/lib}/arrow/convert-columns-to-row-group.d.ts +0 -0
  399. /package/dist/{lib → src/lib}/arrow/convert-row-group-to-columns.d.ts +0 -0
  400. /package/dist/{lib → src/lib}/arrow/convert-schema-from-parquet.d.ts +0 -0
  401. /package/dist/{lib → src/lib}/arrow/convert-schema-to-parquet.d.ts +0 -0
  402. /package/dist/{lib → src/lib}/wasm/encode-parquet-wasm.d.ts +0 -0
  403. /package/dist/{lib → src/lib}/wasm/load-wasm/index.d.ts +0 -0
  404. /package/dist/{lib → src/lib}/wasm/load-wasm/load-wasm-browser.d.ts +0 -0
  405. /package/dist/{lib → src/lib}/wasm/load-wasm/load-wasm-node.d.ts +0 -0
  406. /package/dist/{lib → src/lib}/wasm/parse-parquet-wasm.d.ts +0 -0
  407. /package/dist/{parquet-writer.d.ts → src/parquet-writer.d.ts} +0 -0
  408. /package/dist/{parquetjs → src/parquetjs}/codecs/declare.d.ts +0 -0
  409. /package/dist/{parquetjs → src/parquetjs}/codecs/dictionary.d.ts +0 -0
  410. /package/dist/{parquetjs → src/parquetjs}/codecs/index.d.ts +0 -0
  411. /package/dist/{parquetjs → src/parquetjs}/codecs/plain.d.ts +0 -0
  412. /package/dist/{parquetjs → src/parquetjs}/codecs/rle.d.ts +0 -0
  413. /package/dist/{parquetjs → src/parquetjs}/compression.d.ts +0 -0
  414. /package/dist/{parquetjs → src/parquetjs}/encoder/parquet-encoder.d.ts +0 -0
  415. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/BoundaryOrder.d.ts +0 -0
  416. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/BsonType.d.ts +0 -0
  417. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/ColumnChunk.d.ts +0 -0
  418. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/ColumnIndex.d.ts +0 -0
  419. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/ColumnMetaData.d.ts +0 -0
  420. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/ColumnOrder.d.ts +0 -0
  421. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/CompressionCodec.d.ts +0 -0
  422. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/ConvertedType.d.ts +0 -0
  423. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/DataPageHeader.d.ts +0 -0
  424. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/DataPageHeaderV2.d.ts +0 -0
  425. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/DateType.d.ts +0 -0
  426. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/DecimalType.d.ts +0 -0
  427. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/DictionaryPageHeader.d.ts +0 -0
  428. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/Encoding.d.ts +0 -0
  429. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/EnumType.d.ts +0 -0
  430. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/FieldRepetitionType.d.ts +0 -0
  431. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/FileMetaData.d.ts +0 -0
  432. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/IndexPageHeader.d.ts +0 -0
  433. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/IntType.d.ts +0 -0
  434. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/JsonType.d.ts +0 -0
  435. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/KeyValue.d.ts +0 -0
  436. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/ListType.d.ts +0 -0
  437. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/LogicalType.d.ts +0 -0
  438. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/MapType.d.ts +0 -0
  439. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/MicroSeconds.d.ts +0 -0
  440. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/MilliSeconds.d.ts +0 -0
  441. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/NullType.d.ts +0 -0
  442. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/OffsetIndex.d.ts +0 -0
  443. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/PageEncodingStats.d.ts +0 -0
  444. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/PageHeader.d.ts +0 -0
  445. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/PageLocation.d.ts +0 -0
  446. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/PageType.d.ts +0 -0
  447. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/RowGroup.d.ts +0 -0
  448. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/SchemaElement.d.ts +0 -0
  449. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/SortingColumn.d.ts +0 -0
  450. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/Statistics.d.ts +0 -0
  451. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/StringType.d.ts +0 -0
  452. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/TimeType.d.ts +0 -0
  453. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/TimeUnit.d.ts +0 -0
  454. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/TimestampType.d.ts +0 -0
  455. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/Type.d.ts +0 -0
  456. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/TypeDefinedOrder.d.ts +0 -0
  457. /package/dist/{parquetjs → src/parquetjs}/parquet-thrift/UUIDType.d.ts +0 -0
  458. /package/dist/{parquetjs → src/parquetjs}/schema/schema.d.ts +0 -0
  459. /package/dist/{parquetjs → src/parquetjs}/schema/shred.d.ts +0 -0
  460. /package/dist/{parquetjs → src/parquetjs}/schema/types.d.ts +0 -0
  461. /package/dist/{parquetjs → src/parquetjs}/utils/file-utils.d.ts +0 -0
  462. /package/dist/{parquetjs → src/parquetjs}/utils/read-utils.d.ts +0 -0
  463. /package/dist/{workers → src/workers}/parquet-worker.d.ts +0 -0
@@ -0,0 +1,1489 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ /* !
3
+ * The buffer module from node.js, for the browser.
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ * https://github.com/feross/buffer/blob/master/AUTHORS.md
7
+ */
8
+ import base64 from 'base64-js';
9
+ import ieee754 from 'ieee754';
10
+ export const kMaxLength = 0x7fffffff;
11
+ export const INSPECT_MAX_BYTES = 50;
12
+ export class Buffer extends Uint8Array {
13
+ get parent() {
14
+ if (!Buffer.isBuffer(this)) return undefined;
15
+ return this.buffer;
16
+ }
17
+ get offset() {
18
+ if (!Buffer.isBuffer(this)) return undefined;
19
+ return this.byteOffset;
20
+ }
21
+ constructor(arg, encodingOrOffset, length) {
22
+ if (typeof arg !== 'number') {
23
+ return Buffer.from(arg, encodingOrOffset, length);
24
+ }
25
+ const size = arg;
26
+ if (size > kMaxLength) {
27
+ throw new RangeError("The value \"".concat(size, "\" is invalid for option \"size\""));
28
+ }
29
+ if (typeof encodingOrOffset === 'string') {
30
+ throw new TypeError('The "string" argument must be of type string. Received type number');
31
+ }
32
+ super(size < 0 ? 0 : checked(size) | 0);
33
+ _defineProperty(this, "_isBuffer", true);
34
+ return;
35
+ }
36
+ static from(value, encodingOrOffset, length) {
37
+ if (typeof value === 'string') {
38
+ return fromString(value, encodingOrOffset);
39
+ }
40
+ if (ArrayBuffer.isView(value)) {
41
+ return fromArrayView(value);
42
+ }
43
+ if (value == null) {
44
+ throw new TypeError("".concat('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ').concat(typeof value));
45
+ }
46
+ if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {
47
+ return fromArrayBuffer(value, encodingOrOffset, length);
48
+ }
49
+ if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {
50
+ return fromArrayBuffer(value, encodingOrOffset, length);
51
+ }
52
+ if (typeof value === 'number') {
53
+ throw new TypeError('The "value" argument must not be of type number. Received type number');
54
+ }
55
+ const valueOf = value.valueOf && value.valueOf();
56
+ if (valueOf != null && valueOf !== value) {
57
+ return Buffer.from(valueOf, encodingOrOffset, length);
58
+ }
59
+ const b = fromObject(value);
60
+ if (b) return b;
61
+ if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') {
62
+ return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length);
63
+ }
64
+ throw new TypeError("".concat('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ').concat(typeof value));
65
+ }
66
+ static isBuffer(b) {
67
+ return b != null && b._isBuffer === true && b !== Buffer.prototype;
68
+ }
69
+ static compare(a, b) {
70
+ if (!Buffer.isBuffer(a) && isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength);
71
+ if (!Buffer.isBuffer(b) && isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength);
72
+ if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
73
+ throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
74
+ }
75
+ if (a === b) return 0;
76
+ let x = a.length;
77
+ let y = b.length;
78
+ for (let i = 0, len = Math.min(x, y); i < len; ++i) {
79
+ if (a[i] !== b[i]) {
80
+ x = a[i];
81
+ y = b[i];
82
+ break;
83
+ }
84
+ }
85
+ if (x < y) return -1;
86
+ if (y < x) return 1;
87
+ return 0;
88
+ }
89
+ static isEncoding(encoding) {
90
+ switch (String(encoding).toLowerCase()) {
91
+ case 'hex':
92
+ case 'utf8':
93
+ case 'utf-8':
94
+ case 'ascii':
95
+ case 'latin1':
96
+ case 'binary':
97
+ case 'base64':
98
+ case 'ucs2':
99
+ case 'ucs-2':
100
+ case 'utf16le':
101
+ case 'utf-16le':
102
+ return true;
103
+ default:
104
+ return false;
105
+ }
106
+ }
107
+ static concat(list, length) {
108
+ if (!Array.isArray(list)) {
109
+ throw new TypeError('"list" argument must be an Array of Buffers');
110
+ }
111
+ if (list.length === 0) {
112
+ return Buffer.alloc(0);
113
+ }
114
+ let i;
115
+ if (length === undefined) {
116
+ length = 0;
117
+ for (i = 0; i < list.length; ++i) {
118
+ length += list[i].length;
119
+ }
120
+ }
121
+ const buffer = Buffer.allocUnsafe(length);
122
+ let pos = 0;
123
+ for (i = 0; i < list.length; ++i) {
124
+ let buf = list[i];
125
+ if (isInstance(buf, Uint8Array)) {
126
+ if (pos + buf.length > buffer.length) {
127
+ if (!Buffer.isBuffer(buf)) {
128
+ buf = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
129
+ }
130
+ buf.copy(buffer, pos);
131
+ } else {
132
+ Uint8Array.prototype.set.call(buffer, buf, pos);
133
+ }
134
+ } else if (!Buffer.isBuffer(buf)) {
135
+ throw new TypeError('"list" argument must be an Array of Buffers');
136
+ } else {
137
+ buf.copy(buffer, pos);
138
+ }
139
+ pos += buf.length;
140
+ }
141
+ return buffer;
142
+ }
143
+ static alloc(size, fill, encoding) {
144
+ return alloc(size, fill, encoding);
145
+ }
146
+ static allocUnsafe(size) {
147
+ assertSize(size);
148
+ return new Buffer(size);
149
+ }
150
+ static allocUnsafeSlow(size) {
151
+ return allocUnsafe(size);
152
+ }
153
+ includes(val, byteOffset, encoding) {
154
+ return this.indexOf(val, byteOffset, encoding) !== -1;
155
+ }
156
+ indexOf(val, byteOffset, encoding) {
157
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
158
+ }
159
+ lastIndexOf(val, byteOffset, encoding) {
160
+ return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
161
+ }
162
+ readInt8(offset, noAssert) {
163
+ offset = offset >>> 0;
164
+ if (!noAssert) checkOffset(offset, 1, this.length);
165
+ if (!(this[offset] & 0x80)) return this[offset];
166
+ return (0xff - this[offset] + 1) * -1;
167
+ }
168
+ readInt16LE(offset, noAssert) {
169
+ offset = offset >>> 0;
170
+ if (!noAssert) checkOffset(offset, 2, this.length);
171
+ const val = this[offset] | this[offset + 1] << 8;
172
+ return val & 0x8000 ? val | 0xffff0000 : val;
173
+ }
174
+ readInt16BE(offset, noAssert) {
175
+ offset = offset >>> 0;
176
+ if (!noAssert) checkOffset(offset, 2, this.length);
177
+ const val = this[offset + 1] | this[offset] << 8;
178
+ return val & 0x8000 ? val | 0xffff0000 : val;
179
+ }
180
+ readInt32LE(offset, noAssert) {
181
+ offset = offset >>> 0;
182
+ if (!noAssert) checkOffset(offset, 4, this.length);
183
+ return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
184
+ }
185
+ readInt32BE(offset, noAssert) {
186
+ offset = offset >>> 0;
187
+ if (!noAssert) checkOffset(offset, 4, this.length);
188
+ return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
189
+ }
190
+ readIntBE(offset, byteLength, noAssert) {
191
+ offset = offset >>> 0;
192
+ byteLength = byteLength >>> 0;
193
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
194
+ let i = byteLength;
195
+ let mul = 1;
196
+ let val = this[offset + --i];
197
+ while (i > 0 && (mul *= 0x100)) {
198
+ val += this[offset + --i] * mul;
199
+ }
200
+ mul *= 0x80;
201
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
202
+ return val;
203
+ }
204
+ readIntLE(offset, byteLength, noAssert) {
205
+ offset = offset >>> 0;
206
+ byteLength = byteLength >>> 0;
207
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
208
+ let val = this[offset];
209
+ let mul = 1;
210
+ let i = 0;
211
+ while (++i < byteLength && (mul *= 0x100)) {
212
+ val += this[offset + i] * mul;
213
+ }
214
+ mul *= 0x80;
215
+ if (val >= mul) val -= Math.pow(2, 8 * byteLength);
216
+ return val;
217
+ }
218
+ readBigInt64LE(offset) {
219
+ offset = offset >>> 0;
220
+ validateNumber(offset, 'offset');
221
+ const first = this[offset];
222
+ const last = this[offset + 7];
223
+ if (first === undefined || last === undefined) {
224
+ boundsError(offset, this.length - 8);
225
+ }
226
+ const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);
227
+ return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);
228
+ }
229
+ readBigInt64BE(offset) {
230
+ offset = offset >>> 0;
231
+ validateNumber(offset, 'offset');
232
+ const first = this[offset];
233
+ const last = this[offset + 7];
234
+ if (first === undefined || last === undefined) {
235
+ boundsError(offset, this.length - 8);
236
+ }
237
+ const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
238
+ return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);
239
+ }
240
+ readUInt8(offset, noAssert) {
241
+ offset = offset >>> 0;
242
+ if (!noAssert) checkOffset(offset, 1, this.length);
243
+ return this[offset];
244
+ }
245
+ readUInt16LE(offset, noAssert) {
246
+ offset = offset >>> 0;
247
+ if (!noAssert) checkOffset(offset, 2, this.length);
248
+ return this[offset] | this[offset + 1] << 8;
249
+ }
250
+ readUInt16BE(offset, noAssert) {
251
+ offset = offset >>> 0;
252
+ if (!noAssert) checkOffset(offset, 2, this.length);
253
+ return this[offset] << 8 | this[offset + 1];
254
+ }
255
+ readUInt32LE(offset, noAssert) {
256
+ offset = offset >>> 0;
257
+ if (!noAssert) checkOffset(offset, 4, this.length);
258
+ return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;
259
+ }
260
+ readUInt32BE(offset, noAssert) {
261
+ offset = offset >>> 0;
262
+ if (!noAssert) checkOffset(offset, 4, this.length);
263
+ return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
264
+ }
265
+ readUIntLE(offset, byteLength, noAssert) {
266
+ offset = offset >>> 0;
267
+ byteLength = byteLength >>> 0;
268
+ if (!noAssert) checkOffset(offset, byteLength, this.length);
269
+ let val = this[offset];
270
+ let mul = 1;
271
+ let i = 0;
272
+ while (++i < byteLength && (mul *= 0x100)) {
273
+ val += this[offset + i] * mul;
274
+ }
275
+ return val;
276
+ }
277
+ readUIntBE(offset, byteLength, noAssert) {
278
+ offset = offset >>> 0;
279
+ byteLength = byteLength >>> 0;
280
+ if (!noAssert) {
281
+ checkOffset(offset, byteLength, this.length);
282
+ }
283
+ let val = this[offset + --byteLength];
284
+ let mul = 1;
285
+ while (byteLength > 0 && (mul *= 0x100)) {
286
+ val += this[offset + --byteLength] * mul;
287
+ }
288
+ return val;
289
+ }
290
+ readBigUInt64LE(offset) {
291
+ offset = offset >>> 0;
292
+ validateNumber(offset, 'offset');
293
+ const first = this[offset];
294
+ const last = this[offset + 7];
295
+ if (first === undefined || last === undefined) {
296
+ boundsError(offset, this.length - 8);
297
+ }
298
+ const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;
299
+ const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;
300
+ return BigInt(lo) + (BigInt(hi) << BigInt(32));
301
+ }
302
+ readBigUInt64BE(offset) {
303
+ offset = offset >>> 0;
304
+ validateNumber(offset, 'offset');
305
+ const first = this[offset];
306
+ const last = this[offset + 7];
307
+ if (first === undefined || last === undefined) {
308
+ boundsError(offset, this.length - 8);
309
+ }
310
+ const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
311
+ const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;
312
+ return (BigInt(hi) << BigInt(32)) + BigInt(lo);
313
+ }
314
+ readFloatLE(offset, noAssert) {
315
+ offset = offset >>> 0;
316
+ if (!noAssert) checkOffset(offset, 4, this.length);
317
+ return ieee754.read(this, offset, true, 23, 4);
318
+ }
319
+ readFloatBE(offset, noAssert) {
320
+ offset = offset >>> 0;
321
+ if (!noAssert) checkOffset(offset, 4, this.length);
322
+ return ieee754.read(this, offset, false, 23, 4);
323
+ }
324
+ readDoubleLE(offset, noAssert) {
325
+ offset = offset >>> 0;
326
+ if (!noAssert) checkOffset(offset, 8, this.length);
327
+ return ieee754.read(this, offset, true, 52, 8);
328
+ }
329
+ readDoubleBE(offset, noAssert) {
330
+ offset = offset >>> 0;
331
+ if (!noAssert) checkOffset(offset, 8, this.length);
332
+ return ieee754.read(this, offset, false, 52, 8);
333
+ }
334
+ writeUInt8(value, offset, noAssert) {
335
+ value = Number(value);
336
+ offset = offset >>> 0;
337
+ if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
338
+ this[offset] = value & 0xff;
339
+ return offset + 1;
340
+ }
341
+ writeUInt16LE(value, offset, noAssert) {
342
+ value = Number(value);
343
+ offset = offset >>> 0;
344
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
345
+ this[offset] = value & 0xff;
346
+ this[offset + 1] = value >>> 8;
347
+ return offset + 2;
348
+ }
349
+ writeUInt16BE(value, offset, noAssert) {
350
+ value = Number(value);
351
+ offset = offset >>> 0;
352
+ if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
353
+ this[offset] = value >>> 8;
354
+ this[offset + 1] = value & 0xff;
355
+ return offset + 2;
356
+ }
357
+ writeUInt32LE(value, offset, noAssert) {
358
+ value = Number(value);
359
+ offset = offset >>> 0;
360
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
361
+ this[offset + 3] = value >>> 24;
362
+ this[offset + 2] = value >>> 16;
363
+ this[offset + 1] = value >>> 8;
364
+ this[offset] = value & 0xff;
365
+ return offset + 4;
366
+ }
367
+ writeUInt32BE(value, offset, noAssert) {
368
+ value = Number(value);
369
+ offset = offset >>> 0;
370
+ if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
371
+ this[offset] = value >>> 24;
372
+ this[offset + 1] = value >>> 16;
373
+ this[offset + 2] = value >>> 8;
374
+ this[offset + 3] = value & 0xff;
375
+ return offset + 4;
376
+ }
377
+ writeUIntLE(value, offset, byteLength, noAssert) {
378
+ value = Number(value);
379
+ offset = offset >>> 0;
380
+ byteLength = byteLength >>> 0;
381
+ if (!noAssert) {
382
+ const maxBytes = Math.pow(2, 8 * byteLength) - 1;
383
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
384
+ }
385
+ let mul = 1;
386
+ let i = 0;
387
+ this[offset] = value & 0xff;
388
+ while (++i < byteLength && (mul *= 0x100)) {
389
+ this[offset + i] = value / mul & 0xff;
390
+ }
391
+ return offset + byteLength;
392
+ }
393
+ writeUIntBE(value, offset, byteLength, noAssert) {
394
+ value = Number(value);
395
+ offset = offset >>> 0;
396
+ byteLength = byteLength >>> 0;
397
+ if (!noAssert) {
398
+ const maxBytes = Math.pow(2, 8 * byteLength) - 1;
399
+ checkInt(this, value, offset, byteLength, maxBytes, 0);
400
+ }
401
+ let i = byteLength - 1;
402
+ let mul = 1;
403
+ this[offset + i] = value & 0xff;
404
+ while (--i >= 0 && (mul *= 0x100)) {
405
+ this[offset + i] = value / mul & 0xff;
406
+ }
407
+ return offset + byteLength;
408
+ }
409
+ writeBigUInt64LE(value) {
410
+ let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
411
+ return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'));
412
+ }
413
+ writeBigUInt64BE(value) {
414
+ let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
415
+ return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'));
416
+ }
417
+ writeIntLE(value, offset, byteLength, noAssert) {
418
+ value = Number(value);
419
+ offset = offset >>> 0;
420
+ if (!noAssert) {
421
+ const limit = Math.pow(2, 8 * byteLength - 1);
422
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
423
+ }
424
+ let i = 0;
425
+ let mul = 1;
426
+ let sub = 0;
427
+ this[offset] = value & 0xff;
428
+ while (++i < byteLength && (mul *= 0x100)) {
429
+ if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
430
+ sub = 1;
431
+ }
432
+ this[offset + i] = (value / mul >> 0) - sub & 0xff;
433
+ }
434
+ return offset + byteLength;
435
+ }
436
+ writeIntBE(value, offset, byteLength, noAssert) {
437
+ value = Number(value);
438
+ offset = offset >>> 0;
439
+ if (!noAssert) {
440
+ const limit = Math.pow(2, 8 * byteLength - 1);
441
+ checkInt(this, value, offset, byteLength, limit - 1, -limit);
442
+ }
443
+ let i = byteLength - 1;
444
+ let mul = 1;
445
+ let sub = 0;
446
+ this[offset + i] = value & 0xff;
447
+ while (--i >= 0 && (mul *= 0x100)) {
448
+ if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
449
+ sub = 1;
450
+ }
451
+ this[offset + i] = (value / mul >> 0) - sub & 0xff;
452
+ }
453
+ return offset + byteLength;
454
+ }
455
+ writeInt8(value, offset, noAssert) {
456
+ value = Number(value);
457
+ offset = offset >>> 0;
458
+ if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
459
+ if (value < 0) value = 0xff + value + 1;
460
+ this[offset] = value & 0xff;
461
+ return offset + 1;
462
+ }
463
+ writeInt16LE(value, offset, noAssert) {
464
+ value = Number(value);
465
+ offset = offset >>> 0;
466
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
467
+ this[offset] = value & 0xff;
468
+ this[offset + 1] = value >>> 8;
469
+ return offset + 2;
470
+ }
471
+ writeInt16BE(value, offset, noAssert) {
472
+ value = Number(value);
473
+ offset = offset >>> 0;
474
+ if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
475
+ this[offset] = value >>> 8;
476
+ this[offset + 1] = value & 0xff;
477
+ return offset + 2;
478
+ }
479
+ writeInt32LE(value, offset, noAssert) {
480
+ value = Number(value);
481
+ offset = offset >>> 0;
482
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
483
+ this[offset] = value & 0xff;
484
+ this[offset + 1] = value >>> 8;
485
+ this[offset + 2] = value >>> 16;
486
+ this[offset + 3] = value >>> 24;
487
+ return offset + 4;
488
+ }
489
+ writeInt32BE(value, offset, noAssert) {
490
+ value = Number(value);
491
+ offset = offset >>> 0;
492
+ if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
493
+ if (value < 0) value = 0xffffffff + value + 1;
494
+ this[offset] = value >>> 24;
495
+ this[offset + 1] = value >>> 16;
496
+ this[offset + 2] = value >>> 8;
497
+ this[offset + 3] = value & 0xff;
498
+ return offset + 4;
499
+ }
500
+ writeBigInt64LE(value) {
501
+ let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
502
+ return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'));
503
+ }
504
+ writeBigInt64BE(value) {
505
+ let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
506
+ return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'));
507
+ }
508
+ writeFloatLE(value, offset, noAssert) {
509
+ return writeFloat(this, value, offset, true, noAssert);
510
+ }
511
+ writeFloatBE(value, offset, noAssert) {
512
+ return writeFloat(this, value, offset, false, noAssert);
513
+ }
514
+ writeDoubleLE(value, offset, noAssert) {
515
+ return writeDouble(this, value, offset, true, noAssert);
516
+ }
517
+ writeDoubleBE(value, offset, noAssert) {
518
+ return writeDouble(this, value, offset, false, noAssert);
519
+ }
520
+ write(string, offset, length, encoding) {
521
+ if (offset === undefined) {
522
+ encoding = 'utf8';
523
+ length = this.length;
524
+ offset = 0;
525
+ } else if (length === undefined && typeof offset === 'string') {
526
+ encoding = offset;
527
+ length = this.length;
528
+ offset = 0;
529
+ } else if (isFinite(offset)) {
530
+ offset = offset >>> 0;
531
+ if (isFinite(length)) {
532
+ length = length >>> 0;
533
+ if (encoding === undefined) encoding = 'utf8';
534
+ } else {
535
+ encoding = length;
536
+ length = undefined;
537
+ }
538
+ } else {
539
+ throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');
540
+ }
541
+ const remaining = this.length - offset;
542
+ if (length === undefined || length > remaining) length = remaining;
543
+ if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
544
+ throw new RangeError('Attempt to write outside buffer bounds');
545
+ }
546
+ if (!encoding) encoding = 'utf8';
547
+ let loweredCase = false;
548
+ for (;;) {
549
+ switch (encoding) {
550
+ case 'hex':
551
+ return hexWrite(this, string, offset, length);
552
+ case 'utf8':
553
+ case 'utf-8':
554
+ return utf8Write(this, string, offset, length);
555
+ case 'ascii':
556
+ case 'latin1':
557
+ case 'binary':
558
+ return asciiWrite(this, string, offset, length);
559
+ case 'base64':
560
+ return base64Write(this, string, offset, length);
561
+ case 'ucs2':
562
+ case 'ucs-2':
563
+ case 'utf16le':
564
+ case 'utf-16le':
565
+ return ucs2Write(this, string, offset, length);
566
+ default:
567
+ if (loweredCase) throw new TypeError("Unknown encoding: ".concat(encoding));
568
+ encoding = "".concat(encoding).toLowerCase();
569
+ loweredCase = true;
570
+ }
571
+ }
572
+ }
573
+ copy(target, targetStart, start, end) {
574
+ if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer');
575
+ if (!start) start = 0;
576
+ if (!end && end !== 0) end = this.length;
577
+ if (targetStart >= target.length) targetStart = target.length;
578
+ if (!targetStart) targetStart = 0;
579
+ if (end > 0 && end < start) end = start;
580
+ if (end === start) return 0;
581
+ if (target.length === 0 || this.length === 0) return 0;
582
+ if (targetStart < 0) {
583
+ throw new RangeError('targetStart out of bounds');
584
+ }
585
+ if (start < 0 || start >= this.length) throw new RangeError('Index out of range');
586
+ if (end < 0) throw new RangeError('sourceEnd out of bounds');
587
+ if (end > this.length) end = this.length;
588
+ if (target.length - targetStart < end - start) {
589
+ end = target.length - targetStart + start;
590
+ }
591
+ const len = end - start;
592
+ if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
593
+ this.copyWithin(targetStart, start, end);
594
+ } else {
595
+ Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart);
596
+ }
597
+ return len;
598
+ }
599
+ fill(val, start, end, encoding) {
600
+ if (typeof val === 'string') {
601
+ if (typeof start === 'string') {
602
+ encoding = start;
603
+ start = 0;
604
+ end = this.length;
605
+ } else if (typeof end === 'string') {
606
+ encoding = end;
607
+ end = this.length;
608
+ }
609
+ if (encoding !== undefined && typeof encoding !== 'string') {
610
+ throw new TypeError('encoding must be a string');
611
+ }
612
+ if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
613
+ throw new TypeError("Unknown encoding: ".concat(encoding));
614
+ }
615
+ if (val.length === 1) {
616
+ const code = val.charCodeAt(0);
617
+ if (encoding === 'utf8' && code < 128 || encoding === 'latin1') {
618
+ val = code;
619
+ }
620
+ }
621
+ } else if (typeof val === 'number') {
622
+ val = val & 255;
623
+ } else if (typeof val === 'boolean') {
624
+ val = Number(val);
625
+ }
626
+ if (start < 0 || this.length < start || this.length < end) {
627
+ throw new RangeError('Out of range index');
628
+ }
629
+ if (end <= start) {
630
+ return this;
631
+ }
632
+ start = start >>> 0;
633
+ end = end === undefined ? this.length : end >>> 0;
634
+ if (!val) val = 0;
635
+ let i;
636
+ if (typeof val === 'number') {
637
+ for (i = start; i < end; ++i) {
638
+ this[i] = val;
639
+ }
640
+ } else {
641
+ const bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding);
642
+ const len = bytes.length;
643
+ if (len === 0) {
644
+ throw new TypeError("The value \"".concat(val, "\" is invalid for argument \"value\""));
645
+ }
646
+ for (i = 0; i < end - start; ++i) {
647
+ this[i + start] = bytes[i % len];
648
+ }
649
+ }
650
+ return this;
651
+ }
652
+ swap16() {
653
+ const len = this.length;
654
+ if (len % 2 !== 0) {
655
+ throw new RangeError('Buffer size must be a multiple of 16-bits');
656
+ }
657
+ for (let i = 0; i < len; i += 2) {
658
+ swap(this, i, i + 1);
659
+ }
660
+ return this;
661
+ }
662
+ swap32() {
663
+ const len = this.length;
664
+ if (len % 4 !== 0) {
665
+ throw new RangeError('Buffer size must be a multiple of 32-bits');
666
+ }
667
+ for (let i = 0; i < len; i += 4) {
668
+ swap(this, i, i + 3);
669
+ swap(this, i + 1, i + 2);
670
+ }
671
+ return this;
672
+ }
673
+ swap64() {
674
+ const len = this.length;
675
+ if (len % 8 !== 0) {
676
+ throw new RangeError('Buffer size must be a multiple of 64-bits');
677
+ }
678
+ for (let i = 0; i < len; i += 8) {
679
+ swap(this, i, i + 7);
680
+ swap(this, i + 1, i + 6);
681
+ swap(this, i + 2, i + 5);
682
+ swap(this, i + 3, i + 4);
683
+ }
684
+ return this;
685
+ }
686
+ toString(encoding, start, end) {
687
+ const length = this.length;
688
+ if (length === 0) return '';
689
+ if (arguments.length === 0) return utf8Slice(this, 0, length);
690
+ return this._slowToString(...arguments);
691
+ }
692
+ inspect() {
693
+ let str = '';
694
+ const max = INSPECT_MAX_BYTES;
695
+ str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
696
+ if (this.length > max) str += ' ... ';
697
+ return "<Buffer ".concat(str, ">");
698
+ }
699
+ equals(b) {
700
+ if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer');
701
+ if (this === b) return true;
702
+ return Buffer.compare(this, b) === 0;
703
+ }
704
+ compare(target, start, end, thisStart, thisEnd) {
705
+ if (!Buffer.isBuffer(target) && isInstance(target, Uint8Array)) {
706
+ target = Buffer.from(target, target.offset, target.byteLength);
707
+ }
708
+ if (!Buffer.isBuffer(target)) {
709
+ throw new TypeError("".concat('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ').concat(typeof target));
710
+ }
711
+ if (start === undefined) {
712
+ start = 0;
713
+ }
714
+ if (end === undefined) {
715
+ end = target ? target.length : 0;
716
+ }
717
+ if (thisStart === undefined) {
718
+ thisStart = 0;
719
+ }
720
+ if (thisEnd === undefined) {
721
+ thisEnd = this.length;
722
+ }
723
+ if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
724
+ throw new RangeError('out of range index');
725
+ }
726
+ if (thisStart >= thisEnd && start >= end) {
727
+ return 0;
728
+ }
729
+ if (thisStart >= thisEnd) {
730
+ return -1;
731
+ }
732
+ if (start >= end) {
733
+ return 1;
734
+ }
735
+ start >>>= 0;
736
+ end >>>= 0;
737
+ thisStart >>>= 0;
738
+ thisEnd >>>= 0;
739
+ if (this === target) return 0;
740
+ let x = thisEnd - thisStart;
741
+ let y = end - start;
742
+ const len = Math.min(x, y);
743
+ const thisCopy = this.slice(thisStart, thisEnd);
744
+ const targetCopy = target.slice(start, end);
745
+ for (let i = 0; i < len; ++i) {
746
+ if (thisCopy[i] !== targetCopy[i]) {
747
+ x = thisCopy[i];
748
+ y = targetCopy[i];
749
+ break;
750
+ }
751
+ }
752
+ if (x < y) return -1;
753
+ if (y < x) return 1;
754
+ return 0;
755
+ }
756
+ toJSON() {
757
+ return {
758
+ type: 'Buffer',
759
+ data: Array.prototype.slice.call(this._arr || this, 0)
760
+ };
761
+ }
762
+ slice(start, end) {
763
+ const len = this.length;
764
+ start = ~~start;
765
+ end = end === undefined ? len : ~~end;
766
+ if (start < 0) {
767
+ start += len;
768
+ if (start < 0) start = 0;
769
+ } else if (start > len) {
770
+ start = len;
771
+ }
772
+ if (end < 0) {
773
+ end += len;
774
+ if (end < 0) end = 0;
775
+ } else if (end > len) {
776
+ end = len;
777
+ }
778
+ if (end < start) end = start;
779
+ const newBuf = this.subarray(start, end);
780
+ Object.setPrototypeOf(newBuf, Buffer.prototype);
781
+ return newBuf;
782
+ }
783
+ _slowToString(encoding, start, end) {
784
+ let loweredCase = false;
785
+ if (start === undefined || start < 0) {
786
+ start = 0;
787
+ }
788
+ if (start > this.length) {
789
+ return '';
790
+ }
791
+ if (end === undefined || end > this.length) {
792
+ end = this.length;
793
+ }
794
+ if (end <= 0) {
795
+ return '';
796
+ }
797
+ end >>>= 0;
798
+ start >>>= 0;
799
+ if (end <= start) {
800
+ return '';
801
+ }
802
+ if (!encoding) encoding = 'utf8';
803
+ while (true) {
804
+ switch (encoding) {
805
+ case 'hex':
806
+ return hexSlice(this, start, end);
807
+ case 'utf8':
808
+ case 'utf-8':
809
+ return utf8Slice(this, start, end);
810
+ case 'ascii':
811
+ return asciiSlice(this, start, end);
812
+ case 'latin1':
813
+ case 'binary':
814
+ return latin1Slice(this, start, end);
815
+ case 'base64':
816
+ return base64Slice(this, start, end);
817
+ case 'ucs2':
818
+ case 'ucs-2':
819
+ case 'utf16le':
820
+ case 'utf-16le':
821
+ return utf16leSlice(this, start, end);
822
+ default:
823
+ if (loweredCase) throw new TypeError("Unknown encoding: ".concat(encoding));
824
+ encoding = "".concat(encoding).toLowerCase();
825
+ loweredCase = true;
826
+ }
827
+ }
828
+ }
829
+ }
830
+ _defineProperty(Buffer, "poolSize", 8192);
831
+ function checkInt(buf, value, offset, ext, max, min) {
832
+ if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
833
+ if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
834
+ if (offset + ext > buf.length) throw new RangeError('Index out of range');
835
+ }
836
+ function wrtBigUInt64LE(buf, value, offset, min, max) {
837
+ checkIntBI(value, min, max, buf, offset, 7);
838
+ let lo = Number(value & BigInt(0xffffffff));
839
+ buf[offset++] = lo;
840
+ lo = lo >> 8;
841
+ buf[offset++] = lo;
842
+ lo = lo >> 8;
843
+ buf[offset++] = lo;
844
+ lo = lo >> 8;
845
+ buf[offset++] = lo;
846
+ let hi = Number(value >> BigInt(32) & BigInt(0xffffffff));
847
+ buf[offset++] = hi;
848
+ hi = hi >> 8;
849
+ buf[offset++] = hi;
850
+ hi = hi >> 8;
851
+ buf[offset++] = hi;
852
+ hi = hi >> 8;
853
+ buf[offset++] = hi;
854
+ return offset;
855
+ }
856
+ function wrtBigUInt64BE(buf, value, offset, min, max) {
857
+ checkIntBI(value, min, max, buf, offset, 7);
858
+ let lo = Number(value & BigInt(0xffffffff));
859
+ buf[offset + 7] = lo;
860
+ lo = lo >> 8;
861
+ buf[offset + 6] = lo;
862
+ lo = lo >> 8;
863
+ buf[offset + 5] = lo;
864
+ lo = lo >> 8;
865
+ buf[offset + 4] = lo;
866
+ let hi = Number(value >> BigInt(32) & BigInt(0xffffffff));
867
+ buf[offset + 3] = hi;
868
+ hi = hi >> 8;
869
+ buf[offset + 2] = hi;
870
+ hi = hi >> 8;
871
+ buf[offset + 1] = hi;
872
+ hi = hi >> 8;
873
+ buf[offset] = hi;
874
+ return offset + 8;
875
+ }
876
+ function assertSize(size) {
877
+ if (typeof size !== 'number') {
878
+ throw new TypeError('"size" argument must be of type number');
879
+ } else if (size < 0) {
880
+ throw new RangeError("The value \"".concat(size, "\" is invalid for option \"size\""));
881
+ }
882
+ }
883
+ function alloc(size, fill, encoding) {
884
+ assertSize(size);
885
+ if (size <= 0) {
886
+ return new Buffer(size);
887
+ }
888
+ if (fill !== undefined) {
889
+ return typeof encoding === 'string' ? new Buffer(size).fill(fill, encoding) : new Buffer(size).fill(fill);
890
+ }
891
+ return new Buffer(size);
892
+ }
893
+ function fromString(string, encoding) {
894
+ if (typeof encoding !== 'string' || encoding === '') {
895
+ encoding = 'utf8';
896
+ }
897
+ if (!Buffer.isEncoding(encoding)) {
898
+ throw new TypeError("Unknown encoding: ".concat(encoding));
899
+ }
900
+ const length = byteLength(string, encoding) | 0;
901
+ let buf = new Buffer(length);
902
+ const actual = buf.write(string, encoding);
903
+ if (actual !== length) {
904
+ buf = buf.slice(0, actual);
905
+ }
906
+ return buf;
907
+ }
908
+ function fromArrayLike(array) {
909
+ const length = array.length < 0 ? 0 : checked(array.length) | 0;
910
+ const buf = new Buffer(length);
911
+ for (let i = 0; i < length; i += 1) {
912
+ buf[i] = array[i] & 255;
913
+ }
914
+ return buf;
915
+ }
916
+ function fromArrayView(arrayView) {
917
+ if (isInstance(arrayView, Uint8Array)) {
918
+ const copy = new Uint8Array(arrayView);
919
+ return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);
920
+ }
921
+ return fromArrayLike(arrayView);
922
+ }
923
+ function fromArrayBuffer(array, byteOffset, length) {
924
+ if (byteOffset < 0 || array.byteLength < byteOffset) {
925
+ throw new RangeError('"offset" is outside of buffer bounds');
926
+ }
927
+ if (array.byteLength < byteOffset + (length || 0)) {
928
+ throw new RangeError('"length" is outside of buffer bounds');
929
+ }
930
+ let buf;
931
+ if (byteOffset === undefined && length === undefined) {
932
+ buf = new Uint8Array(array);
933
+ } else if (length === undefined) {
934
+ buf = new Uint8Array(array, byteOffset);
935
+ } else {
936
+ buf = new Uint8Array(array, byteOffset, length);
937
+ }
938
+ Object.setPrototypeOf(buf, Buffer.prototype);
939
+ return buf;
940
+ }
941
+ function fromObject(obj) {
942
+ if (Buffer.isBuffer(obj)) {
943
+ const len = checked(obj.length) | 0;
944
+ const buf = new Buffer(len);
945
+ if (buf.length === 0) {
946
+ return buf;
947
+ }
948
+ obj.copy(buf, 0, 0, len);
949
+ return buf;
950
+ }
951
+ if (obj.length !== undefined) {
952
+ if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
953
+ return new Buffer(0);
954
+ }
955
+ return fromArrayLike(obj);
956
+ }
957
+ if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
958
+ return fromArrayLike(obj.data);
959
+ }
960
+ }
961
+ function checked(length) {
962
+ if (length >= kMaxLength) {
963
+ throw new RangeError("".concat('Attempt to allocate Buffer larger than maximum ' + 'size: 0x').concat(kMaxLength.toString(16), " bytes"));
964
+ }
965
+ return length | 0;
966
+ }
967
+ function byteLength(string, encoding) {
968
+ if (Buffer.isBuffer(string)) {
969
+ return string.length;
970
+ }
971
+ if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
972
+ return string.byteLength;
973
+ }
974
+ if (typeof string !== 'string') {
975
+ throw new TypeError("".concat('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ').concat(typeof string));
976
+ }
977
+ const len = string.length;
978
+ const mustMatch = arguments.length > 2 && arguments[2] === true;
979
+ if (!mustMatch && len === 0) return 0;
980
+ let loweredCase = false;
981
+ for (;;) {
982
+ switch (encoding) {
983
+ case 'ascii':
984
+ case 'latin1':
985
+ case 'binary':
986
+ return len;
987
+ case 'utf8':
988
+ case 'utf-8':
989
+ return utf8ToBytes(string).length;
990
+ case 'ucs2':
991
+ case 'ucs-2':
992
+ case 'utf16le':
993
+ case 'utf-16le':
994
+ return len * 2;
995
+ case 'hex':
996
+ return len >>> 1;
997
+ case 'base64':
998
+ return base64ToBytes(string).length;
999
+ default:
1000
+ if (loweredCase) {
1001
+ return mustMatch ? -1 : utf8ToBytes(string).length;
1002
+ }
1003
+ encoding = "".concat(encoding).toLowerCase();
1004
+ loweredCase = true;
1005
+ }
1006
+ }
1007
+ }
1008
+ function swap(b, n, m) {
1009
+ const i = b[n];
1010
+ b[n] = b[m];
1011
+ b[m] = i;
1012
+ }
1013
+ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
1014
+ if (buffer.length === 0) return -1;
1015
+ if (typeof byteOffset === 'string') {
1016
+ encoding = byteOffset;
1017
+ byteOffset = 0;
1018
+ } else if (byteOffset > 0x7fffffff) {
1019
+ byteOffset = 0x7fffffff;
1020
+ } else if (byteOffset < -0x80000000) {
1021
+ byteOffset = -0x80000000;
1022
+ }
1023
+ byteOffset = Number(byteOffset);
1024
+ if (numberIsNaN(byteOffset)) {
1025
+ byteOffset = dir ? 0 : buffer.length - 1;
1026
+ }
1027
+ if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
1028
+ if (byteOffset >= buffer.length) {
1029
+ if (dir) return -1;
1030
+ byteOffset = buffer.length - 1;
1031
+ } else if (byteOffset < 0) {
1032
+ if (dir) byteOffset = 0;else return -1;
1033
+ }
1034
+ if (typeof val === 'string') {
1035
+ val = Buffer.from(val, encoding);
1036
+ }
1037
+ if (Buffer.isBuffer(val)) {
1038
+ if (val.length === 0) {
1039
+ return -1;
1040
+ }
1041
+ return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
1042
+ } else if (typeof val === 'number') {
1043
+ val = val & 0xff;
1044
+ if (typeof Uint8Array.prototype.indexOf === 'function') {
1045
+ if (dir) {
1046
+ return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
1047
+ }
1048
+ return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
1049
+ }
1050
+ return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
1051
+ }
1052
+ throw new TypeError('val must be string, number or Buffer');
1053
+ }
1054
+ function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
1055
+ let indexSize = 1;
1056
+ let arrLength = arr.length;
1057
+ let valLength = val.length;
1058
+ if (encoding !== undefined) {
1059
+ encoding = String(encoding).toLowerCase();
1060
+ if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {
1061
+ if (arr.length < 2 || val.length < 2) {
1062
+ return -1;
1063
+ }
1064
+ indexSize = 2;
1065
+ arrLength /= 2;
1066
+ valLength /= 2;
1067
+ byteOffset /= 2;
1068
+ }
1069
+ }
1070
+ function read(buf, i) {
1071
+ if (indexSize === 1) {
1072
+ return buf[i];
1073
+ }
1074
+ return buf.readUInt16BE(i * indexSize);
1075
+ }
1076
+ let i;
1077
+ if (dir) {
1078
+ let foundIndex = -1;
1079
+ for (i = byteOffset; i < arrLength; i++) {
1080
+ if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
1081
+ if (foundIndex === -1) foundIndex = i;
1082
+ if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
1083
+ } else {
1084
+ if (foundIndex !== -1) i -= i - foundIndex;
1085
+ foundIndex = -1;
1086
+ }
1087
+ }
1088
+ } else {
1089
+ if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
1090
+ for (i = byteOffset; i >= 0; i--) {
1091
+ let found = true;
1092
+ for (let j = 0; j < valLength; j++) {
1093
+ if (read(arr, i + j) !== read(val, j)) {
1094
+ found = false;
1095
+ break;
1096
+ }
1097
+ }
1098
+ if (found) return i;
1099
+ }
1100
+ }
1101
+ return -1;
1102
+ }
1103
+ function hexWrite(buf, string, offset, length) {
1104
+ offset = Number(offset) || 0;
1105
+ const remaining = buf.length - offset;
1106
+ if (!length) {
1107
+ length = remaining;
1108
+ } else {
1109
+ length = Number(length);
1110
+ if (length > remaining) {
1111
+ length = remaining;
1112
+ }
1113
+ }
1114
+ const strLen = string.length;
1115
+ if (length > strLen / 2) {
1116
+ length = strLen / 2;
1117
+ }
1118
+ let i;
1119
+ for (i = 0; i < length; ++i) {
1120
+ const parsed = parseInt(string.substr(i * 2, 2), 16);
1121
+ if (numberIsNaN(parsed)) return i;
1122
+ buf[offset + i] = parsed;
1123
+ }
1124
+ return i;
1125
+ }
1126
+ function utf8Write(buf, string, offset, length) {
1127
+ return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
1128
+ }
1129
+ function asciiWrite(buf, string, offset, length) {
1130
+ return blitBuffer(asciiToBytes(string), buf, offset, length);
1131
+ }
1132
+ function base64Write(buf, string, offset, length) {
1133
+ return blitBuffer(base64ToBytes(string), buf, offset, length);
1134
+ }
1135
+ function ucs2Write(buf, string, offset, length) {
1136
+ return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
1137
+ }
1138
+ function base64Slice(buf, start, end) {
1139
+ if (start === 0 && end === buf.length) {
1140
+ return base64.fromByteArray(buf);
1141
+ }
1142
+ return base64.fromByteArray(buf.slice(start, end));
1143
+ }
1144
+ function utf8Slice(buf, start, end) {
1145
+ end = Math.min(buf.length, end);
1146
+ const res = [];
1147
+ let i = start;
1148
+ while (i < end) {
1149
+ const firstByte = buf[i];
1150
+ let codePoint = null;
1151
+ let bytesPerSequence = firstByte > 0xef ? 4 : firstByte > 0xdf ? 3 : firstByte > 0xbf ? 2 : 1;
1152
+ if (i + bytesPerSequence <= end) {
1153
+ let fourthByte;
1154
+ let secondByte;
1155
+ let tempCodePoint;
1156
+ let thirdByte;
1157
+ switch (bytesPerSequence) {
1158
+ case 1:
1159
+ if (firstByte < 0x80) {
1160
+ codePoint = firstByte;
1161
+ }
1162
+ break;
1163
+ case 2:
1164
+ secondByte = buf[i + 1];
1165
+ if ((secondByte & 0xc0) === 0x80) {
1166
+ tempCodePoint = (firstByte & 0x1f) << 0x6 | secondByte & 0x3f;
1167
+ if (tempCodePoint > 0x7f) {
1168
+ codePoint = tempCodePoint;
1169
+ }
1170
+ }
1171
+ break;
1172
+ case 3:
1173
+ secondByte = buf[i + 1];
1174
+ thirdByte = buf[i + 2];
1175
+ if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80) {
1176
+ tempCodePoint = (firstByte & 0xf) << 0xc | (secondByte & 0x3f) << 0x6 | thirdByte & 0x3f;
1177
+ if (tempCodePoint > 0x7ff && (tempCodePoint < 0xd800 || tempCodePoint > 0xdfff)) {
1178
+ codePoint = tempCodePoint;
1179
+ }
1180
+ }
1181
+ break;
1182
+ case 4:
1183
+ secondByte = buf[i + 1];
1184
+ thirdByte = buf[i + 2];
1185
+ fourthByte = buf[i + 3];
1186
+ if ((secondByte & 0xc0) === 0x80 && (thirdByte & 0xc0) === 0x80 && (fourthByte & 0xc0) === 0x80) {
1187
+ tempCodePoint = (firstByte & 0xf) << 0x12 | (secondByte & 0x3f) << 0xc | (thirdByte & 0x3f) << 0x6 | fourthByte & 0x3f;
1188
+ if (tempCodePoint > 0xffff && tempCodePoint < 0x110000) {
1189
+ codePoint = tempCodePoint;
1190
+ }
1191
+ }
1192
+ }
1193
+ }
1194
+ if (codePoint === null) {
1195
+ codePoint = 0xfffd;
1196
+ bytesPerSequence = 1;
1197
+ } else if (codePoint > 0xffff) {
1198
+ codePoint -= 0x10000;
1199
+ res.push(codePoint >>> 10 & 0x3ff | 0xd800);
1200
+ codePoint = 0xdc00 | codePoint & 0x3ff;
1201
+ }
1202
+ res.push(codePoint);
1203
+ i += bytesPerSequence;
1204
+ }
1205
+ return decodeCodePointsArray(res);
1206
+ }
1207
+ const MAX_ARGUMENTS_LENGTH = 0x1000;
1208
+ function decodeCodePointsArray(codePoints) {
1209
+ const len = codePoints.length;
1210
+ if (len <= MAX_ARGUMENTS_LENGTH) {
1211
+ return String.fromCharCode.apply(String, codePoints);
1212
+ }
1213
+ let res = '';
1214
+ let i = 0;
1215
+ while (i < len) {
1216
+ res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
1217
+ }
1218
+ return res;
1219
+ }
1220
+ function asciiSlice(buf, start, end) {
1221
+ let ret = '';
1222
+ end = Math.min(buf.length, end);
1223
+ for (let i = start; i < end; ++i) {
1224
+ ret += String.fromCharCode(buf[i] & 0x7f);
1225
+ }
1226
+ return ret;
1227
+ }
1228
+ function latin1Slice(buf, start, end) {
1229
+ let ret = '';
1230
+ end = Math.min(buf.length, end);
1231
+ for (let i = start; i < end; ++i) {
1232
+ ret += String.fromCharCode(buf[i]);
1233
+ }
1234
+ return ret;
1235
+ }
1236
+ function hexSlice(buf, start, end) {
1237
+ const len = buf.length;
1238
+ if (!start || start < 0) start = 0;
1239
+ if (!end || end < 0 || end > len) end = len;
1240
+ let out = '';
1241
+ for (let i = start; i < end; ++i) {
1242
+ out += hexSliceLookupTable[buf[i]];
1243
+ }
1244
+ return out;
1245
+ }
1246
+ function utf16leSlice(buf, start, end) {
1247
+ const bytes = buf.slice(start, end);
1248
+ let res = '';
1249
+ for (let i = 0; i < bytes.length - 1; i += 2) {
1250
+ res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
1251
+ }
1252
+ return res;
1253
+ }
1254
+ function checkOffset(offset, ext, length) {
1255
+ if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');
1256
+ if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');
1257
+ }
1258
+ function checkIEEE754(buf, value, offset, ext, max, min) {
1259
+ if (offset + ext > buf.length) throw new RangeError('Index out of range');
1260
+ if (offset < 0) throw new RangeError('Index out of range');
1261
+ }
1262
+ function writeFloat(buf, value, offset, littleEndian, noAssert) {
1263
+ value = Number(value);
1264
+ offset = offset >>> 0;
1265
+ if (!noAssert) {
1266
+ checkIEEE754(buf, value, offset, 4, 3.4028234663852886e38, -3.4028234663852886e38);
1267
+ }
1268
+ ieee754.write(buf, value, offset, littleEndian, 23, 4);
1269
+ return offset + 4;
1270
+ }
1271
+ function writeDouble(buf, value, offset, littleEndian, noAssert) {
1272
+ value = Number(value);
1273
+ offset = offset >>> 0;
1274
+ if (!noAssert) {
1275
+ checkIEEE754(buf, value, offset, 8, 1.7976931348623157e308, -1.7976931348623157e308);
1276
+ }
1277
+ ieee754.write(buf, value, offset, littleEndian, 52, 8);
1278
+ return offset + 8;
1279
+ }
1280
+ const errors = {};
1281
+ function E(sym, getMessage, Base) {
1282
+ errors[sym] = class NodeError extends Base {
1283
+ constructor() {
1284
+ super();
1285
+ Object.defineProperty(this, 'message', {
1286
+ value: getMessage.apply(this, arguments),
1287
+ writable: true,
1288
+ configurable: true
1289
+ });
1290
+ this.name = "".concat(this.name, " [").concat(sym, "]");
1291
+ this.stack;
1292
+ delete this.name;
1293
+ }
1294
+ get code() {
1295
+ return sym;
1296
+ }
1297
+ set code(value) {
1298
+ Object.defineProperty(this, 'code', {
1299
+ configurable: true,
1300
+ enumerable: true,
1301
+ value,
1302
+ writable: true
1303
+ });
1304
+ }
1305
+ toString() {
1306
+ return "".concat(this.name, " [").concat(sym, "]: ").concat(this.message);
1307
+ }
1308
+ };
1309
+ }
1310
+ E('ERR_BUFFER_OUT_OF_BOUNDS', function (name) {
1311
+ if (name) {
1312
+ return "".concat(name, " is outside of buffer bounds");
1313
+ }
1314
+ return 'Attempt to access memory outside buffer bounds';
1315
+ }, RangeError);
1316
+ E('ERR_INVALID_ARG_TYPE', function (name, actual) {
1317
+ return "The \"".concat(name, "\" argument must be of type number. Received type ").concat(typeof actual);
1318
+ }, TypeError);
1319
+ E('ERR_OUT_OF_RANGE', function (str, range, input) {
1320
+ let msg = "The value of \"".concat(str, "\" is out of range.");
1321
+ let received = input;
1322
+ if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {
1323
+ received = addNumericalSeparator(String(input));
1324
+ } else if (typeof input === 'bigint') {
1325
+ received = String(input);
1326
+ if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {
1327
+ received = addNumericalSeparator(received);
1328
+ }
1329
+ received += 'n';
1330
+ }
1331
+ msg += " It must be ".concat(range, ". Received ").concat(received);
1332
+ return msg;
1333
+ }, RangeError);
1334
+ function addNumericalSeparator(val) {
1335
+ let res = '';
1336
+ let i = val.length;
1337
+ const start = val[0] === '-' ? 1 : 0;
1338
+ for (; i >= start + 4; i -= 3) {
1339
+ res = "_".concat(val.slice(i - 3, i)).concat(res);
1340
+ }
1341
+ return "".concat(val.slice(0, i)).concat(res);
1342
+ }
1343
+ function checkBounds(buf, offset, byteLength) {
1344
+ validateNumber(offset, 'offset');
1345
+ if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {
1346
+ boundsError(offset, buf.length - (byteLength + 1));
1347
+ }
1348
+ }
1349
+ function checkIntBI(value, min, max, buf, offset, byteLength) {
1350
+ if (value > max || value < min) {
1351
+ const n = typeof min === 'bigint' ? 'n' : '';
1352
+ let range;
1353
+ if (byteLength > 3) {
1354
+ if (min === 0 || min === BigInt(0)) {
1355
+ range = ">= 0".concat(n, " and < 2").concat(n, " ** ").concat((byteLength + 1) * 8).concat(n);
1356
+ } else {
1357
+ range = ">= -(2".concat(n, " ** ").concat((byteLength + 1) * 8 - 1).concat(n, ") and < 2 ** ") + "".concat((byteLength + 1) * 8 - 1).concat(n);
1358
+ }
1359
+ } else {
1360
+ range = ">= ".concat(min).concat(n, " and <= ").concat(max).concat(n);
1361
+ }
1362
+ throw new errors.ERR_OUT_OF_RANGE('value', range, value);
1363
+ }
1364
+ checkBounds(buf, offset, byteLength);
1365
+ }
1366
+ function validateNumber(value, name) {
1367
+ if (typeof value !== 'number') {
1368
+ throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value);
1369
+ }
1370
+ }
1371
+ function boundsError(value, length, type) {
1372
+ if (Math.floor(value) !== value) {
1373
+ validateNumber(value, type);
1374
+ throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value);
1375
+ }
1376
+ if (length < 0) {
1377
+ throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();
1378
+ }
1379
+ throw new errors.ERR_OUT_OF_RANGE(type || 'offset', ">= ".concat(type ? 1 : 0, " and <= ").concat(length), value);
1380
+ }
1381
+ const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;
1382
+ function base64clean(str) {
1383
+ str = str.split('=')[0];
1384
+ str = str.trim().replace(INVALID_BASE64_RE, '');
1385
+ if (str.length < 2) return '';
1386
+ while (str.length % 4 !== 0) {
1387
+ str = "".concat(str, "=");
1388
+ }
1389
+ return str;
1390
+ }
1391
+ function utf8ToBytes(string, units) {
1392
+ units = units || Infinity;
1393
+ let codePoint;
1394
+ const length = string.length;
1395
+ let leadSurrogate = null;
1396
+ const bytes = [];
1397
+ for (let i = 0; i < length; ++i) {
1398
+ codePoint = string.charCodeAt(i);
1399
+ if (codePoint > 0xd7ff && codePoint < 0xe000) {
1400
+ if (!leadSurrogate) {
1401
+ if (codePoint > 0xdbff) {
1402
+ if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd);
1403
+ continue;
1404
+ } else if (i + 1 === length) {
1405
+ if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd);
1406
+ continue;
1407
+ }
1408
+ leadSurrogate = codePoint;
1409
+ continue;
1410
+ }
1411
+ if (codePoint < 0xdc00) {
1412
+ if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd);
1413
+ leadSurrogate = codePoint;
1414
+ continue;
1415
+ }
1416
+ codePoint = (leadSurrogate - 0xd800 << 10 | codePoint - 0xdc00) + 0x10000;
1417
+ } else if (leadSurrogate) {
1418
+ if ((units -= 3) > -1) bytes.push(0xef, 0xbf, 0xbd);
1419
+ }
1420
+ leadSurrogate = null;
1421
+ if (codePoint < 0x80) {
1422
+ if ((units -= 1) < 0) break;
1423
+ bytes.push(codePoint);
1424
+ } else if (codePoint < 0x800) {
1425
+ if ((units -= 2) < 0) break;
1426
+ bytes.push(codePoint >> 0x6 | 0xc0, codePoint & 0x3f | 0x80);
1427
+ } else if (codePoint < 0x10000) {
1428
+ if ((units -= 3) < 0) break;
1429
+ bytes.push(codePoint >> 0xc | 0xe0, codePoint >> 0x6 & 0x3f | 0x80, codePoint & 0x3f | 0x80);
1430
+ } else if (codePoint < 0x110000) {
1431
+ if ((units -= 4) < 0) break;
1432
+ bytes.push(codePoint >> 0x12 | 0xf0, codePoint >> 0xc & 0x3f | 0x80, codePoint >> 0x6 & 0x3f | 0x80, codePoint & 0x3f | 0x80);
1433
+ } else {
1434
+ throw new Error('Invalid code point');
1435
+ }
1436
+ }
1437
+ return bytes;
1438
+ }
1439
+ function asciiToBytes(str) {
1440
+ const byteArray = [];
1441
+ for (let i = 0; i < str.length; ++i) {
1442
+ byteArray.push(str.charCodeAt(i) & 0xff);
1443
+ }
1444
+ return byteArray;
1445
+ }
1446
+ function utf16leToBytes(str, units) {
1447
+ let c;
1448
+ let hi;
1449
+ let lo;
1450
+ const byteArray = [];
1451
+ for (let i = 0; i < str.length; ++i) {
1452
+ if ((units -= 2) < 0) break;
1453
+ c = str.charCodeAt(i);
1454
+ hi = c >> 8;
1455
+ lo = c % 256;
1456
+ byteArray.push(lo);
1457
+ byteArray.push(hi);
1458
+ }
1459
+ return byteArray;
1460
+ }
1461
+ function base64ToBytes(str) {
1462
+ return base64.toByteArray(base64clean(str));
1463
+ }
1464
+ function blitBuffer(src, dst, offset, length) {
1465
+ let i;
1466
+ for (i = 0; i < length; ++i) {
1467
+ if (i + offset >= dst.length || i >= src.length) break;
1468
+ dst[i + offset] = src[i];
1469
+ }
1470
+ return i;
1471
+ }
1472
+ function isInstance(obj, type) {
1473
+ return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;
1474
+ }
1475
+ function numberIsNaN(obj) {
1476
+ return obj !== obj;
1477
+ }
1478
+ const hexSliceLookupTable = function () {
1479
+ const alphabet = '0123456789abcdef';
1480
+ const table = new Array(256);
1481
+ for (let i = 0; i < 16; ++i) {
1482
+ const i16 = i * 16;
1483
+ for (let j = 0; j < 16; ++j) {
1484
+ table[i16 + j] = alphabet[i] + alphabet[j];
1485
+ }
1486
+ }
1487
+ return table;
1488
+ }();
1489
+ //# sourceMappingURL=buffer.js.map