@cj-tech-master/excelts 4.2.0 → 4.2.1-canary.20260111102127.f808a37

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 (241) 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/{types/modules/archive → browser/modules/archive/compression}/compress.base.d.ts +1 -0
  5. package/dist/browser/modules/archive/{compress.base.js → compression/compress.base.js} +2 -1
  6. package/dist/{types/modules/archive → browser/modules/archive/compression}/compress.browser.d.ts +10 -8
  7. package/dist/{esm/modules/archive → browser/modules/archive/compression}/compress.browser.js +18 -19
  8. package/dist/browser/modules/archive/{compress.d.ts → compression/compress.d.ts} +2 -2
  9. package/dist/browser/modules/archive/{compress.js → compression/compress.js} +1 -1
  10. package/dist/browser/modules/archive/{crc32.browser.d.ts → compression/crc32.browser.d.ts} +1 -1
  11. package/dist/browser/modules/archive/{crc32.d.ts → compression/crc32.d.ts} +1 -1
  12. package/dist/browser/modules/archive/{crc32.js → compression/crc32.js} +1 -1
  13. package/dist/browser/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
  14. package/dist/browser/modules/archive/{streaming-compress.browser.d.ts → compression/streaming-compress.browser.d.ts} +2 -2
  15. package/dist/browser/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
  16. package/dist/browser/modules/archive/{streaming-compress.d.ts → compression/streaming-compress.d.ts} +2 -2
  17. package/dist/browser/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
  18. package/dist/browser/modules/archive/defaults.d.ts +1 -0
  19. package/dist/browser/modules/archive/defaults.js +6 -3
  20. package/dist/browser/modules/archive/index.base.d.ts +4 -4
  21. package/dist/browser/modules/archive/index.base.js +3 -6
  22. package/dist/browser/modules/archive/index.browser.d.ts +3 -4
  23. package/dist/browser/modules/archive/index.browser.js +3 -7
  24. package/dist/browser/modules/archive/index.d.ts +3 -4
  25. package/dist/browser/modules/archive/index.js +3 -5
  26. package/dist/browser/modules/archive/internal/byte-queue.d.ts +33 -0
  27. package/dist/browser/modules/archive/internal/byte-queue.js +407 -0
  28. package/dist/browser/modules/archive/io/archive-sink.d.ts +9 -0
  29. package/dist/browser/modules/archive/io/archive-sink.js +77 -0
  30. package/dist/browser/modules/archive/io/archive-source.d.ts +8 -0
  31. package/dist/browser/modules/archive/io/archive-source.js +107 -0
  32. package/dist/browser/modules/archive/{extract.d.ts → unzip/extract.d.ts} +2 -2
  33. package/dist/browser/modules/archive/unzip/index.d.ts +40 -0
  34. package/dist/browser/modules/archive/unzip/index.js +164 -0
  35. package/dist/browser/modules/archive/{parse.base.d.ts → unzip/stream.base.d.ts} +58 -3
  36. package/dist/browser/modules/archive/unzip/stream.base.js +1022 -0
  37. package/dist/browser/modules/archive/{parse.browser.d.ts → unzip/stream.browser.d.ts} +1 -1
  38. package/dist/browser/modules/archive/{parse.browser.js → unzip/stream.browser.js} +376 -110
  39. package/dist/browser/modules/archive/{parse.d.ts → unzip/stream.d.ts} +2 -2
  40. package/dist/{esm/modules/archive/parse.js → browser/modules/archive/unzip/stream.js} +7 -6
  41. package/dist/{types/modules/archive → browser/modules/archive/unzip}/zip-parser.d.ts +1 -1
  42. package/dist/{esm/modules/archive → browser/modules/archive/unzip}/zip-parser.js +38 -24
  43. package/dist/browser/modules/archive/utils/async-queue.d.ts +7 -0
  44. package/dist/browser/modules/archive/utils/async-queue.js +103 -0
  45. package/dist/browser/modules/archive/utils/bytes.js +16 -16
  46. package/dist/browser/modules/archive/utils/compressibility.d.ts +10 -0
  47. package/dist/browser/modules/archive/utils/compressibility.js +57 -0
  48. package/dist/browser/modules/archive/utils/parse-buffer.js +21 -23
  49. package/dist/browser/modules/archive/utils/pattern-scanner.d.ts +21 -0
  50. package/dist/browser/modules/archive/utils/pattern-scanner.js +27 -0
  51. package/dist/browser/modules/archive/utils/timestamps.js +62 -1
  52. package/dist/browser/modules/archive/utils/zip-extra-fields.d.ts +1 -1
  53. package/dist/browser/modules/archive/utils/zip-extra-fields.js +26 -14
  54. package/dist/browser/modules/archive/zip/index.d.ts +42 -0
  55. package/dist/browser/modules/archive/zip/index.js +157 -0
  56. package/dist/browser/modules/archive/{streaming-zip.d.ts → zip/stream.d.ts} +28 -5
  57. package/dist/browser/modules/archive/{streaming-zip.js → zip/stream.js} +192 -48
  58. package/dist/browser/modules/archive/zip/zip-bytes.d.ts +73 -0
  59. package/dist/browser/modules/archive/zip/zip-bytes.js +239 -0
  60. package/dist/{esm/modules/archive → browser/modules/archive/zip}/zip-entry-metadata.js +3 -3
  61. package/dist/browser/modules/archive/{zip-records.d.ts → zip-spec/zip-records.d.ts} +20 -0
  62. package/dist/browser/modules/archive/zip-spec/zip-records.js +126 -0
  63. package/dist/browser/modules/excel/form-control.d.ts +2 -0
  64. package/dist/browser/modules/excel/form-control.js +54 -16
  65. package/dist/browser/modules/excel/stream/workbook-reader.browser.js +1 -1
  66. package/dist/browser/modules/excel/stream/workbook-writer.browser.d.ts +1 -1
  67. package/dist/browser/modules/excel/stream/workbook-writer.browser.js +1 -1
  68. package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +17 -3
  69. package/dist/browser/modules/excel/xlsx/xlsx.browser.js +3 -6
  70. package/dist/browser/modules/excel/xlsx/xlsx.js +1 -1
  71. package/dist/browser/modules/stream/streams.browser.d.ts +28 -28
  72. package/dist/browser/modules/stream/streams.browser.js +850 -697
  73. package/dist/browser/modules/stream/streams.js +140 -58
  74. package/dist/cjs/modules/archive/{compress.base.js → compression/compress.base.js} +2 -1
  75. package/dist/cjs/modules/archive/{compress.browser.js → compression/compress.browser.js} +18 -19
  76. package/dist/cjs/modules/archive/{compress.js → compression/compress.js} +1 -1
  77. package/dist/cjs/modules/archive/{crc32.js → compression/crc32.js} +1 -1
  78. package/dist/cjs/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
  79. package/dist/cjs/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
  80. package/dist/cjs/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
  81. package/dist/cjs/modules/archive/defaults.js +7 -4
  82. package/dist/cjs/modules/archive/index.base.js +9 -19
  83. package/dist/cjs/modules/archive/index.browser.js +4 -10
  84. package/dist/cjs/modules/archive/index.js +4 -8
  85. package/dist/cjs/modules/archive/internal/byte-queue.js +411 -0
  86. package/dist/cjs/modules/archive/io/archive-sink.js +82 -0
  87. package/dist/cjs/modules/archive/io/archive-source.js +114 -0
  88. package/dist/cjs/modules/archive/unzip/index.js +170 -0
  89. package/dist/cjs/modules/archive/unzip/stream.base.js +1044 -0
  90. package/dist/cjs/modules/archive/{parse.browser.js → unzip/stream.browser.js} +377 -111
  91. package/dist/cjs/modules/archive/{parse.js → unzip/stream.js} +9 -8
  92. package/dist/cjs/modules/archive/{zip-parser.js → unzip/zip-parser.js} +47 -33
  93. package/dist/cjs/modules/archive/utils/async-queue.js +106 -0
  94. package/dist/cjs/modules/archive/utils/bytes.js +16 -16
  95. package/dist/cjs/modules/archive/utils/compressibility.js +60 -0
  96. package/dist/cjs/modules/archive/utils/parse-buffer.js +21 -23
  97. package/dist/cjs/modules/archive/utils/pattern-scanner.js +31 -0
  98. package/dist/cjs/modules/archive/utils/timestamps.js +64 -3
  99. package/dist/cjs/modules/archive/utils/zip-extra-fields.js +26 -14
  100. package/dist/cjs/modules/archive/zip/index.js +162 -0
  101. package/dist/cjs/modules/archive/{streaming-zip.js → zip/stream.js} +194 -50
  102. package/dist/cjs/modules/archive/zip/zip-bytes.js +242 -0
  103. package/dist/cjs/modules/archive/{zip-entry-metadata.js → zip/zip-entry-metadata.js} +5 -5
  104. package/dist/cjs/modules/archive/zip-spec/zip-records.js +136 -0
  105. package/dist/cjs/modules/excel/form-control.js +54 -16
  106. package/dist/cjs/modules/excel/stream/workbook-reader.browser.js +2 -2
  107. package/dist/cjs/modules/excel/stream/workbook-writer.browser.js +4 -4
  108. package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +17 -3
  109. package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +6 -9
  110. package/dist/cjs/modules/excel/xlsx/xlsx.js +2 -2
  111. package/dist/cjs/modules/stream/streams.browser.js +850 -697
  112. package/dist/cjs/modules/stream/streams.js +140 -58
  113. package/dist/esm/index.browser.js +12 -0
  114. package/dist/esm/modules/archive/{compress.base.js → compression/compress.base.js} +2 -1
  115. package/dist/{browser/modules/archive → esm/modules/archive/compression}/compress.browser.js +18 -19
  116. package/dist/esm/modules/archive/{compress.js → compression/compress.js} +1 -1
  117. package/dist/esm/modules/archive/{crc32.js → compression/crc32.js} +1 -1
  118. package/dist/esm/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
  119. package/dist/esm/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
  120. package/dist/esm/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
  121. package/dist/esm/modules/archive/defaults.js +6 -3
  122. package/dist/esm/modules/archive/index.base.js +3 -6
  123. package/dist/esm/modules/archive/index.browser.js +3 -7
  124. package/dist/esm/modules/archive/index.js +3 -5
  125. package/dist/esm/modules/archive/internal/byte-queue.js +407 -0
  126. package/dist/esm/modules/archive/io/archive-sink.js +77 -0
  127. package/dist/esm/modules/archive/io/archive-source.js +107 -0
  128. package/dist/esm/modules/archive/unzip/index.js +164 -0
  129. package/dist/esm/modules/archive/unzip/stream.base.js +1022 -0
  130. package/dist/esm/modules/archive/{parse.browser.js → unzip/stream.browser.js} +376 -110
  131. package/dist/{browser/modules/archive/parse.js → esm/modules/archive/unzip/stream.js} +7 -6
  132. package/dist/{browser/modules/archive → esm/modules/archive/unzip}/zip-parser.js +38 -24
  133. package/dist/esm/modules/archive/utils/async-queue.js +103 -0
  134. package/dist/esm/modules/archive/utils/bytes.js +16 -16
  135. package/dist/esm/modules/archive/utils/compressibility.js +57 -0
  136. package/dist/esm/modules/archive/utils/parse-buffer.js +21 -23
  137. package/dist/esm/modules/archive/utils/pattern-scanner.js +27 -0
  138. package/dist/esm/modules/archive/utils/timestamps.js +62 -1
  139. package/dist/esm/modules/archive/utils/zip-extra-fields.js +26 -14
  140. package/dist/esm/modules/archive/zip/index.js +157 -0
  141. package/dist/esm/modules/archive/{streaming-zip.js → zip/stream.js} +192 -48
  142. package/dist/esm/modules/archive/zip/zip-bytes.js +239 -0
  143. package/dist/{browser/modules/archive → esm/modules/archive/zip}/zip-entry-metadata.js +3 -3
  144. package/dist/esm/modules/archive/zip-spec/zip-records.js +126 -0
  145. package/dist/esm/modules/excel/form-control.js +54 -16
  146. package/dist/esm/modules/excel/stream/workbook-reader.browser.js +1 -1
  147. package/dist/esm/modules/excel/stream/workbook-writer.browser.js +1 -1
  148. package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +17 -3
  149. package/dist/esm/modules/excel/xlsx/xlsx.browser.js +3 -6
  150. package/dist/esm/modules/excel/xlsx/xlsx.js +1 -1
  151. package/dist/esm/modules/stream/streams.browser.js +850 -697
  152. package/dist/esm/modules/stream/streams.js +140 -58
  153. package/dist/iife/THIRD_PARTY_NOTICES.md +81 -0
  154. package/dist/iife/excelts.iife.js +4777 -2863
  155. package/dist/iife/excelts.iife.js.map +1 -1
  156. package/dist/iife/excelts.iife.min.js +103 -31
  157. package/dist/types/index.browser.d.ts +1 -0
  158. package/dist/{browser/modules/archive → types/modules/archive/compression}/compress.base.d.ts +1 -0
  159. package/dist/{browser/modules/archive → types/modules/archive/compression}/compress.browser.d.ts +10 -8
  160. package/dist/types/modules/archive/{streaming-compress.browser.d.ts → compression/streaming-compress.browser.d.ts} +1 -1
  161. package/dist/types/modules/archive/defaults.d.ts +1 -0
  162. package/dist/types/modules/archive/index.base.d.ts +4 -4
  163. package/dist/types/modules/archive/index.browser.d.ts +3 -4
  164. package/dist/types/modules/archive/index.d.ts +3 -4
  165. package/dist/types/modules/archive/internal/byte-queue.d.ts +33 -0
  166. package/dist/types/modules/archive/io/archive-sink.d.ts +9 -0
  167. package/dist/types/modules/archive/io/archive-source.d.ts +8 -0
  168. package/dist/types/modules/archive/unzip/index.d.ts +40 -0
  169. package/dist/types/modules/archive/{parse.base.d.ts → unzip/stream.base.d.ts} +60 -5
  170. package/dist/types/modules/archive/{parse.browser.d.ts → unzip/stream.browser.d.ts} +2 -2
  171. package/dist/types/modules/archive/{parse.d.ts → unzip/stream.d.ts} +3 -3
  172. package/dist/{browser/modules/archive → types/modules/archive/unzip}/zip-parser.d.ts +1 -1
  173. package/dist/types/modules/archive/utils/async-queue.d.ts +7 -0
  174. package/dist/types/modules/archive/utils/compressibility.d.ts +10 -0
  175. package/dist/types/modules/archive/utils/pattern-scanner.d.ts +21 -0
  176. package/dist/types/modules/archive/utils/zip-extra-fields.d.ts +1 -1
  177. package/dist/types/modules/archive/zip/index.d.ts +42 -0
  178. package/dist/types/modules/archive/{streaming-zip.d.ts → zip/stream.d.ts} +29 -6
  179. package/dist/types/modules/archive/zip/zip-bytes.d.ts +73 -0
  180. package/dist/types/modules/archive/{zip-entry-metadata.d.ts → zip/zip-entry-metadata.d.ts} +1 -1
  181. package/dist/types/modules/archive/{zip-records.d.ts → zip-spec/zip-records.d.ts} +20 -0
  182. package/dist/types/modules/excel/form-control.d.ts +2 -0
  183. package/dist/types/modules/excel/stream/workbook-writer.browser.d.ts +1 -1
  184. package/dist/types/modules/stream/streams.browser.d.ts +28 -28
  185. package/package.json +10 -6
  186. package/dist/browser/modules/archive/byte-queue.d.ts +0 -18
  187. package/dist/browser/modules/archive/byte-queue.js +0 -125
  188. package/dist/browser/modules/archive/parse.base.js +0 -610
  189. package/dist/browser/modules/archive/utils/zip-extra.d.ts +0 -18
  190. package/dist/browser/modules/archive/utils/zip-extra.js +0 -68
  191. package/dist/browser/modules/archive/zip-builder.d.ts +0 -117
  192. package/dist/browser/modules/archive/zip-builder.js +0 -292
  193. package/dist/browser/modules/archive/zip-constants.d.ts +0 -18
  194. package/dist/browser/modules/archive/zip-constants.js +0 -23
  195. package/dist/browser/modules/archive/zip-records.js +0 -84
  196. package/dist/cjs/modules/archive/byte-queue.js +0 -129
  197. package/dist/cjs/modules/archive/parse.base.js +0 -632
  198. package/dist/cjs/modules/archive/utils/zip-extra.js +0 -74
  199. package/dist/cjs/modules/archive/zip-builder.js +0 -297
  200. package/dist/cjs/modules/archive/zip-constants.js +0 -26
  201. package/dist/cjs/modules/archive/zip-records.js +0 -90
  202. package/dist/esm/modules/archive/byte-queue.js +0 -125
  203. package/dist/esm/modules/archive/parse.base.js +0 -610
  204. package/dist/esm/modules/archive/utils/zip-extra.js +0 -68
  205. package/dist/esm/modules/archive/zip-builder.js +0 -292
  206. package/dist/esm/modules/archive/zip-constants.js +0 -23
  207. package/dist/esm/modules/archive/zip-records.js +0 -84
  208. package/dist/types/modules/archive/byte-queue.d.ts +0 -18
  209. package/dist/types/modules/archive/utils/zip-extra.d.ts +0 -18
  210. package/dist/types/modules/archive/zip-builder.d.ts +0 -117
  211. package/dist/types/modules/archive/zip-constants.d.ts +0 -18
  212. /package/dist/browser/modules/archive/{crc32.base.d.ts → compression/crc32.base.d.ts} +0 -0
  213. /package/dist/browser/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
  214. /package/dist/browser/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
  215. /package/dist/browser/modules/archive/{deflate-fallback.d.ts → compression/deflate-fallback.d.ts} +0 -0
  216. /package/dist/browser/modules/archive/{streaming-compress.base.d.ts → compression/streaming-compress.base.d.ts} +0 -0
  217. /package/dist/browser/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
  218. /package/dist/browser/modules/archive/{extract.js → unzip/extract.js} +0 -0
  219. /package/dist/browser/modules/archive/{zip-entry-metadata.d.ts → zip/zip-entry-metadata.d.ts} +0 -0
  220. /package/dist/browser/modules/archive/{zip-entry-info.d.ts → zip-spec/zip-entry-info.d.ts} +0 -0
  221. /package/dist/browser/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
  222. /package/dist/cjs/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
  223. /package/dist/cjs/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
  224. /package/dist/cjs/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
  225. /package/dist/cjs/modules/archive/{extract.js → unzip/extract.js} +0 -0
  226. /package/dist/cjs/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
  227. /package/dist/esm/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
  228. /package/dist/esm/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
  229. /package/dist/esm/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
  230. /package/dist/esm/modules/archive/{extract.js → unzip/extract.js} +0 -0
  231. /package/dist/esm/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
  232. /package/dist/{LICENSE → iife/LICENSE} +0 -0
  233. /package/dist/types/modules/archive/{compress.d.ts → compression/compress.d.ts} +0 -0
  234. /package/dist/types/modules/archive/{crc32.base.d.ts → compression/crc32.base.d.ts} +0 -0
  235. /package/dist/types/modules/archive/{crc32.browser.d.ts → compression/crc32.browser.d.ts} +0 -0
  236. /package/dist/types/modules/archive/{crc32.d.ts → compression/crc32.d.ts} +0 -0
  237. /package/dist/types/modules/archive/{deflate-fallback.d.ts → compression/deflate-fallback.d.ts} +0 -0
  238. /package/dist/types/modules/archive/{streaming-compress.base.d.ts → compression/streaming-compress.base.d.ts} +0 -0
  239. /package/dist/types/modules/archive/{streaming-compress.d.ts → compression/streaming-compress.d.ts} +0 -0
  240. /package/dist/types/modules/archive/{extract.d.ts → unzip/extract.d.ts} +0 -0
  241. /package/dist/types/modules/archive/{zip-entry-info.d.ts → zip-spec/zip-entry-info.d.ts} +0 -0
@@ -62,37 +62,6 @@ SOFTWARE.
62
62
 
63
63
  ## Third-party component
64
64
 
65
- unzipper is licensed under the MIT License:
66
-
67
- The MIT License (MIT)
68
-
69
- Copyright (c) 2012 - 2013 Near Infinity Corporation
70
-
71
- Permission is hereby granted, free of charge, to any person obtaining a copy
72
- of this software and associated documentation files (the "Software"), to deal
73
- in the Software without restriction, including without limitation the rights
74
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
75
- copies of the Software, and to permit persons to whom the Software is
76
- furnished to do so, subject to the following conditions:
77
-
78
- The above copyright notice and this permission notice shall be included in all
79
- copies or substantial portions of the Software.
80
-
81
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
82
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
83
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
84
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
85
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
86
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
87
- SOFTWARE.
88
-
89
- Commits in this fork are (c) Ziggy Jonsson (ziggy.jonsson.nyc@gmail.com) and
90
- fall under same licence structure as the original repo (MIT).
91
-
92
- ---
93
-
94
- ## Third-party component
95
-
96
65
  saxes is licensed under the ISC License:
97
66
 
98
67
  The ISC License
@@ -25,3 +25,4 @@ export { WorkbookWriter, WorkbookReader, WorksheetWriter, WorksheetReader };
25
25
  export type { CsvReadOptions, CsvWriteOptions, CsvStreamReadOptions, CsvStreamWriteOptions } from "@csv/csv.browser";
26
26
  export { CsvParserStream, CsvFormatterStream } from "@csv/csv.browser";
27
27
  export * from "@excel/utils/sheet-utils";
28
+ export { zip, unzip, ZipArchive, ZipReader, UnzipEntry, type ZipOptions, type ZipEntryOptions, type UnzipOptions, type ArchiveSource, type ArchiveSink, crc32, crc32Update, crc32Finalize, compress, compressSync, decompress, decompressSync, hasCompressionStream, type CompressOptions, createDeflateStream, createInflateStream, hasDeflateRaw, type StreamCompressOptions } from "@archive/index.browser";
@@ -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";
@@ -35,6 +35,7 @@ export interface CompressOptions {
35
35
  * Default threshold (in bytes) to choose the lower-overhead path.
36
36
  *
37
37
  * This is a performance knob, not a correctness requirement.
38
+ * Default: 8MB.
38
39
  */
39
40
  export declare const DEFAULT_COMPRESS_THRESHOLD_BYTES: number;
40
41
  /**
@@ -8,11 +8,12 @@
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
  *
15
15
  * This is a performance knob, not a correctness requirement.
16
+ * Default: 8MB.
16
17
  */
17
18
  export const DEFAULT_COMPRESS_THRESHOLD_BYTES = 8 * 1024 * 1024;
18
19
  /**
@@ -10,18 +10,15 @@
10
10
  * - Safari >= 14.1
11
11
  * - Edge >= 89
12
12
  */
13
- import { type CompressOptions } from "./compress.base.js";
13
+ import { type CompressOptions, hasCompressionStream } from "@archive/compression/compress.base";
14
14
  export { type CompressOptions };
15
- /**
16
- * Check if CompressionStream is available in this environment.
17
- *
18
- * Note: Some environments may expose CompressionStream but not support
19
- * the "deflate-raw" format that ZIP requires.
20
- */
21
- export declare function hasCompressionStream(): boolean;
15
+ export { hasCompressionStream };
22
16
  /**
23
17
  * Compress data using browser's native CompressionStream or JS fallback
24
18
  *
19
+ * Note: We always prefer native CompressionStream when available because
20
+ * it's significantly faster than pure JS implementation.
21
+ *
25
22
  * @param data - Data to compress
26
23
  * @param options - Compression options
27
24
  * @returns Compressed data
@@ -44,7 +41,12 @@ export declare function compressSync(data: Uint8Array, options?: CompressOptions
44
41
  /**
45
42
  * Decompress data using browser's native DecompressionStream or JS fallback
46
43
  *
44
+ * Note: We always prefer native DecompressionStream when available because
45
+ * it's significantly faster than pure JS implementation, regardless of data size.
46
+ * The threshold is only useful for compression where the overhead matters more.
47
+ *
47
48
  * @param data - Compressed data (deflate-raw format)
49
+ * @param options - Decompression options (kept for API parity; currently unused in browser)
48
50
  * @returns Decompressed data
49
51
  */
50
52
  export declare function decompress(data: Uint8Array, options?: CompressOptions): Promise<Uint8Array>;
@@ -10,23 +10,18 @@
10
10
  * - Safari >= 14.1
11
11
  * - Edge >= 89
12
12
  */
13
- import { compressWithStream, decompressWithStream, hasDeflateRawCompressionStream, hasDeflateRawDecompressionStream, resolveCompressThresholdBytes } 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
  *
22
+ * Note: We always prefer native CompressionStream when available because
23
+ * it's significantly faster than pure JS implementation.
24
+ *
30
25
  * @param data - Data to compress
31
26
  * @param options - Compression options
32
27
  * @returns Compressed data
@@ -39,16 +34,15 @@ export function hasCompressionStream() {
39
34
  */
40
35
  export async function compress(data, options = {}) {
41
36
  const level = options.level ?? DEFAULT_COMPRESS_LEVEL;
42
- const thresholdBytes = resolveCompressThresholdBytes(options);
43
37
  // Level 0 means no compression
44
38
  if (level === 0) {
45
39
  return data;
46
40
  }
47
- // Use native CompressionStream only for larger inputs.
48
- if (hasDeflateRawCompressionStream() && data.byteLength > thresholdBytes) {
41
+ // Always use native CompressionStream when available - it's much faster than JS
42
+ if (hasDeflateRawCompressionStream()) {
49
43
  return compressWithStream(data);
50
44
  }
51
- // Fallback to pure JS implementation
45
+ // Fallback to pure JS implementation only when native is unavailable
52
46
  return deflateRawCompressed(data);
53
47
  }
54
48
  /**
@@ -70,16 +64,21 @@ export function compressSync(data, options = {}) {
70
64
  /**
71
65
  * Decompress data using browser's native DecompressionStream or JS fallback
72
66
  *
67
+ * Note: We always prefer native DecompressionStream when available because
68
+ * it's significantly faster than pure JS implementation, regardless of data size.
69
+ * The threshold is only useful for compression where the overhead matters more.
70
+ *
73
71
  * @param data - Compressed data (deflate-raw format)
72
+ * @param options - Decompression options (kept for API parity; currently unused in browser)
74
73
  * @returns Decompressed data
75
74
  */
76
75
  export async function decompress(data, options = {}) {
77
- const thresholdBytes = resolveCompressThresholdBytes(options);
78
- // Use native DecompressionStream only for larger inputs.
79
- if (hasDeflateRawDecompressionStream() && data.byteLength > thresholdBytes) {
76
+ void options;
77
+ // Always use native DecompressionStream when available - it's much faster than JS
78
+ if (hasDeflateRawDecompressionStream()) {
80
79
  return decompressWithStream(data);
81
80
  }
82
- // Fallback to pure JS implementation
81
+ // Fallback to pure JS implementation only when native is unavailable
83
82
  return inflateRaw(data);
84
83
  }
85
84
  /**
@@ -4,8 +4,8 @@
4
4
  * Uses zlib module (C++ implementation, fastest) with "deflate-raw" format
5
5
  * (raw DEFLATE without zlib header/trailer, required for ZIP files)
6
6
  */
7
- export { type CompressOptions, hasCompressionStream } from "@archive/compress.base";
8
- import type { CompressOptions } from "@archive/compress.base";
7
+ export { type CompressOptions, hasCompressionStream } from "@archive/compression/compress.base";
8
+ import type { CompressOptions } from "@archive/compression/compress.base";
9
9
  /**
10
10
  * Compress data using Node.js native zlib
11
11
  *
@@ -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) {
@@ -7,7 +7,7 @@
7
7
  * 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
8
8
  * Represented as 0xEDB88320 in reversed (LSB-first) form
9
9
  */
10
- export { crc32JS as crc32, crc32UpdateJS as crc32Update, crc32Finalize } from "@archive/crc32.base";
10
+ export { crc32JS as crc32, crc32UpdateJS as crc32Update, crc32Finalize } from "@archive/compression/crc32.base";
11
11
  /**
12
12
  * Ensure CRC32 is ready (no-op in browser, for API compatibility)
13
13
  */
@@ -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 { crc32Finalize } from "@archive/crc32.base";
11
+ import { crc32Finalize } from "@archive/compression/crc32.base";
12
12
  /**
13
13
  * Calculate CRC32 checksum for the given data
14
14
  * Uses native zlib.crc32 in Node.js for ~100x better performance
@@ -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,8 +6,8 @@
6
6
  *
7
7
  * API compatible with Node.js version - supports .on("data"), .on("end"), .write(callback), .end()
8
8
  */
9
- export type { StreamCompressOptions } from "@archive/streaming-compress.base";
10
- import { type DeflateStream, type InflateStream, type StreamCompressOptions } from "@archive/streaming-compress.base";
9
+ export type { DeflateStream, InflateStream, StreamCompressOptions, StreamingCodec } from "@archive/compression/streaming-compress.base";
10
+ import { type DeflateStream, type InflateStream, type StreamCompressOptions } from "@archive/compression/streaming-compress.base";
11
11
  /**
12
12
  * Check if deflate-raw streaming compression is supported by this library.
13
13
  *
@@ -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.browser.js";
9
+ import { EventEmitter } from "../../stream/index.browser.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.
@@ -4,8 +4,8 @@
4
4
  * Uses zlib.createDeflateRaw() with explicit flush() calls for real chunk-by-chunk streaming.
5
5
  * Each write() immediately produces compressed output without waiting for end().
6
6
  */
7
- export type { DeflateStream, InflateStream, StreamCompressOptions, StreamingCodec } from "@archive/streaming-compress.base";
8
- import type { DeflateStream, InflateStream, StreamCompressOptions } from "@archive/streaming-compress.base";
7
+ export type { DeflateStream, InflateStream, StreamCompressOptions, StreamingCodec } from "@archive/compression/streaming-compress.base";
8
+ import type { DeflateStream, InflateStream, StreamCompressOptions } from "@archive/compression/streaming-compress.base";
9
9
  /**
10
10
  * Create a true streaming DEFLATE compressor
11
11
  * Returns a Transform stream that emits compressed data immediately after each write
@@ -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.browser.js";
9
- import { DEFAULT_COMPRESS_LEVEL } from "./defaults.js";
8
+ import { Transform } from "../../stream/index.browser.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,4 +1,5 @@
1
1
  import type { ZipTimestampMode } from "@archive/utils/timestamps";
2
+ export declare const DEFAULT_DEFLATE_LEVEL = 6;
2
3
  export declare const DEFAULT_COMPRESS_LEVEL = 6;
3
4
  export declare const DEFAULT_ZIP_LEVEL = 6;
4
5
  export declare const DEFAULT_ZIP_TIMESTAMPS: ZipTimestampMode;
@@ -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,7 +5,7 @@
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
- export { createZip, createZipSync, ZipBuilder, type ZipEntry, type ZipOptions } from "@archive/zip-builder";
9
- export { StreamingZip, ZipDeflateFile, Zip, ZipDeflate } from "@archive/streaming-zip";
10
- export { extractAll, extractFile, listFiles, forEachEntry, ZipParser, type ExtractedFile, type ZipParseOptions } from "@archive/extract";
11
- export type { ZipEntryInfo } from "@archive/zip-entry-info";
8
+ export type { ArchiveSource } from "@archive/io/archive-source";
9
+ export type { ArchiveSink } from "@archive/io/archive-sink";
10
+ export { zip, ZipArchive, type ZipOptions, type ZipEntryOptions } from "@archive/zip";
11
+ export { unzip, ZipReader, UnzipEntry, type UnzipOptions } from "@archive/unzip";
@@ -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";
@@ -5,7 +5,6 @@
5
5
  * browser-specific implementations so we can enforce export-surface parity.
6
6
  */
7
7
  export * from "@archive/index.base";
8
- export { crc32, crc32Update, crc32Finalize } from "@archive/crc32.browser";
9
- export { compress, compressSync, decompress, decompressSync, hasCompressionStream, type CompressOptions } from "@archive/compress.browser";
10
- export { createDeflateStream, createInflateStream, hasDeflateRaw, type StreamCompressOptions } from "@archive/streaming-compress.browser";
11
- export { Parse, createParse, type ParseOptions, type ZipEntry as StreamZipEntry } from "@archive/parse.browser";
8
+ export { crc32, crc32Update, crc32Finalize } from "@archive/compression/crc32.browser";
9
+ export { compress, compressSync, decompress, decompressSync, hasCompressionStream, type CompressOptions } from "@archive/compression/compress.browser";
10
+ export { createDeflateStream, createInflateStream, hasDeflateRaw, type StreamCompressOptions } from "@archive/compression/streaming-compress.browser";
@@ -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";
@@ -5,7 +5,6 @@
5
5
  * It groups all ZIP creation and extraction utilities in one place.
6
6
  */
7
7
  export * from "@archive/index.base";
8
- export { crc32, crc32Update, crc32Finalize } from "@archive/crc32";
9
- export { compress, compressSync, decompress, decompressSync, hasCompressionStream, type CompressOptions } from "@archive/compress";
10
- export { createDeflateStream, createInflateStream, hasDeflateRaw, type StreamCompressOptions } from "@archive/streaming-compress";
11
- export { Parse, createParse, type ParseOptions, type ZipEntry as StreamZipEntry } from "@archive/parse";
8
+ export { crc32, crc32Update, crc32Finalize } from "@archive/compression/crc32";
9
+ export { compress, compressSync, decompress, decompressSync, hasCompressionStream, type CompressOptions } from "@archive/compression/compress";
10
+ export { createDeflateStream, createInflateStream, hasDeflateRaw, type StreamCompressOptions } from "@archive/compression/streaming-compress";
@@ -6,10 +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 (Node.js; browser build aliases to ./parse.browser.ts)
15
- export { Parse, createParse } from "./parse.browser.js";
13
+ export { createDeflateStream, createInflateStream, hasDeflateRaw } from "./compression/streaming-compress.browser.js";
@@ -0,0 +1,33 @@
1
+ export declare class ByteQueue {
2
+ private static readonly EMPTY;
3
+ private _chunks;
4
+ private _headOffset;
5
+ private _length;
6
+ private _cachedView;
7
+ private _cachedLength;
8
+ constructor(initial?: Uint8Array);
9
+ get length(): number;
10
+ isEmpty(): boolean;
11
+ view(): Uint8Array;
12
+ reset(data?: Uint8Array): void;
13
+ append(chunk: Uint8Array): void;
14
+ read(length: number): Uint8Array;
15
+ /**
16
+ * Return a list of chunk views totaling `length` bytes without consuming.
17
+ *
18
+ * This avoids materializing a contiguous buffer for streaming write paths.
19
+ */
20
+ peekChunks(length: number): Uint8Array[];
21
+ discard(length: number): void;
22
+ /**
23
+ * Find the first index of `pattern` within the queue.
24
+ *
25
+ * This avoids materializing a contiguous `view()` for common small patterns
26
+ * (ZIP signatures are typically 2-4 bytes).
27
+ */
28
+ indexOfPattern(pattern: Uint8Array, startIndex?: number): number;
29
+ /** Peek a little-endian uint32 at `offset` without consuming bytes. Returns null if not enough bytes. */
30
+ peekUint32LE(offset: number): number | null;
31
+ /** Peek a single byte at `offset` without consuming bytes. */
32
+ peekByte(offset: number): number;
33
+ }