@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
@@ -6,7 +6,7 @@
6
6
  * Provides Readable, Writable, Transform, Duplex, and PassThrough streams.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.promises = exports.consumers = exports.BufferedStream = exports.BufferChunk = exports.StringChunk = exports.PullStream = exports.Collector = exports.PassThrough = exports.Duplex = exports.Transform = exports.Readable = exports.Writable = void 0;
9
+ exports.promises = exports.consumers = exports.Collector = exports.BufferChunk = exports.StringChunk = exports.BufferedStream = exports.PullStream = exports.PassThrough = exports.Duplex = exports.Transform = exports.Readable = exports.Writable = void 0;
10
10
  exports.normalizeWritable = normalizeWritable;
11
11
  exports.pipeline = pipeline;
12
12
  exports.finished = finished;
@@ -52,7 +52,12 @@ Object.defineProperty(exports, "Transform", { enumerable: true, get: function ()
52
52
  Object.defineProperty(exports, "Duplex", { enumerable: true, get: function () { return stream_1.Duplex; } });
53
53
  Object.defineProperty(exports, "PassThrough", { enumerable: true, get: function () { return stream_1.PassThrough; } });
54
54
  const buffered_stream_1 = require("./buffered-stream.js");
55
+ Object.defineProperty(exports, "BufferedStream", { enumerable: true, get: function () { return buffered_stream_1.BufferedStream; } });
56
+ Object.defineProperty(exports, "BufferChunk", { enumerable: true, get: function () { return buffered_stream_1.BufferChunk; } });
57
+ Object.defineProperty(exports, "StringChunk", { enumerable: true, get: function () { return buffered_stream_1.StringChunk; } });
55
58
  const pull_stream_1 = require("./pull-stream.js");
59
+ Object.defineProperty(exports, "PullStream", { enumerable: true, get: function () { return pull_stream_1.PullStream; } });
60
+ const type_guards_1 = require("./internal/type-guards.js");
56
61
  /**
57
62
  * Unified Writable class - wraps Node.js Writable with browser-compatible API
58
63
  *
@@ -62,20 +67,34 @@ class Writable extends stream_1.Writable {
62
67
  constructor(options) {
63
68
  // If wrapping an existing stream, proxy to it
64
69
  if (options?.stream) {
70
+ const underlying = options.stream;
65
71
  // Create a pass-through wrapper that proxies to the underlying stream
66
72
  super({
67
73
  highWaterMark: options?.highWaterMark,
68
74
  objectMode: options?.objectMode,
69
75
  write(chunk, encoding, callback) {
70
- options.stream.write(chunk, encoding, callback);
76
+ underlying.write(chunk, encoding, callback);
71
77
  },
72
78
  final(callback) {
73
- options.stream.end(callback);
79
+ underlying.end(callback);
74
80
  }
75
81
  });
76
- // Proxy events from underlying stream
77
- options.stream.on("error", err => this.emit("error", err));
78
- options.stream.on("close", () => this.emit("close"));
82
+ // Proxy events from underlying stream, but ensure we clean up listeners so
83
+ // the underlying stream cannot retain this wrapper longer than necessary.
84
+ const onUnderlyingError = (err) => {
85
+ this.emit("error", err);
86
+ };
87
+ const onUnderlyingClose = () => {
88
+ this.emit("close");
89
+ };
90
+ const cleanup = () => {
91
+ underlying.off("error", onUnderlyingError);
92
+ underlying.off("close", onUnderlyingClose);
93
+ };
94
+ underlying.on("error", onUnderlyingError);
95
+ underlying.on("close", onUnderlyingClose);
96
+ this.once("close", cleanup);
97
+ this.once("finish", cleanup);
79
98
  }
80
99
  else {
81
100
  super({
@@ -100,43 +119,25 @@ function normalizeWritable(stream) {
100
119
  if (stream instanceof Writable) {
101
120
  return stream;
102
121
  }
103
- // Node.js Writable: accept structurally even if typed as unknown.
122
+ // Node.js Writable: already compatible, avoid extra wrapper allocation.
104
123
  if (stream instanceof stream_1.Writable) {
105
- return new Writable({ stream: stream });
124
+ return stream;
106
125
  }
107
126
  // Web WritableStream: detect by getWriter() (avoid relying on global WritableStream).
108
127
  if (stream?.getWriter) {
109
- const nodeWritable = stream_1.Writable.fromWeb(stream);
110
- return new Writable({ stream: nodeWritable });
128
+ return stream_1.Writable.fromWeb(stream);
111
129
  }
112
- // Assume it structurally matches Node's Writable; wrap for consistent API.
113
- return new Writable({ stream: stream });
130
+ // Assume it structurally matches Node's Writable.
131
+ return stream;
114
132
  }
115
133
  // Import for internal use
116
134
  const shared_1 = require("./shared.js");
117
- const isReadableStream = (value) => !!value && typeof value === "object" && typeof value.getReader === "function";
118
- const isAsyncIterable = (value) => {
119
- if (!value || (typeof value !== "object" && typeof value !== "function")) {
120
- return false;
121
- }
122
- return typeof value[Symbol.asyncIterator] === "function";
123
- };
124
- const isWritableStream = (value) => !!value && typeof value === "object" && typeof value.getWriter === "function";
125
- const isTransformStream = (value) => !!value &&
126
- typeof value === "object" &&
127
- !!value.readable &&
128
- !!value.writable &&
129
- isReadableStream(value.readable) &&
130
- isWritableStream(value.writable);
131
135
  const isPipelineOptions = (value) => {
132
136
  if (!value || typeof value !== "object") {
133
137
  return false;
134
138
  }
135
- // IMPORTANT:
136
- // Do NOT use `"end" in obj` here because streams have `.end()` and would be
137
- // misclassified as options, breaking argument parsing and potentially hanging.
139
+ // Avoid treating streams as options objects.
138
140
  if (typeof value.pipe === "function" ||
139
- typeof value.write === "function" ||
140
141
  typeof value.end === "function" ||
141
142
  typeof value.getReader === "function" ||
142
143
  typeof value.getWriter === "function") {
@@ -153,13 +154,13 @@ const toNodePipelineStream = (stream) => {
153
154
  stream instanceof stream_1.Writable) {
154
155
  return stream;
155
156
  }
156
- if (isTransformStream(stream)) {
157
+ if ((0, type_guards_1.isTransformStream)(stream)) {
157
158
  return stream_1.Transform.fromWeb(stream);
158
159
  }
159
- if (isReadableStream(stream)) {
160
+ if ((0, type_guards_1.isReadableStream)(stream)) {
160
161
  return stream_1.Readable.fromWeb(stream);
161
162
  }
162
- if (isWritableStream(stream)) {
163
+ if ((0, type_guards_1.isWritableStream)(stream)) {
163
164
  return stream_1.Writable.fromWeb(stream);
164
165
  }
165
166
  return stream;
@@ -223,12 +224,13 @@ function finished(stream, optionsOrCallback, callback) {
223
224
  const promise = new Promise((resolve, reject) => {
224
225
  const normalizedStream = toNodePipelineStream(stream);
225
226
  stream_1.finished(normalizedStream, options, (err) => {
226
- if (err && !(options && options.error)) {
227
+ // Node.js semantics: options.error defaults to true (report errors).
228
+ // If options.error === false, ignore errors and resolve.
229
+ if (err && options?.error !== false) {
227
230
  reject(err);
231
+ return;
228
232
  }
229
- else {
230
- resolve();
231
- }
233
+ resolve();
232
234
  });
233
235
  });
234
236
  if (cb) {
@@ -455,41 +457,20 @@ function createCollector(options) {
455
457
  // =============================================================================
456
458
  // Pull Stream - Read data on demand with pattern matching
457
459
  // =============================================================================
458
- class PullStream extends pull_stream_1.PullStream {
459
- }
460
- exports.PullStream = PullStream;
461
460
  /**
462
461
  * Create a pull stream
463
462
  */
464
463
  function createPullStream(options) {
465
- return new PullStream(options);
464
+ return new pull_stream_1.PullStream(options);
466
465
  }
467
466
  // =============================================================================
468
467
  // Buffered Stream - Efficient chunk management
469
468
  // =============================================================================
470
- /**
471
- * String chunk implementation
472
- */
473
- class StringChunk extends buffered_stream_1.StringChunk {
474
- }
475
- exports.StringChunk = StringChunk;
476
- /**
477
- * Buffer chunk implementation
478
- */
479
- class BufferChunk extends buffered_stream_1.BufferChunk {
480
- }
481
- exports.BufferChunk = BufferChunk;
482
- /**
483
- * Buffered stream with efficient chunk management
484
- */
485
- class BufferedStream extends buffered_stream_1.BufferedStream {
486
- }
487
- exports.BufferedStream = BufferedStream;
488
469
  /**
489
470
  * Create a buffered stream
490
471
  */
491
472
  function createBufferedStream(options) {
492
- return new BufferedStream(options);
473
+ return new buffered_stream_1.BufferedStream(options);
493
474
  }
494
475
  // =============================================================================
495
476
  // Utility Functions
@@ -506,10 +487,10 @@ async function streamToPromise(stream) {
506
487
  */
507
488
  async function streamToBuffer(stream) {
508
489
  let iterable;
509
- if (isReadableStream(stream)) {
490
+ if ((0, type_guards_1.isReadableStream)(stream)) {
510
491
  iterable = stream_1.Readable.fromWeb(stream);
511
492
  }
512
- else if (isAsyncIterable(stream)) {
493
+ else if ((0, type_guards_1.isAsyncIterable)(stream)) {
513
494
  iterable = stream;
514
495
  }
515
496
  else {
@@ -551,10 +532,10 @@ async function streamToString(stream, encoding) {
551
532
  */
552
533
  async function drainStream(stream) {
553
534
  let iterable;
554
- if (isReadableStream(stream)) {
535
+ if ((0, type_guards_1.isReadableStream)(stream)) {
555
536
  iterable = stream_1.Readable.fromWeb(stream);
556
537
  }
557
- else if (isAsyncIterable(stream)) {
538
+ else if ((0, type_guards_1.isAsyncIterable)(stream)) {
558
539
  iterable = stream;
559
540
  }
560
541
  else {
@@ -581,13 +562,28 @@ function addAbortSignal(signal, stream) {
581
562
  stream.destroy(new Error("Aborted"));
582
563
  return stream;
583
564
  }
565
+ const cleanup = () => {
566
+ signal.removeEventListener("abort", onAbort);
567
+ stream.off?.("close", onDone);
568
+ stream.off?.("end", onDone);
569
+ stream.off?.("finish", onDone);
570
+ stream.off?.("error", onError);
571
+ };
584
572
  const onAbort = () => {
573
+ cleanup();
585
574
  stream.destroy(new Error("Aborted"));
586
575
  };
576
+ const onDone = () => {
577
+ cleanup();
578
+ };
579
+ const onError = () => {
580
+ cleanup();
581
+ };
587
582
  signal.addEventListener("abort", onAbort, { once: true });
588
- stream.on("close", () => {
589
- signal.removeEventListener("abort", onAbort);
590
- });
583
+ stream.once?.("close", onDone);
584
+ stream.once?.("end", onDone);
585
+ stream.once?.("finish", onDone);
586
+ stream.once?.("error", onError);
591
587
  return stream;
592
588
  }
593
589
  /**
@@ -630,56 +626,109 @@ function compose(...transforms) {
630
626
  if (len === 1 && isNativeTransform(transforms[0])) {
631
627
  return transforms[0];
632
628
  }
633
- // Chain all transforms together
629
+ // Chain all transforms together once.
634
630
  for (let i = 0; i < len - 1; i++) {
635
631
  transforms[i].pipe(transforms[i + 1]);
636
632
  }
637
- // Create a Duplex that writes to first and reads from last
638
633
  const first = transforms[0];
639
634
  const last = transforms[len - 1];
640
- // Create a PassThrough as the composed stream
641
- const composed = new stream_1.PassThrough({ objectMode: first.readableObjectMode });
642
- // Store original methods for forwarding
643
- const passthroughWrite = composed.write.bind(composed);
644
- const passthroughEnd = composed.end.bind(composed);
645
- // Override write to write to first transform
646
- composed.write = function (chunk, encodingOrCallback, callback) {
647
- if (typeof encodingOrCallback === "function") {
648
- return first.write(chunk, encodingOrCallback);
635
+ // Use a private output stream so we don't have to monkey-patch `write()` on the
636
+ // public composed stream (which would break piping into it).
637
+ const output = new stream_1.PassThrough({ objectMode: last.readableObjectMode ?? true });
638
+ last.pipe(output);
639
+ let outputEnded = false;
640
+ const pumpOutput = (target) => {
641
+ if (outputEnded) {
642
+ return;
649
643
  }
650
- return first.write(chunk, encodingOrCallback, callback);
651
- };
652
- // Override end to end first transform
653
- composed.end = function (chunkOrCallback, encodingOrCallback, callback) {
654
- if (typeof chunkOrCallback === "function") {
655
- first.end(chunkOrCallback);
656
- }
657
- else if (typeof encodingOrCallback === "function") {
658
- first.end(chunkOrCallback, encodingOrCallback);
644
+ while (true) {
645
+ const chunk = output.read();
646
+ if (chunk === null) {
647
+ break;
648
+ }
649
+ if (!target.push(chunk)) {
650
+ break;
651
+ }
659
652
  }
660
- else {
661
- first.end(chunkOrCallback, encodingOrCallback, callback);
653
+ };
654
+ const composed = new stream_1.Transform({
655
+ readableObjectMode: last.readableObjectMode,
656
+ writableObjectMode: first.writableObjectMode,
657
+ transform(chunk, encoding, callback) {
658
+ try {
659
+ // Forward writes into the head of the chain.
660
+ first.write(chunk, encoding, callback);
661
+ }
662
+ catch (err) {
663
+ callback(err);
664
+ }
665
+ },
666
+ flush(callback) {
667
+ // End the head of the chain; readable completion is driven by `output` ending.
668
+ const onFinish = () => {
669
+ cleanupFlush();
670
+ callback();
671
+ };
672
+ const onError = (err) => {
673
+ cleanupFlush();
674
+ callback(err);
675
+ };
676
+ const cleanupFlush = () => {
677
+ first.off?.("finish", onFinish);
678
+ first.off?.("error", onError);
679
+ };
680
+ first.once?.("finish", onFinish);
681
+ first.once?.("error", onError);
682
+ first.end();
683
+ },
684
+ read() {
685
+ pumpOutput(this);
686
+ },
687
+ destroy(err, callback) {
688
+ try {
689
+ output.destroy(err ?? undefined);
690
+ for (const t of transforms) {
691
+ t.destroy?.(err ?? undefined);
692
+ }
693
+ }
694
+ finally {
695
+ callback(err);
696
+ }
662
697
  }
663
- return composed;
698
+ });
699
+ const onOutputReadable = () => {
700
+ pumpOutput(composed);
664
701
  };
665
- // Override pipe to pipe from last transform
666
- composed.pipe = function (dest) {
667
- return last.pipe(dest);
702
+ const onOutputEnd = () => {
703
+ cleanupListeners();
704
+ outputEnded = true;
705
+ composed.push(null);
668
706
  };
669
- // Forward data from last to composed
670
- last.on("data", (chunk) => {
671
- passthroughWrite(chunk);
672
- });
673
- // Forward end from last
674
- last.on("end", () => {
675
- passthroughEnd();
676
- });
677
- // Forward errors from any transform
678
- for (const transform of transforms) {
679
- transform.on("error", (err) => {
680
- composed.emit("error", err);
681
- });
707
+ const onAnyError = (err) => {
708
+ cleanupListeners();
709
+ composed.destroy(err);
710
+ };
711
+ const transformErrorListeners = [];
712
+ const cleanupListeners = () => {
713
+ output.off("readable", onOutputReadable);
714
+ output.off("end", onOutputEnd);
715
+ output.off("error", onAnyError);
716
+ for (const { t, fn } of transformErrorListeners) {
717
+ t.off?.("error", fn);
718
+ }
719
+ transformErrorListeners.length = 0;
720
+ };
721
+ output.on("readable", onOutputReadable);
722
+ output.once("end", onOutputEnd);
723
+ output.once("error", onAnyError);
724
+ for (const t of transforms) {
725
+ const tt = t;
726
+ tt.once?.("error", onAnyError);
727
+ transformErrorListeners.push({ t: tt, fn: onAnyError });
682
728
  }
729
+ composed.once("close", () => {
730
+ cleanupListeners();
731
+ });
683
732
  return composed;
684
733
  }
685
734
  /**
@@ -760,7 +809,7 @@ function once(emitter, event, options) {
760
809
  onAbort();
761
810
  return;
762
811
  }
763
- options.signal.addEventListener("abort", onAbort);
812
+ options.signal.addEventListener("abort", onAbort, { once: true });
764
813
  }
765
814
  });
766
815
  }
@@ -28,46 +28,13 @@ async function collect(stream) {
28
28
  return result;
29
29
  }
30
30
  async function text(stream) {
31
- const chunks = [];
32
- let totalLength = 0;
33
- for await (const chunk of stream) {
34
- chunks.push(chunk);
35
- totalLength += chunk.length;
36
- }
37
- if (chunks.length === 1) {
38
- return (0, shared_1.uint8ArrayToString)(chunks[0]);
39
- }
40
- const result = new Uint8Array(totalLength);
41
- let offset = 0;
42
- for (let i = 0, len = chunks.length; i < len; i++) {
43
- const c = chunks[i];
44
- result.set(c, offset);
45
- offset += c.length;
46
- }
47
- return (0, shared_1.uint8ArrayToString)(result);
31
+ return streams_1.consumers.text(stream);
48
32
  }
49
33
  async function json(stream) {
50
- const str = await text(stream);
51
- return JSON.parse(str);
34
+ return streams_1.consumers.json(stream);
52
35
  }
53
36
  async function bytes(stream) {
54
- const chunks = [];
55
- let totalLength = 0;
56
- for await (const chunk of stream) {
57
- chunks.push(chunk);
58
- totalLength += chunk.length;
59
- }
60
- if (chunks.length === 1) {
61
- return chunks[0];
62
- }
63
- const result = new Uint8Array(totalLength);
64
- let offset = 0;
65
- for (let i = 0, len = chunks.length; i < len; i++) {
66
- const c = chunks[i];
67
- result.set(c, offset);
68
- offset += c.length;
69
- }
70
- return result;
37
+ return streams_1.consumers.buffer(stream);
71
38
  }
72
39
  // =============================================================================
73
40
  // Stream Factory Helpers
@@ -39,3 +39,15 @@ export { CsvParserStream, CsvFormatterStream } from "./modules/csv/csv.browser.j
39
39
  // Utilities
40
40
  // =============================================================================
41
41
  export * from "./modules/excel/utils/sheet-utils.js";
42
+ // =============================================================================
43
+ // Archive (ZIP) support (Browser-compatible)
44
+ // =============================================================================
45
+ export {
46
+ // High-level archive API
47
+ zip, unzip, ZipArchive, ZipReader, UnzipEntry,
48
+ // CRC32
49
+ crc32, crc32Update, crc32Finalize,
50
+ // Compression utilities
51
+ compress, compressSync, decompress, decompressSync, hasCompressionStream,
52
+ // Streaming compression
53
+ createDeflateStream, createInflateStream, hasDeflateRaw } from "./modules/archive/index.browser.js";
@@ -8,7 +8,7 @@
8
8
  * Browser fallback: For browsers without deflate-raw support (Firefox < 113, Safari < 16.4),
9
9
  * see deflate-fallback.ts for pure JS implementation
10
10
  */
11
- import { ByteQueue } from "./byte-queue.js";
11
+ import { ByteQueue } from "../internal/byte-queue.js";
12
12
  /**
13
13
  * Default threshold (in bytes) to choose the lower-overhead path.
14
14
  *
@@ -10,20 +10,12 @@
10
10
  * - Safari >= 14.1
11
11
  * - Edge >= 89
12
12
  */
13
- import { compressWithStream, decompressWithStream, hasDeflateRawCompressionStream, hasDeflateRawDecompressionStream } from "./compress.base.js";
13
+ import { compressWithStream, decompressWithStream, hasCompressionStream, hasDeflateRawCompressionStream, hasDeflateRawDecompressionStream } from "./compress.base.js";
14
14
  import { inflateRaw, deflateRawCompressed } from "./deflate-fallback.js";
15
- import { DEFAULT_COMPRESS_LEVEL } from "./defaults.js";
15
+ import { DEFAULT_COMPRESS_LEVEL } from "../defaults.js";
16
16
  // Re-export shared types
17
17
  export {};
18
- /**
19
- * Check if CompressionStream is available in this environment.
20
- *
21
- * Note: Some environments may expose CompressionStream but not support
22
- * the "deflate-raw" format that ZIP requires.
23
- */
24
- export function hasCompressionStream() {
25
- return typeof CompressionStream !== "undefined";
26
- }
18
+ export { hasCompressionStream };
27
19
  /**
28
20
  * Compress data using browser's native CompressionStream or JS fallback
29
21
  *
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { promisify } from "util";
8
8
  import * as zlib from "zlib";
9
- import { DEFAULT_COMPRESS_LEVEL } from "./defaults.js";
9
+ import { DEFAULT_COMPRESS_LEVEL } from "../defaults.js";
10
10
  // Re-export shared types and utilities
11
11
  export { hasCompressionStream } from "./compress.base.js";
12
12
  function uint8ArrayToBufferView(data) {
@@ -8,7 +8,7 @@
8
8
  * x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1
9
9
  * Represented as 0xEDB88320 in reversed (LSB-first) form
10
10
  */
11
- import { isNode } from "../../utils/env.js";
11
+ import { isNode } from "../../../utils/env.js";
12
12
  import { crc32JS, crc32UpdateJS, crc32Finalize } from "./crc32.base.js";
13
13
  // Lazy-loaded zlib module for Node.js
14
14
  let _zlib = null;
@@ -10,7 +10,7 @@
10
10
  * - Safari < 16.4
11
11
  * - Chrome < 103
12
12
  */
13
- import { concatUint8Arrays } from "./utils/bytes.js";
13
+ import { concatUint8Arrays } from "../utils/bytes.js";
14
14
  // ============================================================================
15
15
  // DEFLATE Decompression (Full implementation)
16
16
  // ============================================================================
@@ -6,11 +6,11 @@
6
6
  *
7
7
  * API compatible with Node.js version - supports .on("data"), .on("end"), .write(callback), .end()
8
8
  */
9
- import { EventEmitter } from "../stream/index.js";
9
+ import { EventEmitter } from "../../stream/index.js";
10
10
  import { deflateRawCompressed, inflateRaw } from "./deflate-fallback.js";
11
11
  import { hasDeflateRawWebStreams } from "./compress.base.js";
12
- import { concatUint8Arrays } from "./utils/bytes.js";
13
- import { DEFAULT_COMPRESS_LEVEL } from "./defaults.js";
12
+ import { concatUint8Arrays } from "../utils/bytes.js";
13
+ import { DEFAULT_COMPRESS_LEVEL } from "../defaults.js";
14
14
  import { asError } from "./streaming-compress.base.js";
15
15
  /**
16
16
  * Check if deflate-raw streaming compression is supported by this library.
@@ -5,8 +5,8 @@
5
5
  * Each write() immediately produces compressed output without waiting for end().
6
6
  */
7
7
  import { createDeflateRaw, createInflateRaw, constants } from "zlib";
8
- import { Transform } from "../stream/index.js";
9
- import { DEFAULT_COMPRESS_LEVEL } from "./defaults.js";
8
+ import { Transform } from "../../stream/index.js";
9
+ import { DEFAULT_COMPRESS_LEVEL } from "../defaults.js";
10
10
  /**
11
11
  * Wrapper around zlib DeflateRaw that flushes after every write
12
12
  * This ensures true streaming behavior - data is emitted immediately, not buffered
@@ -1,3 +1,6 @@
1
- export const DEFAULT_COMPRESS_LEVEL = 6;
2
- export const DEFAULT_ZIP_LEVEL = 6;
3
- export const DEFAULT_ZIP_TIMESTAMPS = "dos+utc";
1
+ export const DEFAULT_DEFLATE_LEVEL = 6;
2
+ // Backward-compatible aliases (avoid default drift across modules).
3
+ export const DEFAULT_COMPRESS_LEVEL = DEFAULT_DEFLATE_LEVEL;
4
+ export const DEFAULT_ZIP_LEVEL = DEFAULT_DEFLATE_LEVEL;
5
+ // Prefer reproducible output by default: omit the Info-ZIP UTC mtime extra field.
6
+ export const DEFAULT_ZIP_TIMESTAMPS = "dos";
@@ -5,9 +5,6 @@
5
5
  * Platform-specific entrypoints (index.ts / index.browser.ts) should re-export
6
6
  * from this file and then layer their platform-specific bindings.
7
7
  */
8
- // ZIP builders
9
- export { createZip, createZipSync, ZipBuilder } from "./zip-builder.js";
10
- // Streaming ZIP (fflate-like API)
11
- export { StreamingZip, ZipDeflateFile, Zip, ZipDeflate } from "./streaming-zip.js";
12
- // Buffer-based unzip API (cross-platform)
13
- export { extractAll, extractFile, listFiles, forEachEntry, ZipParser } from "./extract.js";
8
+ // High-level APIs
9
+ export { zip, ZipArchive } from "./zip/index.js";
10
+ export { unzip, ZipReader, UnzipEntry } from "./unzip/index.js";
@@ -6,12 +6,8 @@
6
6
  */
7
7
  export * from "./index.base.js";
8
8
  // CRC32
9
- export { crc32, crc32Update, crc32Finalize } from "./crc32.browser.js";
9
+ export { crc32, crc32Update, crc32Finalize } from "./compression/crc32.browser.js";
10
10
  // Compression
11
- export { compress, compressSync, decompress, decompressSync, hasCompressionStream } from "./compress.browser.js";
11
+ export { compress, compressSync, decompress, decompressSync, hasCompressionStream } from "./compression/compress.browser.js";
12
12
  // Streaming compression
13
- export { createDeflateStream, createInflateStream, hasDeflateRaw } from "./streaming-compress.browser.js";
14
- // Stream-based unzip API (browser implementation)
15
- export { Parse, createParse } from "./parse.browser.js";
16
- // Buffer-based unzip API (cross-platform)
17
- // (re-exported from ./index.base)
13
+ export { createDeflateStream, createInflateStream, hasDeflateRaw } from "./compression/streaming-compress.browser.js";
@@ -6,10 +6,8 @@
6
6
  */
7
7
  export * from "./index.base.js";
8
8
  // CRC32
9
- export { crc32, crc32Update, crc32Finalize } from "./crc32.js";
9
+ export { crc32, crc32Update, crc32Finalize } from "./compression/crc32.js";
10
10
  // Compression
11
- export { compress, compressSync, decompress, decompressSync, hasCompressionStream } from "./compress.js";
11
+ export { compress, compressSync, decompress, decompressSync, hasCompressionStream } from "./compression/compress.js";
12
12
  // Streaming compression
13
- export { createDeflateStream, createInflateStream, hasDeflateRaw } from "./streaming-compress.js";
14
- // Stream-based unzip API (Node.js; browser build aliases to ./parse.browser.ts)
15
- export { Parse, createParse } from "./parse.js";
13
+ export { createDeflateStream, createInflateStream, hasDeflateRaw } from "./compression/streaming-compress.js";