@cj-tech-master/excelts 4.2.1 → 4.2.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 (311) hide show
  1. package/THIRD_PARTY_NOTICES.md +0 -31
  2. package/dist/browser/index.browser.d.ts +1 -0
  3. package/dist/browser/index.browser.js +12 -0
  4. package/dist/{esm/modules/archive → browser/modules/archive/compression}/compress.base.js +1 -1
  5. package/dist/{types/modules/archive → browser/modules/archive/compression}/compress.browser.d.ts +2 -8
  6. package/dist/browser/modules/archive/{compress.browser.js → compression/compress.browser.js} +3 -11
  7. package/dist/browser/modules/archive/{compress.d.ts → compression/compress.d.ts} +2 -2
  8. package/dist/{esm/modules/archive → browser/modules/archive/compression}/compress.js +1 -1
  9. package/dist/browser/modules/archive/{crc32.browser.d.ts → compression/crc32.browser.d.ts} +1 -1
  10. package/dist/browser/modules/archive/{crc32.d.ts → compression/crc32.d.ts} +1 -1
  11. package/dist/browser/modules/archive/{crc32.js → compression/crc32.js} +1 -1
  12. package/dist/browser/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
  13. package/dist/browser/modules/archive/{streaming-compress.browser.d.ts → compression/streaming-compress.browser.d.ts} +2 -2
  14. package/dist/browser/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
  15. package/dist/browser/modules/archive/{streaming-compress.d.ts → compression/streaming-compress.d.ts} +2 -2
  16. package/dist/browser/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
  17. package/dist/browser/modules/archive/defaults.d.ts +1 -0
  18. package/dist/browser/modules/archive/defaults.js +6 -3
  19. package/dist/browser/modules/archive/index.base.d.ts +4 -4
  20. package/dist/browser/modules/archive/index.base.js +3 -6
  21. package/dist/browser/modules/archive/index.browser.d.ts +3 -4
  22. package/dist/browser/modules/archive/index.browser.js +3 -7
  23. package/dist/browser/modules/archive/index.d.ts +3 -4
  24. package/dist/browser/modules/archive/index.js +3 -5
  25. package/dist/browser/modules/archive/internal/byte-queue.d.ts +33 -0
  26. package/dist/browser/modules/archive/internal/byte-queue.js +407 -0
  27. package/dist/browser/modules/archive/io/archive-sink.d.ts +8 -0
  28. package/dist/browser/modules/archive/io/archive-sink.js +45 -0
  29. package/dist/browser/modules/archive/io/archive-source.d.ts +6 -0
  30. package/dist/browser/modules/archive/io/archive-source.js +100 -0
  31. package/dist/browser/modules/archive/{extract.d.ts → unzip/extract.d.ts} +2 -2
  32. package/dist/browser/modules/archive/unzip/index.d.ts +40 -0
  33. package/dist/browser/modules/archive/unzip/index.js +164 -0
  34. package/dist/browser/modules/archive/{parse.base.d.ts → unzip/stream.base.d.ts} +36 -2
  35. package/dist/browser/modules/archive/unzip/stream.base.js +1022 -0
  36. package/dist/browser/modules/archive/{parse.browser.d.ts → unzip/stream.browser.d.ts} +1 -1
  37. package/dist/browser/modules/archive/{parse.browser.js → unzip/stream.browser.js} +371 -110
  38. package/dist/browser/modules/archive/{parse.d.ts → unzip/stream.d.ts} +2 -2
  39. package/dist/{esm/modules/archive/parse.js → browser/modules/archive/unzip/stream.js} +6 -5
  40. package/dist/browser/modules/archive/{zip-parser.d.ts → unzip/zip-parser.d.ts} +1 -1
  41. package/dist/{esm/modules/archive → browser/modules/archive/unzip}/zip-parser.js +38 -24
  42. package/dist/browser/modules/archive/utils/async-queue.d.ts +7 -0
  43. package/dist/browser/modules/archive/utils/async-queue.js +103 -0
  44. package/dist/browser/modules/archive/utils/bytes.js +16 -16
  45. package/dist/browser/modules/archive/utils/compressibility.d.ts +10 -0
  46. package/dist/browser/modules/archive/utils/compressibility.js +57 -0
  47. package/dist/browser/modules/archive/utils/parse-buffer.js +21 -23
  48. package/dist/browser/modules/archive/utils/pattern-scanner.d.ts +21 -0
  49. package/dist/browser/modules/archive/utils/pattern-scanner.js +27 -0
  50. package/dist/browser/modules/archive/utils/timestamps.js +62 -1
  51. package/dist/browser/modules/archive/utils/zip-extra-fields.d.ts +1 -1
  52. package/dist/browser/modules/archive/utils/zip-extra-fields.js +26 -14
  53. package/dist/browser/modules/archive/zip/index.d.ts +42 -0
  54. package/dist/browser/modules/archive/zip/index.js +157 -0
  55. package/dist/browser/modules/archive/{streaming-zip.d.ts → zip/stream.d.ts} +28 -5
  56. package/dist/browser/modules/archive/{streaming-zip.js → zip/stream.js} +192 -48
  57. package/dist/browser/modules/archive/zip/zip-bytes.d.ts +73 -0
  58. package/dist/browser/modules/archive/zip/zip-bytes.js +239 -0
  59. package/dist/{esm/modules/archive → browser/modules/archive/zip}/zip-entry-metadata.js +3 -3
  60. package/dist/browser/modules/archive/{zip-records.d.ts → zip-spec/zip-records.d.ts} +20 -0
  61. package/dist/browser/modules/archive/zip-spec/zip-records.js +126 -0
  62. package/dist/browser/modules/excel/stream/workbook-reader.browser.js +1 -1
  63. package/dist/browser/modules/excel/stream/workbook-writer.browser.d.ts +1 -1
  64. package/dist/browser/modules/excel/stream/workbook-writer.browser.js +1 -1
  65. package/dist/browser/modules/excel/utils/ooxml-validator.d.ts +48 -0
  66. package/dist/browser/modules/excel/utils/ooxml-validator.js +469 -0
  67. package/dist/browser/modules/excel/worksheet.js +5 -2
  68. package/dist/browser/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.d.ts +1 -0
  69. package/dist/browser/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
  70. package/dist/browser/modules/excel/xlsx/xform/drawing/sp-xform.d.ts +18 -0
  71. package/dist/browser/modules/excel/xlsx/xform/drawing/sp-xform.js +112 -0
  72. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +6 -1
  73. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
  74. package/dist/browser/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
  75. package/dist/browser/modules/excel/xlsx/xform/sheet/page-setup-xform.d.ts +1 -0
  76. package/dist/browser/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
  77. package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
  78. package/dist/browser/modules/excel/xlsx/xlsx.browser.js +3 -6
  79. package/dist/browser/modules/excel/xlsx/xlsx.js +1 -1
  80. package/dist/browser/modules/stream/base-transform.d.ts +3 -0
  81. package/dist/browser/modules/stream/base-transform.js +34 -20
  82. package/dist/browser/modules/stream/buffered-stream.d.ts +2 -12
  83. package/dist/browser/modules/stream/chunked-builder.js +4 -4
  84. package/dist/browser/modules/stream/index.browser.d.ts +13 -19
  85. package/dist/browser/modules/stream/index.browser.js +10 -22
  86. package/dist/browser/modules/stream/index.d.ts +18 -41
  87. package/dist/browser/modules/stream/index.js +15 -44
  88. package/dist/browser/modules/stream/internal/event-utils.d.ts +17 -0
  89. package/dist/browser/modules/stream/internal/event-utils.js +40 -0
  90. package/dist/browser/modules/stream/internal/type-guards.d.ts +9 -0
  91. package/dist/browser/modules/stream/internal/type-guards.js +24 -0
  92. package/dist/browser/modules/stream/pull-stream.d.ts +5 -6
  93. package/dist/browser/modules/stream/pull-stream.js +107 -43
  94. package/dist/browser/modules/stream/shared.d.ts +1 -1
  95. package/dist/browser/modules/stream/shared.js +7 -4
  96. package/dist/browser/modules/stream/streams.browser.d.ts +32 -44
  97. package/dist/browser/modules/stream/streams.browser.js +921 -836
  98. package/dist/browser/modules/stream/streams.d.ts +4 -20
  99. package/dist/browser/modules/stream/streams.js +146 -95
  100. package/dist/browser/modules/stream/utils.js +5 -38
  101. package/dist/cjs/modules/archive/{compress.base.js → compression/compress.base.js} +1 -1
  102. package/dist/cjs/modules/archive/{compress.browser.js → compression/compress.browser.js} +3 -11
  103. package/dist/cjs/modules/archive/{compress.js → compression/compress.js} +1 -1
  104. package/dist/cjs/modules/archive/{crc32.js → compression/crc32.js} +1 -1
  105. package/dist/cjs/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
  106. package/dist/cjs/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
  107. package/dist/cjs/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
  108. package/dist/cjs/modules/archive/defaults.js +7 -4
  109. package/dist/cjs/modules/archive/index.base.js +9 -19
  110. package/dist/cjs/modules/archive/index.browser.js +4 -10
  111. package/dist/cjs/modules/archive/index.js +4 -8
  112. package/dist/cjs/modules/archive/internal/byte-queue.js +411 -0
  113. package/dist/cjs/modules/archive/io/archive-sink.js +49 -0
  114. package/dist/cjs/modules/archive/io/archive-source.js +105 -0
  115. package/dist/cjs/modules/archive/unzip/index.js +170 -0
  116. package/dist/cjs/modules/archive/unzip/stream.base.js +1044 -0
  117. package/dist/cjs/modules/archive/{parse.browser.js → unzip/stream.browser.js} +372 -111
  118. package/dist/cjs/modules/archive/{parse.js → unzip/stream.js} +9 -8
  119. package/dist/cjs/modules/archive/{zip-parser.js → unzip/zip-parser.js} +47 -33
  120. package/dist/cjs/modules/archive/utils/async-queue.js +106 -0
  121. package/dist/cjs/modules/archive/utils/bytes.js +16 -16
  122. package/dist/cjs/modules/archive/utils/compressibility.js +60 -0
  123. package/dist/cjs/modules/archive/utils/parse-buffer.js +21 -23
  124. package/dist/cjs/modules/archive/utils/pattern-scanner.js +31 -0
  125. package/dist/cjs/modules/archive/utils/timestamps.js +64 -3
  126. package/dist/cjs/modules/archive/utils/zip-extra-fields.js +26 -14
  127. package/dist/cjs/modules/archive/zip/index.js +162 -0
  128. package/dist/cjs/modules/archive/{streaming-zip.js → zip/stream.js} +194 -50
  129. package/dist/cjs/modules/archive/zip/zip-bytes.js +242 -0
  130. package/dist/cjs/modules/archive/{zip-entry-metadata.js → zip/zip-entry-metadata.js} +5 -5
  131. package/dist/cjs/modules/archive/zip-spec/zip-records.js +136 -0
  132. package/dist/cjs/modules/excel/stream/workbook-reader.browser.js +2 -2
  133. package/dist/cjs/modules/excel/stream/workbook-writer.browser.js +4 -4
  134. package/dist/cjs/modules/excel/utils/ooxml-validator.js +475 -0
  135. package/dist/cjs/modules/excel/worksheet.js +5 -2
  136. package/dist/cjs/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
  137. package/dist/cjs/modules/excel/xlsx/xform/drawing/sp-xform.js +115 -0
  138. package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
  139. package/dist/cjs/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
  140. package/dist/cjs/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
  141. package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
  142. package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +6 -9
  143. package/dist/cjs/modules/excel/xlsx/xlsx.js +2 -2
  144. package/dist/cjs/modules/stream/base-transform.js +34 -20
  145. package/dist/cjs/modules/stream/chunked-builder.js +4 -4
  146. package/dist/cjs/modules/stream/index.browser.js +10 -17
  147. package/dist/cjs/modules/stream/index.js +15 -39
  148. package/dist/cjs/modules/stream/internal/event-utils.js +43 -0
  149. package/dist/cjs/modules/stream/internal/type-guards.js +30 -0
  150. package/dist/cjs/modules/stream/pull-stream.js +107 -43
  151. package/dist/cjs/modules/stream/shared.js +7 -4
  152. package/dist/cjs/modules/stream/streams.browser.js +927 -847
  153. package/dist/cjs/modules/stream/streams.js +156 -107
  154. package/dist/cjs/modules/stream/utils.js +3 -36
  155. package/dist/esm/index.browser.js +12 -0
  156. package/dist/{browser/modules/archive → esm/modules/archive/compression}/compress.base.js +1 -1
  157. package/dist/esm/modules/archive/{compress.browser.js → compression/compress.browser.js} +3 -11
  158. package/dist/{browser/modules/archive → esm/modules/archive/compression}/compress.js +1 -1
  159. package/dist/esm/modules/archive/{crc32.js → compression/crc32.js} +1 -1
  160. package/dist/esm/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
  161. package/dist/esm/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
  162. package/dist/esm/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
  163. package/dist/esm/modules/archive/defaults.js +6 -3
  164. package/dist/esm/modules/archive/index.base.js +3 -6
  165. package/dist/esm/modules/archive/index.browser.js +3 -7
  166. package/dist/esm/modules/archive/index.js +3 -5
  167. package/dist/esm/modules/archive/internal/byte-queue.js +407 -0
  168. package/dist/esm/modules/archive/io/archive-sink.js +45 -0
  169. package/dist/esm/modules/archive/io/archive-source.js +100 -0
  170. package/dist/esm/modules/archive/unzip/index.js +164 -0
  171. package/dist/esm/modules/archive/unzip/stream.base.js +1022 -0
  172. package/dist/esm/modules/archive/{parse.browser.js → unzip/stream.browser.js} +371 -110
  173. package/dist/{browser/modules/archive/parse.js → esm/modules/archive/unzip/stream.js} +6 -5
  174. package/dist/{browser/modules/archive → esm/modules/archive/unzip}/zip-parser.js +38 -24
  175. package/dist/esm/modules/archive/utils/async-queue.js +103 -0
  176. package/dist/esm/modules/archive/utils/bytes.js +16 -16
  177. package/dist/esm/modules/archive/utils/compressibility.js +57 -0
  178. package/dist/esm/modules/archive/utils/parse-buffer.js +21 -23
  179. package/dist/esm/modules/archive/utils/pattern-scanner.js +27 -0
  180. package/dist/esm/modules/archive/utils/timestamps.js +62 -1
  181. package/dist/esm/modules/archive/utils/zip-extra-fields.js +26 -14
  182. package/dist/esm/modules/archive/zip/index.js +157 -0
  183. package/dist/esm/modules/archive/{streaming-zip.js → zip/stream.js} +192 -48
  184. package/dist/esm/modules/archive/zip/zip-bytes.js +239 -0
  185. package/dist/{browser/modules/archive → esm/modules/archive/zip}/zip-entry-metadata.js +3 -3
  186. package/dist/esm/modules/archive/zip-spec/zip-records.js +126 -0
  187. package/dist/esm/modules/excel/stream/workbook-reader.browser.js +1 -1
  188. package/dist/esm/modules/excel/stream/workbook-writer.browser.js +1 -1
  189. package/dist/esm/modules/excel/utils/ooxml-validator.js +469 -0
  190. package/dist/esm/modules/excel/worksheet.js +5 -2
  191. package/dist/esm/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
  192. package/dist/esm/modules/excel/xlsx/xform/drawing/sp-xform.js +112 -0
  193. package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
  194. package/dist/esm/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
  195. package/dist/esm/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
  196. package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +110 -12
  197. package/dist/esm/modules/excel/xlsx/xlsx.browser.js +3 -6
  198. package/dist/esm/modules/excel/xlsx/xlsx.js +1 -1
  199. package/dist/esm/modules/stream/base-transform.js +34 -20
  200. package/dist/esm/modules/stream/chunked-builder.js +4 -4
  201. package/dist/esm/modules/stream/index.browser.js +10 -22
  202. package/dist/esm/modules/stream/index.js +15 -44
  203. package/dist/esm/modules/stream/internal/event-utils.js +40 -0
  204. package/dist/esm/modules/stream/internal/type-guards.js +24 -0
  205. package/dist/esm/modules/stream/pull-stream.js +107 -43
  206. package/dist/esm/modules/stream/shared.js +7 -4
  207. package/dist/esm/modules/stream/streams.browser.js +921 -836
  208. package/dist/esm/modules/stream/streams.js +146 -95
  209. package/dist/esm/modules/stream/utils.js +5 -38
  210. package/dist/iife/THIRD_PARTY_NOTICES.md +0 -31
  211. package/dist/iife/excelts.iife.js +6495 -4440
  212. package/dist/iife/excelts.iife.js.map +1 -1
  213. package/dist/iife/excelts.iife.min.js +103 -31
  214. package/dist/types/index.browser.d.ts +1 -0
  215. package/dist/{browser/modules/archive → types/modules/archive/compression}/compress.browser.d.ts +2 -8
  216. package/dist/types/modules/archive/{streaming-compress.browser.d.ts → compression/streaming-compress.browser.d.ts} +1 -1
  217. package/dist/types/modules/archive/defaults.d.ts +1 -0
  218. package/dist/types/modules/archive/index.base.d.ts +4 -4
  219. package/dist/types/modules/archive/index.browser.d.ts +3 -4
  220. package/dist/types/modules/archive/index.d.ts +3 -4
  221. package/dist/types/modules/archive/internal/byte-queue.d.ts +33 -0
  222. package/dist/types/modules/archive/io/archive-sink.d.ts +8 -0
  223. package/dist/types/modules/archive/io/archive-source.d.ts +6 -0
  224. package/dist/types/modules/archive/unzip/index.d.ts +40 -0
  225. package/dist/types/modules/archive/{parse.base.d.ts → unzip/stream.base.d.ts} +38 -4
  226. package/dist/types/modules/archive/{parse.browser.d.ts → unzip/stream.browser.d.ts} +2 -2
  227. package/dist/types/modules/archive/{parse.d.ts → unzip/stream.d.ts} +3 -3
  228. package/dist/types/modules/archive/{zip-parser.d.ts → unzip/zip-parser.d.ts} +1 -1
  229. package/dist/types/modules/archive/utils/async-queue.d.ts +7 -0
  230. package/dist/types/modules/archive/utils/compressibility.d.ts +10 -0
  231. package/dist/types/modules/archive/utils/pattern-scanner.d.ts +21 -0
  232. package/dist/types/modules/archive/utils/zip-extra-fields.d.ts +1 -1
  233. package/dist/types/modules/archive/zip/index.d.ts +42 -0
  234. package/dist/types/modules/archive/{streaming-zip.d.ts → zip/stream.d.ts} +29 -6
  235. package/dist/types/modules/archive/zip/zip-bytes.d.ts +73 -0
  236. package/dist/types/modules/archive/{zip-entry-metadata.d.ts → zip/zip-entry-metadata.d.ts} +1 -1
  237. package/dist/types/modules/archive/{zip-records.d.ts → zip-spec/zip-records.d.ts} +20 -0
  238. package/dist/types/modules/excel/stream/workbook-writer.browser.d.ts +1 -1
  239. package/dist/types/modules/excel/utils/ooxml-validator.d.ts +48 -0
  240. package/dist/types/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.d.ts +1 -0
  241. package/dist/types/modules/excel/xlsx/xform/drawing/sp-xform.d.ts +18 -0
  242. package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +6 -1
  243. package/dist/types/modules/excel/xlsx/xform/sheet/page-setup-xform.d.ts +1 -0
  244. package/dist/types/modules/stream/base-transform.d.ts +3 -0
  245. package/dist/types/modules/stream/buffered-stream.d.ts +2 -12
  246. package/dist/types/modules/stream/index.browser.d.ts +13 -19
  247. package/dist/types/modules/stream/index.d.ts +18 -41
  248. package/dist/types/modules/stream/internal/event-utils.d.ts +17 -0
  249. package/dist/types/modules/stream/internal/type-guards.d.ts +9 -0
  250. package/dist/types/modules/stream/pull-stream.d.ts +5 -6
  251. package/dist/types/modules/stream/shared.d.ts +1 -1
  252. package/dist/types/modules/stream/streams.browser.d.ts +32 -44
  253. package/dist/types/modules/stream/streams.d.ts +4 -20
  254. package/package.json +14 -10
  255. package/dist/browser/modules/archive/byte-queue.d.ts +0 -18
  256. package/dist/browser/modules/archive/byte-queue.js +0 -125
  257. package/dist/browser/modules/archive/parse.base.js +0 -644
  258. package/dist/browser/modules/archive/utils/zip-extra.d.ts +0 -18
  259. package/dist/browser/modules/archive/utils/zip-extra.js +0 -68
  260. package/dist/browser/modules/archive/zip-builder.d.ts +0 -117
  261. package/dist/browser/modules/archive/zip-builder.js +0 -292
  262. package/dist/browser/modules/archive/zip-constants.d.ts +0 -18
  263. package/dist/browser/modules/archive/zip-constants.js +0 -23
  264. package/dist/browser/modules/archive/zip-records.js +0 -84
  265. package/dist/cjs/modules/archive/byte-queue.js +0 -129
  266. package/dist/cjs/modules/archive/parse.base.js +0 -666
  267. package/dist/cjs/modules/archive/utils/zip-extra.js +0 -74
  268. package/dist/cjs/modules/archive/zip-builder.js +0 -297
  269. package/dist/cjs/modules/archive/zip-constants.js +0 -26
  270. package/dist/cjs/modules/archive/zip-records.js +0 -90
  271. package/dist/esm/modules/archive/byte-queue.js +0 -125
  272. package/dist/esm/modules/archive/parse.base.js +0 -644
  273. package/dist/esm/modules/archive/utils/zip-extra.js +0 -68
  274. package/dist/esm/modules/archive/zip-builder.js +0 -292
  275. package/dist/esm/modules/archive/zip-constants.js +0 -23
  276. package/dist/esm/modules/archive/zip-records.js +0 -84
  277. package/dist/types/modules/archive/byte-queue.d.ts +0 -18
  278. package/dist/types/modules/archive/utils/zip-extra.d.ts +0 -18
  279. package/dist/types/modules/archive/zip-builder.d.ts +0 -117
  280. package/dist/types/modules/archive/zip-constants.d.ts +0 -18
  281. /package/dist/browser/modules/archive/{compress.base.d.ts → compression/compress.base.d.ts} +0 -0
  282. /package/dist/browser/modules/archive/{crc32.base.d.ts → compression/crc32.base.d.ts} +0 -0
  283. /package/dist/browser/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
  284. /package/dist/browser/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
  285. /package/dist/browser/modules/archive/{deflate-fallback.d.ts → compression/deflate-fallback.d.ts} +0 -0
  286. /package/dist/browser/modules/archive/{streaming-compress.base.d.ts → compression/streaming-compress.base.d.ts} +0 -0
  287. /package/dist/browser/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
  288. /package/dist/browser/modules/archive/{extract.js → unzip/extract.js} +0 -0
  289. /package/dist/browser/modules/archive/{zip-entry-metadata.d.ts → zip/zip-entry-metadata.d.ts} +0 -0
  290. /package/dist/browser/modules/archive/{zip-entry-info.d.ts → zip-spec/zip-entry-info.d.ts} +0 -0
  291. /package/dist/browser/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
  292. /package/dist/cjs/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
  293. /package/dist/cjs/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
  294. /package/dist/cjs/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
  295. /package/dist/cjs/modules/archive/{extract.js → unzip/extract.js} +0 -0
  296. /package/dist/cjs/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
  297. /package/dist/esm/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
  298. /package/dist/esm/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
  299. /package/dist/esm/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
  300. /package/dist/esm/modules/archive/{extract.js → unzip/extract.js} +0 -0
  301. /package/dist/esm/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
  302. /package/dist/types/modules/archive/{compress.base.d.ts → compression/compress.base.d.ts} +0 -0
  303. /package/dist/types/modules/archive/{compress.d.ts → compression/compress.d.ts} +0 -0
  304. /package/dist/types/modules/archive/{crc32.base.d.ts → compression/crc32.base.d.ts} +0 -0
  305. /package/dist/types/modules/archive/{crc32.browser.d.ts → compression/crc32.browser.d.ts} +0 -0
  306. /package/dist/types/modules/archive/{crc32.d.ts → compression/crc32.d.ts} +0 -0
  307. /package/dist/types/modules/archive/{deflate-fallback.d.ts → compression/deflate-fallback.d.ts} +0 -0
  308. /package/dist/types/modules/archive/{streaming-compress.base.d.ts → compression/streaming-compress.base.d.ts} +0 -0
  309. /package/dist/types/modules/archive/{streaming-compress.d.ts → compression/streaming-compress.d.ts} +0 -0
  310. /package/dist/types/modules/archive/{extract.d.ts → unzip/extract.d.ts} +0 -0
  311. /package/dist/types/modules/archive/{zip-entry-info.d.ts → zip-spec/zip-entry-info.d.ts} +0 -0
@@ -5,9 +5,9 @@
5
5
  * Provides Readable, Writable, Transform, Duplex, and PassThrough streams.
6
6
  */
7
7
  import { Readable, Writable as NodeWritable, Transform, Duplex, PassThrough } from "stream";
8
- import type { TransformStreamOptions, ReadableStreamOptions, WritableStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, DataChunk, ICollector, IDuplex, IEventEmitter, IPassThrough, IReadable, ITransform, IWritable, PipelineStreamLike, ReadableLike, WritableLike } from "@stream/types";
9
- import { BufferedStream as StandaloneBufferedStream, StringChunk as StandaloneStringChunk, BufferChunk as StandaloneBufferChunk } from "@stream/buffered-stream";
10
- import { PullStream as StandalonePullStream } from "@stream/pull-stream";
8
+ import type { TransformStreamOptions, ReadableStreamOptions, WritableStreamOptions, DuplexStreamOptions, PullStreamOptions, BufferedStreamOptions, ICollector, IDuplex, IEventEmitter, IPassThrough, IReadable, ITransform, IWritable, PipelineStreamLike, ReadableLike, WritableLike } from "@stream/types";
9
+ import { BufferedStream, BufferChunk, StringChunk } from "@stream/buffered-stream";
10
+ import { PullStream } from "@stream/pull-stream";
11
11
  /**
12
12
  * Extended Writable options that match browser API
13
13
  * Supports wrapping an existing Node.js stream
@@ -30,6 +30,7 @@ export declare class Writable<T = Uint8Array> extends NodeWritable {
30
30
  constructor(options?: WritableOptions<T>);
31
31
  }
32
32
  export { Readable, Transform, Duplex, PassThrough };
33
+ export { PullStream, BufferedStream, StringChunk, BufferChunk };
33
34
  /**
34
35
  * Normalize a user-provided writable into a Node.js-compatible Writable.
35
36
  *
@@ -130,27 +131,10 @@ export declare class Collector<T = Uint8Array> extends Writable {
130
131
  * Create a collector stream
131
132
  */
132
133
  export declare function createCollector<T = Uint8Array>(options?: WritableStreamOptions): ICollector<T>;
133
- export declare class PullStream extends StandalonePullStream {
134
- }
135
134
  /**
136
135
  * Create a pull stream
137
136
  */
138
137
  export declare function createPullStream(options?: PullStreamOptions): PullStream;
139
- /**
140
- * String chunk implementation
141
- */
142
- export declare class StringChunk extends StandaloneStringChunk implements DataChunk {
143
- }
144
- /**
145
- * Buffer chunk implementation
146
- */
147
- export declare class BufferChunk extends StandaloneBufferChunk implements DataChunk {
148
- }
149
- /**
150
- * Buffered stream with efficient chunk management
151
- */
152
- export declare class BufferedStream extends StandaloneBufferedStream {
153
- }
154
138
  /**
155
139
  * Create a buffered stream
156
140
  */
@@ -5,8 +5,9 @@
5
5
  * Provides Readable, Writable, Transform, Duplex, and PassThrough streams.
6
6
  */
7
7
  import { Readable, Writable as NodeWritable, Transform, Duplex, PassThrough, pipeline as nodePipeline, finished as nodeFinished } from "stream";
8
- import { BufferedStream as StandaloneBufferedStream, StringChunk as StandaloneStringChunk, BufferChunk as StandaloneBufferChunk } from "./buffered-stream.js";
9
- import { PullStream as StandalonePullStream } from "./pull-stream.js";
8
+ import { BufferedStream, BufferChunk, StringChunk } from "./buffered-stream.js";
9
+ import { PullStream } from "./pull-stream.js";
10
+ import { isAsyncIterable, isReadableStream, isTransformStream, isWritableStream } from "./internal/type-guards.js";
10
11
  /**
11
12
  * Unified Writable class - wraps Node.js Writable with browser-compatible API
12
13
  *
@@ -16,20 +17,34 @@ export class Writable extends NodeWritable {
16
17
  constructor(options) {
17
18
  // If wrapping an existing stream, proxy to it
18
19
  if (options?.stream) {
20
+ const underlying = options.stream;
19
21
  // Create a pass-through wrapper that proxies to the underlying stream
20
22
  super({
21
23
  highWaterMark: options?.highWaterMark,
22
24
  objectMode: options?.objectMode,
23
25
  write(chunk, encoding, callback) {
24
- options.stream.write(chunk, encoding, callback);
26
+ underlying.write(chunk, encoding, callback);
25
27
  },
26
28
  final(callback) {
27
- options.stream.end(callback);
29
+ underlying.end(callback);
28
30
  }
29
31
  });
30
- // Proxy events from underlying stream
31
- options.stream.on("error", err => this.emit("error", err));
32
- options.stream.on("close", () => this.emit("close"));
32
+ // Proxy events from underlying stream, but ensure we clean up listeners so
33
+ // the underlying stream cannot retain this wrapper longer than necessary.
34
+ const onUnderlyingError = (err) => {
35
+ this.emit("error", err);
36
+ };
37
+ const onUnderlyingClose = () => {
38
+ this.emit("close");
39
+ };
40
+ const cleanup = () => {
41
+ underlying.off("error", onUnderlyingError);
42
+ underlying.off("close", onUnderlyingClose);
43
+ };
44
+ underlying.on("error", onUnderlyingError);
45
+ underlying.on("close", onUnderlyingClose);
46
+ this.once("close", cleanup);
47
+ this.once("finish", cleanup);
33
48
  }
34
49
  else {
35
50
  super({
@@ -45,6 +60,8 @@ export class Writable extends NodeWritable {
45
60
  // Re-export native classes with our interfaces
46
61
  // =============================================================================
47
62
  export { Readable, Transform, Duplex, PassThrough };
63
+ // Standalone cross-platform helpers
64
+ export { PullStream, BufferedStream, StringChunk, BufferChunk };
48
65
  // =============================================================================
49
66
  // Cross-environment stream normalization
50
67
  // =============================================================================
@@ -57,43 +74,25 @@ export function normalizeWritable(stream) {
57
74
  if (stream instanceof Writable) {
58
75
  return stream;
59
76
  }
60
- // Node.js Writable: accept structurally even if typed as unknown.
77
+ // Node.js Writable: already compatible, avoid extra wrapper allocation.
61
78
  if (stream instanceof NodeWritable) {
62
- return new Writable({ stream: stream });
79
+ return stream;
63
80
  }
64
81
  // Web WritableStream: detect by getWriter() (avoid relying on global WritableStream).
65
82
  if (stream?.getWriter) {
66
- const nodeWritable = NodeWritable.fromWeb(stream);
67
- return new Writable({ stream: nodeWritable });
83
+ return NodeWritable.fromWeb(stream);
68
84
  }
69
- // Assume it structurally matches Node's Writable; wrap for consistent API.
70
- return new Writable({ stream: stream });
85
+ // Assume it structurally matches Node's Writable.
86
+ return stream;
71
87
  }
72
88
  // Import for internal use
73
89
  import { textDecoder } from "./shared.js";
74
- const isReadableStream = (value) => !!value && typeof value === "object" && typeof value.getReader === "function";
75
- const isAsyncIterable = (value) => {
76
- if (!value || (typeof value !== "object" && typeof value !== "function")) {
77
- return false;
78
- }
79
- return typeof value[Symbol.asyncIterator] === "function";
80
- };
81
- const isWritableStream = (value) => !!value && typeof value === "object" && typeof value.getWriter === "function";
82
- const isTransformStream = (value) => !!value &&
83
- typeof value === "object" &&
84
- !!value.readable &&
85
- !!value.writable &&
86
- isReadableStream(value.readable) &&
87
- isWritableStream(value.writable);
88
90
  const isPipelineOptions = (value) => {
89
91
  if (!value || typeof value !== "object") {
90
92
  return false;
91
93
  }
92
- // IMPORTANT:
93
- // Do NOT use `"end" in obj` here because streams have `.end()` and would be
94
- // misclassified as options, breaking argument parsing and potentially hanging.
94
+ // Avoid treating streams as options objects.
95
95
  if (typeof value.pipe === "function" ||
96
- typeof value.write === "function" ||
97
96
  typeof value.end === "function" ||
98
97
  typeof value.getReader === "function" ||
99
98
  typeof value.getWriter === "function") {
@@ -180,12 +179,13 @@ export function finished(stream, optionsOrCallback, callback) {
180
179
  const promise = new Promise((resolve, reject) => {
181
180
  const normalizedStream = toNodePipelineStream(stream);
182
181
  nodeFinished(normalizedStream, options, (err) => {
183
- if (err && !(options && options.error)) {
182
+ // Node.js semantics: options.error defaults to true (report errors).
183
+ // If options.error === false, ignore errors and resolve.
184
+ if (err && options?.error !== false) {
184
185
  reject(err);
186
+ return;
185
187
  }
186
- else {
187
- resolve();
188
- }
188
+ resolve();
189
189
  });
190
190
  });
191
191
  if (cb) {
@@ -411,8 +411,6 @@ export function createCollector(options) {
411
411
  // =============================================================================
412
412
  // Pull Stream - Read data on demand with pattern matching
413
413
  // =============================================================================
414
- export class PullStream extends StandalonePullStream {
415
- }
416
414
  /**
417
415
  * Create a pull stream
418
416
  */
@@ -422,21 +420,6 @@ export function createPullStream(options) {
422
420
  // =============================================================================
423
421
  // Buffered Stream - Efficient chunk management
424
422
  // =============================================================================
425
- /**
426
- * String chunk implementation
427
- */
428
- export class StringChunk extends StandaloneStringChunk {
429
- }
430
- /**
431
- * Buffer chunk implementation
432
- */
433
- export class BufferChunk extends StandaloneBufferChunk {
434
- }
435
- /**
436
- * Buffered stream with efficient chunk management
437
- */
438
- export class BufferedStream extends StandaloneBufferedStream {
439
- }
440
423
  /**
441
424
  * Create a buffered stream
442
425
  */
@@ -533,13 +516,28 @@ export function addAbortSignal(signal, stream) {
533
516
  stream.destroy(new Error("Aborted"));
534
517
  return stream;
535
518
  }
519
+ const cleanup = () => {
520
+ signal.removeEventListener("abort", onAbort);
521
+ stream.off?.("close", onDone);
522
+ stream.off?.("end", onDone);
523
+ stream.off?.("finish", onDone);
524
+ stream.off?.("error", onError);
525
+ };
536
526
  const onAbort = () => {
527
+ cleanup();
537
528
  stream.destroy(new Error("Aborted"));
538
529
  };
530
+ const onDone = () => {
531
+ cleanup();
532
+ };
533
+ const onError = () => {
534
+ cleanup();
535
+ };
539
536
  signal.addEventListener("abort", onAbort, { once: true });
540
- stream.on("close", () => {
541
- signal.removeEventListener("abort", onAbort);
542
- });
537
+ stream.once?.("close", onDone);
538
+ stream.once?.("end", onDone);
539
+ stream.once?.("finish", onDone);
540
+ stream.once?.("error", onError);
543
541
  return stream;
544
542
  }
545
543
  /**
@@ -582,56 +580,109 @@ export function compose(...transforms) {
582
580
  if (len === 1 && isNativeTransform(transforms[0])) {
583
581
  return transforms[0];
584
582
  }
585
- // Chain all transforms together
583
+ // Chain all transforms together once.
586
584
  for (let i = 0; i < len - 1; i++) {
587
585
  transforms[i].pipe(transforms[i + 1]);
588
586
  }
589
- // Create a Duplex that writes to first and reads from last
590
587
  const first = transforms[0];
591
588
  const last = transforms[len - 1];
592
- // Create a PassThrough as the composed stream
593
- const composed = new PassThrough({ objectMode: first.readableObjectMode });
594
- // Store original methods for forwarding
595
- const passthroughWrite = composed.write.bind(composed);
596
- const passthroughEnd = composed.end.bind(composed);
597
- // Override write to write to first transform
598
- composed.write = function (chunk, encodingOrCallback, callback) {
599
- if (typeof encodingOrCallback === "function") {
600
- return first.write(chunk, encodingOrCallback);
601
- }
602
- return first.write(chunk, encodingOrCallback, callback);
603
- };
604
- // Override end to end first transform
605
- composed.end = function (chunkOrCallback, encodingOrCallback, callback) {
606
- if (typeof chunkOrCallback === "function") {
607
- first.end(chunkOrCallback);
589
+ // Use a private output stream so we don't have to monkey-patch `write()` on the
590
+ // public composed stream (which would break piping into it).
591
+ const output = new PassThrough({ objectMode: last.readableObjectMode ?? true });
592
+ last.pipe(output);
593
+ let outputEnded = false;
594
+ const pumpOutput = (target) => {
595
+ if (outputEnded) {
596
+ return;
608
597
  }
609
- else if (typeof encodingOrCallback === "function") {
610
- first.end(chunkOrCallback, encodingOrCallback);
598
+ while (true) {
599
+ const chunk = output.read();
600
+ if (chunk === null) {
601
+ break;
602
+ }
603
+ if (!target.push(chunk)) {
604
+ break;
605
+ }
611
606
  }
612
- else {
613
- first.end(chunkOrCallback, encodingOrCallback, callback);
607
+ };
608
+ const composed = new Transform({
609
+ readableObjectMode: last.readableObjectMode,
610
+ writableObjectMode: first.writableObjectMode,
611
+ transform(chunk, encoding, callback) {
612
+ try {
613
+ // Forward writes into the head of the chain.
614
+ first.write(chunk, encoding, callback);
615
+ }
616
+ catch (err) {
617
+ callback(err);
618
+ }
619
+ },
620
+ flush(callback) {
621
+ // End the head of the chain; readable completion is driven by `output` ending.
622
+ const onFinish = () => {
623
+ cleanupFlush();
624
+ callback();
625
+ };
626
+ const onError = (err) => {
627
+ cleanupFlush();
628
+ callback(err);
629
+ };
630
+ const cleanupFlush = () => {
631
+ first.off?.("finish", onFinish);
632
+ first.off?.("error", onError);
633
+ };
634
+ first.once?.("finish", onFinish);
635
+ first.once?.("error", onError);
636
+ first.end();
637
+ },
638
+ read() {
639
+ pumpOutput(this);
640
+ },
641
+ destroy(err, callback) {
642
+ try {
643
+ output.destroy(err ?? undefined);
644
+ for (const t of transforms) {
645
+ t.destroy?.(err ?? undefined);
646
+ }
647
+ }
648
+ finally {
649
+ callback(err);
650
+ }
614
651
  }
615
- return composed;
652
+ });
653
+ const onOutputReadable = () => {
654
+ pumpOutput(composed);
616
655
  };
617
- // Override pipe to pipe from last transform
618
- composed.pipe = function (dest) {
619
- return last.pipe(dest);
656
+ const onOutputEnd = () => {
657
+ cleanupListeners();
658
+ outputEnded = true;
659
+ composed.push(null);
620
660
  };
621
- // Forward data from last to composed
622
- last.on("data", (chunk) => {
623
- passthroughWrite(chunk);
624
- });
625
- // Forward end from last
626
- last.on("end", () => {
627
- passthroughEnd();
661
+ const onAnyError = (err) => {
662
+ cleanupListeners();
663
+ composed.destroy(err);
664
+ };
665
+ const transformErrorListeners = [];
666
+ const cleanupListeners = () => {
667
+ output.off("readable", onOutputReadable);
668
+ output.off("end", onOutputEnd);
669
+ output.off("error", onAnyError);
670
+ for (const { t, fn } of transformErrorListeners) {
671
+ t.off?.("error", fn);
672
+ }
673
+ transformErrorListeners.length = 0;
674
+ };
675
+ output.on("readable", onOutputReadable);
676
+ output.once("end", onOutputEnd);
677
+ output.once("error", onAnyError);
678
+ for (const t of transforms) {
679
+ const tt = t;
680
+ tt.once?.("error", onAnyError);
681
+ transformErrorListeners.push({ t: tt, fn: onAnyError });
682
+ }
683
+ composed.once("close", () => {
684
+ cleanupListeners();
628
685
  });
629
- // Forward errors from any transform
630
- for (const transform of transforms) {
631
- transform.on("error", (err) => {
632
- composed.emit("error", err);
633
- });
634
- }
635
686
  return composed;
636
687
  }
637
688
  /**
@@ -712,7 +763,7 @@ export function once(emitter, event, options) {
712
763
  onAbort();
713
764
  return;
714
765
  }
715
- options.signal.addEventListener("abort", onAbort);
766
+ options.signal.addEventListener("abort", onAbort, { once: true });
716
767
  }
717
768
  });
718
769
  }
@@ -4,8 +4,8 @@
4
4
  * Small, cross-platform helpers built on top of the platform stream
5
5
  * implementation selected by `./streams` (Node.js or browser).
6
6
  */
7
- import { createReadableFromArray, createTransform } from "./streams.browser.js";
8
- import { stringToUint8Array as _stringToUint8Array, uint8ArrayToString as _uint8ArrayToString } from "./shared.js";
7
+ import { consumers, createReadableFromArray, createTransform } from "./streams.browser.js";
8
+ import { stringToUint8Array as _stringToUint8Array } from "./shared.js";
9
9
  // =============================================================================
10
10
  // High-Level Stream Consumers
11
11
  // =============================================================================
@@ -17,46 +17,13 @@ export async function collect(stream) {
17
17
  return result;
18
18
  }
19
19
  export async function text(stream) {
20
- const chunks = [];
21
- let totalLength = 0;
22
- for await (const chunk of stream) {
23
- chunks.push(chunk);
24
- totalLength += chunk.length;
25
- }
26
- if (chunks.length === 1) {
27
- return _uint8ArrayToString(chunks[0]);
28
- }
29
- const result = new Uint8Array(totalLength);
30
- let offset = 0;
31
- for (let i = 0, len = chunks.length; i < len; i++) {
32
- const c = chunks[i];
33
- result.set(c, offset);
34
- offset += c.length;
35
- }
36
- return _uint8ArrayToString(result);
20
+ return consumers.text(stream);
37
21
  }
38
22
  export async function json(stream) {
39
- const str = await text(stream);
40
- return JSON.parse(str);
23
+ return consumers.json(stream);
41
24
  }
42
25
  export async function bytes(stream) {
43
- const chunks = [];
44
- let totalLength = 0;
45
- for await (const chunk of stream) {
46
- chunks.push(chunk);
47
- totalLength += chunk.length;
48
- }
49
- if (chunks.length === 1) {
50
- return chunks[0];
51
- }
52
- const result = new Uint8Array(totalLength);
53
- let offset = 0;
54
- for (let i = 0, len = chunks.length; i < len; i++) {
55
- const c = chunks[i];
56
- result.set(c, offset);
57
- offset += c.length;
58
- }
59
- return result;
26
+ return consumers.buffer(stream);
60
27
  }
61
28
  // =============================================================================
62
29
  // Stream Factory Helpers
@@ -21,7 +21,7 @@ exports.hasDeflateRawDecompressionStream = hasDeflateRawDecompressionStream;
21
21
  exports.hasDeflateRawWebStreams = hasDeflateRawWebStreams;
22
22
  exports.compressWithStream = compressWithStream;
23
23
  exports.decompressWithStream = decompressWithStream;
24
- const byte_queue_1 = require("./byte-queue.js");
24
+ const byte_queue_1 = require("../internal/byte-queue.js");
25
25
  /**
26
26
  * Default threshold (in bytes) to choose the lower-overhead path.
27
27
  *
@@ -12,23 +12,15 @@
12
12
  * - Edge >= 89
13
13
  */
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.hasCompressionStream = hasCompressionStream;
15
+ exports.hasCompressionStream = void 0;
16
16
  exports.compress = compress;
17
17
  exports.compressSync = compressSync;
18
18
  exports.decompress = decompress;
19
19
  exports.decompressSync = decompressSync;
20
20
  const compress_base_1 = require("./compress.base.js");
21
+ Object.defineProperty(exports, "hasCompressionStream", { enumerable: true, get: function () { return compress_base_1.hasCompressionStream; } });
21
22
  const deflate_fallback_1 = require("./deflate-fallback.js");
22
- const defaults_1 = require("./defaults.js");
23
- /**
24
- * Check if CompressionStream is available in this environment.
25
- *
26
- * Note: Some environments may expose CompressionStream but not support
27
- * the "deflate-raw" format that ZIP requires.
28
- */
29
- function hasCompressionStream() {
30
- return typeof CompressionStream !== "undefined";
31
- }
23
+ const defaults_1 = require("../defaults.js");
32
24
  /**
33
25
  * Compress data using browser's native CompressionStream or JS fallback
34
26
  *
@@ -46,7 +46,7 @@ exports.decompress = decompress;
46
46
  exports.decompressSync = decompressSync;
47
47
  const util_1 = require("util");
48
48
  const zlib = __importStar(require("zlib"));
49
- const defaults_1 = require("./defaults.js");
49
+ const defaults_1 = require("../defaults.js");
50
50
  // Re-export shared types and utilities
51
51
  var compress_base_1 = require("./compress.base.js");
52
52
  Object.defineProperty(exports, "hasCompressionStream", { enumerable: true, get: function () { return compress_base_1.hasCompressionStream; } });
@@ -47,7 +47,7 @@ exports.crc32Finalize = void 0;
47
47
  exports.crc32 = crc32;
48
48
  exports.ensureCrc32 = ensureCrc32;
49
49
  exports.crc32Update = crc32Update;
50
- const env_1 = require("../../utils/env.js");
50
+ const env_1 = require("../../../utils/env.js");
51
51
  const crc32_base_1 = require("./crc32.base.js");
52
52
  Object.defineProperty(exports, "crc32Finalize", { enumerable: true, get: function () { return crc32_base_1.crc32Finalize; } });
53
53
  // Lazy-loaded zlib module for Node.js
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.inflateRaw = inflateRaw;
16
16
  exports.deflateRawStore = deflateRawStore;
17
17
  exports.deflateRawCompressed = deflateRawCompressed;
18
- const bytes_1 = require("./utils/bytes.js");
18
+ const bytes_1 = require("../utils/bytes.js");
19
19
  // ============================================================================
20
20
  // DEFLATE Decompression (Full implementation)
21
21
  // ============================================================================
@@ -11,11 +11,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.hasDeflateRaw = hasDeflateRaw;
12
12
  exports.createDeflateStream = createDeflateStream;
13
13
  exports.createInflateStream = createInflateStream;
14
- const _stream_1 = require("../stream/index.js");
14
+ const _stream_1 = require("../../stream/index.js");
15
15
  const deflate_fallback_1 = require("./deflate-fallback.js");
16
16
  const compress_base_1 = require("./compress.base.js");
17
- const bytes_1 = require("./utils/bytes.js");
18
- const defaults_1 = require("./defaults.js");
17
+ const bytes_1 = require("../utils/bytes.js");
18
+ const defaults_1 = require("../defaults.js");
19
19
  const streaming_compress_base_1 = require("./streaming-compress.base.js");
20
20
  /**
21
21
  * Check if deflate-raw streaming compression is supported by this library.
@@ -10,8 +10,8 @@ exports.createDeflateStream = createDeflateStream;
10
10
  exports.createInflateStream = createInflateStream;
11
11
  exports.hasDeflateRaw = hasDeflateRaw;
12
12
  const zlib_1 = require("zlib");
13
- const _stream_1 = require("../stream/index.js");
14
- const defaults_1 = require("./defaults.js");
13
+ const _stream_1 = require("../../stream/index.js");
14
+ const defaults_1 = require("../defaults.js");
15
15
  /**
16
16
  * Wrapper around zlib DeflateRaw that flushes after every write
17
17
  * This ensures true streaming behavior - data is emitted immediately, not buffered
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_ZIP_TIMESTAMPS = exports.DEFAULT_ZIP_LEVEL = exports.DEFAULT_COMPRESS_LEVEL = void 0;
4
- exports.DEFAULT_COMPRESS_LEVEL = 6;
5
- exports.DEFAULT_ZIP_LEVEL = 6;
6
- exports.DEFAULT_ZIP_TIMESTAMPS = "dos+utc";
3
+ exports.DEFAULT_ZIP_TIMESTAMPS = exports.DEFAULT_ZIP_LEVEL = exports.DEFAULT_COMPRESS_LEVEL = exports.DEFAULT_DEFLATE_LEVEL = void 0;
4
+ exports.DEFAULT_DEFLATE_LEVEL = 6;
5
+ // Backward-compatible aliases (avoid default drift across modules).
6
+ exports.DEFAULT_COMPRESS_LEVEL = exports.DEFAULT_DEFLATE_LEVEL;
7
+ exports.DEFAULT_ZIP_LEVEL = exports.DEFAULT_DEFLATE_LEVEL;
8
+ // Prefer reproducible output by default: omit the Info-ZIP UTC mtime extra field.
9
+ exports.DEFAULT_ZIP_TIMESTAMPS = "dos";
@@ -7,22 +7,12 @@
7
7
  * from this file and then layer their platform-specific bindings.
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.ZipParser = exports.forEachEntry = exports.listFiles = exports.extractFile = exports.extractAll = exports.ZipDeflate = exports.Zip = exports.ZipDeflateFile = exports.StreamingZip = exports.ZipBuilder = exports.createZipSync = exports.createZip = void 0;
11
- // ZIP builders
12
- var zip_builder_1 = require("./zip-builder.js");
13
- Object.defineProperty(exports, "createZip", { enumerable: true, get: function () { return zip_builder_1.createZip; } });
14
- Object.defineProperty(exports, "createZipSync", { enumerable: true, get: function () { return zip_builder_1.createZipSync; } });
15
- Object.defineProperty(exports, "ZipBuilder", { enumerable: true, get: function () { return zip_builder_1.ZipBuilder; } });
16
- // Streaming ZIP (fflate-like API)
17
- var streaming_zip_1 = require("./streaming-zip.js");
18
- Object.defineProperty(exports, "StreamingZip", { enumerable: true, get: function () { return streaming_zip_1.StreamingZip; } });
19
- Object.defineProperty(exports, "ZipDeflateFile", { enumerable: true, get: function () { return streaming_zip_1.ZipDeflateFile; } });
20
- Object.defineProperty(exports, "Zip", { enumerable: true, get: function () { return streaming_zip_1.Zip; } });
21
- Object.defineProperty(exports, "ZipDeflate", { enumerable: true, get: function () { return streaming_zip_1.ZipDeflate; } });
22
- // Buffer-based unzip API (cross-platform)
23
- var extract_1 = require("./extract.js");
24
- Object.defineProperty(exports, "extractAll", { enumerable: true, get: function () { return extract_1.extractAll; } });
25
- Object.defineProperty(exports, "extractFile", { enumerable: true, get: function () { return extract_1.extractFile; } });
26
- Object.defineProperty(exports, "listFiles", { enumerable: true, get: function () { return extract_1.listFiles; } });
27
- Object.defineProperty(exports, "forEachEntry", { enumerable: true, get: function () { return extract_1.forEachEntry; } });
28
- Object.defineProperty(exports, "ZipParser", { enumerable: true, get: function () { return extract_1.ZipParser; } });
10
+ exports.UnzipEntry = exports.ZipReader = exports.unzip = exports.ZipArchive = exports.zip = void 0;
11
+ // High-level APIs
12
+ var zip_1 = require("./zip/index.js");
13
+ Object.defineProperty(exports, "zip", { enumerable: true, get: function () { return zip_1.zip; } });
14
+ Object.defineProperty(exports, "ZipArchive", { enumerable: true, get: function () { return zip_1.ZipArchive; } });
15
+ var unzip_1 = require("./unzip/index.js");
16
+ Object.defineProperty(exports, "unzip", { enumerable: true, get: function () { return unzip_1.unzip; } });
17
+ Object.defineProperty(exports, "ZipReader", { enumerable: true, get: function () { return unzip_1.ZipReader; } });
18
+ Object.defineProperty(exports, "UnzipEntry", { enumerable: true, get: function () { return unzip_1.UnzipEntry; } });
@@ -20,28 +20,22 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
20
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.createParse = exports.Parse = exports.hasDeflateRaw = exports.createInflateStream = exports.createDeflateStream = exports.hasCompressionStream = exports.decompressSync = exports.decompress = exports.compressSync = exports.compress = exports.crc32Finalize = exports.crc32Update = exports.crc32 = void 0;
23
+ exports.hasDeflateRaw = exports.createInflateStream = exports.createDeflateStream = exports.hasCompressionStream = exports.decompressSync = exports.decompress = exports.compressSync = exports.compress = exports.crc32Finalize = exports.crc32Update = exports.crc32 = void 0;
24
24
  __exportStar(require("./index.base.js"), exports);
25
25
  // CRC32
26
- var crc32_browser_1 = require("./crc32.browser.js");
26
+ var crc32_browser_1 = require("./compression/crc32.browser.js");
27
27
  Object.defineProperty(exports, "crc32", { enumerable: true, get: function () { return crc32_browser_1.crc32; } });
28
28
  Object.defineProperty(exports, "crc32Update", { enumerable: true, get: function () { return crc32_browser_1.crc32Update; } });
29
29
  Object.defineProperty(exports, "crc32Finalize", { enumerable: true, get: function () { return crc32_browser_1.crc32Finalize; } });
30
30
  // Compression
31
- var compress_browser_1 = require("./compress.browser.js");
31
+ var compress_browser_1 = require("./compression/compress.browser.js");
32
32
  Object.defineProperty(exports, "compress", { enumerable: true, get: function () { return compress_browser_1.compress; } });
33
33
  Object.defineProperty(exports, "compressSync", { enumerable: true, get: function () { return compress_browser_1.compressSync; } });
34
34
  Object.defineProperty(exports, "decompress", { enumerable: true, get: function () { return compress_browser_1.decompress; } });
35
35
  Object.defineProperty(exports, "decompressSync", { enumerable: true, get: function () { return compress_browser_1.decompressSync; } });
36
36
  Object.defineProperty(exports, "hasCompressionStream", { enumerable: true, get: function () { return compress_browser_1.hasCompressionStream; } });
37
37
  // Streaming compression
38
- var streaming_compress_browser_1 = require("./streaming-compress.browser.js");
38
+ var streaming_compress_browser_1 = require("./compression/streaming-compress.browser.js");
39
39
  Object.defineProperty(exports, "createDeflateStream", { enumerable: true, get: function () { return streaming_compress_browser_1.createDeflateStream; } });
40
40
  Object.defineProperty(exports, "createInflateStream", { enumerable: true, get: function () { return streaming_compress_browser_1.createInflateStream; } });
41
41
  Object.defineProperty(exports, "hasDeflateRaw", { enumerable: true, get: function () { return streaming_compress_browser_1.hasDeflateRaw; } });
42
- // Stream-based unzip API (browser implementation)
43
- var parse_browser_1 = require("./parse.browser.js");
44
- Object.defineProperty(exports, "Parse", { enumerable: true, get: function () { return parse_browser_1.Parse; } });
45
- Object.defineProperty(exports, "createParse", { enumerable: true, get: function () { return parse_browser_1.createParse; } });
46
- // Buffer-based unzip API (cross-platform)
47
- // (re-exported from ./index.base)