@cj-tech-master/excelts 4.2.0 → 4.2.1-canary.20260112134913.a3cecdd

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 (317) 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 +8 -0
  29. package/dist/browser/modules/archive/io/archive-sink.js +45 -0
  30. package/dist/browser/modules/archive/io/archive-source.d.ts +6 -0
  31. package/dist/browser/modules/archive/io/archive-source.js +100 -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/utils/ooxml-validator.d.ts +48 -0
  69. package/dist/browser/modules/excel/utils/ooxml-validator.js +469 -0
  70. package/dist/browser/modules/excel/worksheet.js +5 -2
  71. package/dist/browser/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.d.ts +1 -0
  72. package/dist/browser/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
  73. package/dist/browser/modules/excel/xlsx/xform/drawing/sp-xform.d.ts +18 -0
  74. package/dist/browser/modules/excel/xlsx/xform/drawing/sp-xform.js +112 -0
  75. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +6 -1
  76. package/dist/browser/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
  77. package/dist/browser/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
  78. package/dist/browser/modules/excel/xlsx/xform/sheet/page-setup-xform.d.ts +1 -0
  79. package/dist/browser/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
  80. package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +117 -5
  81. package/dist/browser/modules/excel/xlsx/xlsx.browser.js +3 -6
  82. package/dist/browser/modules/excel/xlsx/xlsx.js +1 -1
  83. package/dist/browser/modules/stream/base-transform.d.ts +3 -0
  84. package/dist/browser/modules/stream/base-transform.js +34 -20
  85. package/dist/browser/modules/stream/buffered-stream.d.ts +2 -12
  86. package/dist/browser/modules/stream/chunked-builder.js +4 -4
  87. package/dist/browser/modules/stream/index.browser.d.ts +13 -19
  88. package/dist/browser/modules/stream/index.browser.js +10 -22
  89. package/dist/browser/modules/stream/index.d.ts +18 -41
  90. package/dist/browser/modules/stream/index.js +15 -44
  91. package/dist/browser/modules/stream/internal/event-utils.d.ts +17 -0
  92. package/dist/browser/modules/stream/internal/event-utils.js +40 -0
  93. package/dist/browser/modules/stream/internal/type-guards.d.ts +9 -0
  94. package/dist/browser/modules/stream/internal/type-guards.js +24 -0
  95. package/dist/browser/modules/stream/pull-stream.d.ts +5 -6
  96. package/dist/browser/modules/stream/pull-stream.js +107 -43
  97. package/dist/browser/modules/stream/shared.d.ts +1 -1
  98. package/dist/browser/modules/stream/shared.js +7 -4
  99. package/dist/browser/modules/stream/streams.browser.d.ts +32 -42
  100. package/dist/browser/modules/stream/streams.browser.js +941 -823
  101. package/dist/browser/modules/stream/streams.d.ts +4 -20
  102. package/dist/browser/modules/stream/streams.js +146 -95
  103. package/dist/browser/modules/stream/utils.js +5 -38
  104. package/dist/cjs/modules/archive/{compress.base.js → compression/compress.base.js} +2 -1
  105. package/dist/cjs/modules/archive/{compress.browser.js → compression/compress.browser.js} +18 -19
  106. package/dist/cjs/modules/archive/{compress.js → compression/compress.js} +1 -1
  107. package/dist/cjs/modules/archive/{crc32.js → compression/crc32.js} +1 -1
  108. package/dist/cjs/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
  109. package/dist/cjs/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
  110. package/dist/cjs/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
  111. package/dist/cjs/modules/archive/defaults.js +7 -4
  112. package/dist/cjs/modules/archive/index.base.js +9 -19
  113. package/dist/cjs/modules/archive/index.browser.js +4 -10
  114. package/dist/cjs/modules/archive/index.js +4 -8
  115. package/dist/cjs/modules/archive/internal/byte-queue.js +411 -0
  116. package/dist/cjs/modules/archive/io/archive-sink.js +49 -0
  117. package/dist/cjs/modules/archive/io/archive-source.js +105 -0
  118. package/dist/cjs/modules/archive/unzip/index.js +170 -0
  119. package/dist/cjs/modules/archive/unzip/stream.base.js +1044 -0
  120. package/dist/cjs/modules/archive/{parse.browser.js → unzip/stream.browser.js} +377 -111
  121. package/dist/cjs/modules/archive/{parse.js → unzip/stream.js} +9 -8
  122. package/dist/cjs/modules/archive/{zip-parser.js → unzip/zip-parser.js} +47 -33
  123. package/dist/cjs/modules/archive/utils/async-queue.js +106 -0
  124. package/dist/cjs/modules/archive/utils/bytes.js +16 -16
  125. package/dist/cjs/modules/archive/utils/compressibility.js +60 -0
  126. package/dist/cjs/modules/archive/utils/parse-buffer.js +21 -23
  127. package/dist/cjs/modules/archive/utils/pattern-scanner.js +31 -0
  128. package/dist/cjs/modules/archive/utils/timestamps.js +64 -3
  129. package/dist/cjs/modules/archive/utils/zip-extra-fields.js +26 -14
  130. package/dist/cjs/modules/archive/zip/index.js +162 -0
  131. package/dist/cjs/modules/archive/{streaming-zip.js → zip/stream.js} +194 -50
  132. package/dist/cjs/modules/archive/zip/zip-bytes.js +242 -0
  133. package/dist/cjs/modules/archive/{zip-entry-metadata.js → zip/zip-entry-metadata.js} +5 -5
  134. package/dist/cjs/modules/archive/zip-spec/zip-records.js +136 -0
  135. package/dist/cjs/modules/excel/form-control.js +54 -16
  136. package/dist/cjs/modules/excel/stream/workbook-reader.browser.js +2 -2
  137. package/dist/cjs/modules/excel/stream/workbook-writer.browser.js +4 -4
  138. package/dist/cjs/modules/excel/utils/ooxml-validator.js +475 -0
  139. package/dist/cjs/modules/excel/worksheet.js +5 -2
  140. package/dist/cjs/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
  141. package/dist/cjs/modules/excel/xlsx/xform/drawing/sp-xform.js +115 -0
  142. package/dist/cjs/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
  143. package/dist/cjs/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
  144. package/dist/cjs/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
  145. package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +117 -5
  146. package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +6 -9
  147. package/dist/cjs/modules/excel/xlsx/xlsx.js +2 -2
  148. package/dist/cjs/modules/stream/base-transform.js +34 -20
  149. package/dist/cjs/modules/stream/chunked-builder.js +4 -4
  150. package/dist/cjs/modules/stream/index.browser.js +10 -17
  151. package/dist/cjs/modules/stream/index.js +15 -39
  152. package/dist/cjs/modules/stream/internal/event-utils.js +43 -0
  153. package/dist/cjs/modules/stream/internal/type-guards.js +30 -0
  154. package/dist/cjs/modules/stream/pull-stream.js +107 -43
  155. package/dist/cjs/modules/stream/shared.js +7 -4
  156. package/dist/cjs/modules/stream/streams.browser.js +947 -834
  157. package/dist/cjs/modules/stream/streams.js +156 -107
  158. package/dist/cjs/modules/stream/utils.js +3 -36
  159. package/dist/esm/index.browser.js +12 -0
  160. package/dist/esm/modules/archive/{compress.base.js → compression/compress.base.js} +2 -1
  161. package/dist/{browser/modules/archive → esm/modules/archive/compression}/compress.browser.js +18 -19
  162. package/dist/esm/modules/archive/{compress.js → compression/compress.js} +1 -1
  163. package/dist/esm/modules/archive/{crc32.js → compression/crc32.js} +1 -1
  164. package/dist/esm/modules/archive/{deflate-fallback.js → compression/deflate-fallback.js} +1 -1
  165. package/dist/esm/modules/archive/{streaming-compress.browser.js → compression/streaming-compress.browser.js} +3 -3
  166. package/dist/esm/modules/archive/{streaming-compress.js → compression/streaming-compress.js} +2 -2
  167. package/dist/esm/modules/archive/defaults.js +6 -3
  168. package/dist/esm/modules/archive/index.base.js +3 -6
  169. package/dist/esm/modules/archive/index.browser.js +3 -7
  170. package/dist/esm/modules/archive/index.js +3 -5
  171. package/dist/esm/modules/archive/internal/byte-queue.js +407 -0
  172. package/dist/esm/modules/archive/io/archive-sink.js +45 -0
  173. package/dist/esm/modules/archive/io/archive-source.js +100 -0
  174. package/dist/esm/modules/archive/unzip/index.js +164 -0
  175. package/dist/esm/modules/archive/unzip/stream.base.js +1022 -0
  176. package/dist/esm/modules/archive/{parse.browser.js → unzip/stream.browser.js} +376 -110
  177. package/dist/{browser/modules/archive/parse.js → esm/modules/archive/unzip/stream.js} +7 -6
  178. package/dist/{browser/modules/archive → esm/modules/archive/unzip}/zip-parser.js +38 -24
  179. package/dist/esm/modules/archive/utils/async-queue.js +103 -0
  180. package/dist/esm/modules/archive/utils/bytes.js +16 -16
  181. package/dist/esm/modules/archive/utils/compressibility.js +57 -0
  182. package/dist/esm/modules/archive/utils/parse-buffer.js +21 -23
  183. package/dist/esm/modules/archive/utils/pattern-scanner.js +27 -0
  184. package/dist/esm/modules/archive/utils/timestamps.js +62 -1
  185. package/dist/esm/modules/archive/utils/zip-extra-fields.js +26 -14
  186. package/dist/esm/modules/archive/zip/index.js +157 -0
  187. package/dist/esm/modules/archive/{streaming-zip.js → zip/stream.js} +192 -48
  188. package/dist/esm/modules/archive/zip/zip-bytes.js +239 -0
  189. package/dist/{browser/modules/archive → esm/modules/archive/zip}/zip-entry-metadata.js +3 -3
  190. package/dist/esm/modules/archive/zip-spec/zip-records.js +126 -0
  191. package/dist/esm/modules/excel/form-control.js +54 -16
  192. package/dist/esm/modules/excel/stream/workbook-reader.browser.js +1 -1
  193. package/dist/esm/modules/excel/stream/workbook-writer.browser.js +1 -1
  194. package/dist/esm/modules/excel/utils/ooxml-validator.js +469 -0
  195. package/dist/esm/modules/excel/worksheet.js +5 -2
  196. package/dist/esm/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.js +13 -1
  197. package/dist/esm/modules/excel/xlsx/xform/drawing/sp-xform.js +112 -0
  198. package/dist/esm/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.js +30 -2
  199. package/dist/esm/modules/excel/xlsx/xform/drawing/vml-drawing-xform.js +11 -0
  200. package/dist/esm/modules/excel/xlsx/xform/sheet/page-setup-xform.js +16 -2
  201. package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +117 -5
  202. package/dist/esm/modules/excel/xlsx/xlsx.browser.js +3 -6
  203. package/dist/esm/modules/excel/xlsx/xlsx.js +1 -1
  204. package/dist/esm/modules/stream/base-transform.js +34 -20
  205. package/dist/esm/modules/stream/chunked-builder.js +4 -4
  206. package/dist/esm/modules/stream/index.browser.js +10 -22
  207. package/dist/esm/modules/stream/index.js +15 -44
  208. package/dist/esm/modules/stream/internal/event-utils.js +40 -0
  209. package/dist/esm/modules/stream/internal/type-guards.js +24 -0
  210. package/dist/esm/modules/stream/pull-stream.js +107 -43
  211. package/dist/esm/modules/stream/shared.js +7 -4
  212. package/dist/esm/modules/stream/streams.browser.js +941 -823
  213. package/dist/esm/modules/stream/streams.js +146 -95
  214. package/dist/esm/modules/stream/utils.js +5 -38
  215. package/dist/iife/THIRD_PARTY_NOTICES.md +81 -0
  216. package/dist/iife/excelts.iife.js +4979 -2800
  217. package/dist/iife/excelts.iife.js.map +1 -1
  218. package/dist/iife/excelts.iife.min.js +103 -31
  219. package/dist/types/index.browser.d.ts +1 -0
  220. package/dist/{browser/modules/archive → types/modules/archive/compression}/compress.base.d.ts +1 -0
  221. package/dist/{browser/modules/archive → types/modules/archive/compression}/compress.browser.d.ts +10 -8
  222. package/dist/types/modules/archive/{streaming-compress.browser.d.ts → compression/streaming-compress.browser.d.ts} +1 -1
  223. package/dist/types/modules/archive/defaults.d.ts +1 -0
  224. package/dist/types/modules/archive/index.base.d.ts +4 -4
  225. package/dist/types/modules/archive/index.browser.d.ts +3 -4
  226. package/dist/types/modules/archive/index.d.ts +3 -4
  227. package/dist/types/modules/archive/internal/byte-queue.d.ts +33 -0
  228. package/dist/types/modules/archive/io/archive-sink.d.ts +8 -0
  229. package/dist/types/modules/archive/io/archive-source.d.ts +6 -0
  230. package/dist/types/modules/archive/unzip/index.d.ts +40 -0
  231. package/dist/types/modules/archive/{parse.base.d.ts → unzip/stream.base.d.ts} +60 -5
  232. package/dist/types/modules/archive/{parse.browser.d.ts → unzip/stream.browser.d.ts} +2 -2
  233. package/dist/types/modules/archive/{parse.d.ts → unzip/stream.d.ts} +3 -3
  234. package/dist/{browser/modules/archive → types/modules/archive/unzip}/zip-parser.d.ts +1 -1
  235. package/dist/types/modules/archive/utils/async-queue.d.ts +7 -0
  236. package/dist/types/modules/archive/utils/compressibility.d.ts +10 -0
  237. package/dist/types/modules/archive/utils/pattern-scanner.d.ts +21 -0
  238. package/dist/types/modules/archive/utils/zip-extra-fields.d.ts +1 -1
  239. package/dist/types/modules/archive/zip/index.d.ts +42 -0
  240. package/dist/types/modules/archive/{streaming-zip.d.ts → zip/stream.d.ts} +29 -6
  241. package/dist/types/modules/archive/zip/zip-bytes.d.ts +73 -0
  242. package/dist/types/modules/archive/{zip-entry-metadata.d.ts → zip/zip-entry-metadata.d.ts} +1 -1
  243. package/dist/types/modules/archive/{zip-records.d.ts → zip-spec/zip-records.d.ts} +20 -0
  244. package/dist/types/modules/excel/form-control.d.ts +2 -0
  245. package/dist/types/modules/excel/stream/workbook-writer.browser.d.ts +1 -1
  246. package/dist/types/modules/excel/utils/ooxml-validator.d.ts +48 -0
  247. package/dist/types/modules/excel/xlsx/xform/drawing/ctrl-prop-xform.d.ts +1 -0
  248. package/dist/types/modules/excel/xlsx/xform/drawing/sp-xform.d.ts +18 -0
  249. package/dist/types/modules/excel/xlsx/xform/drawing/two-cell-anchor-xform.d.ts +6 -1
  250. package/dist/types/modules/excel/xlsx/xform/sheet/page-setup-xform.d.ts +1 -0
  251. package/dist/types/modules/stream/base-transform.d.ts +3 -0
  252. package/dist/types/modules/stream/buffered-stream.d.ts +2 -12
  253. package/dist/types/modules/stream/index.browser.d.ts +13 -19
  254. package/dist/types/modules/stream/index.d.ts +18 -41
  255. package/dist/types/modules/stream/internal/event-utils.d.ts +17 -0
  256. package/dist/types/modules/stream/internal/type-guards.d.ts +9 -0
  257. package/dist/types/modules/stream/pull-stream.d.ts +5 -6
  258. package/dist/types/modules/stream/shared.d.ts +1 -1
  259. package/dist/types/modules/stream/streams.browser.d.ts +32 -42
  260. package/dist/types/modules/stream/streams.d.ts +4 -20
  261. package/package.json +19 -15
  262. package/dist/browser/modules/archive/byte-queue.d.ts +0 -18
  263. package/dist/browser/modules/archive/byte-queue.js +0 -125
  264. package/dist/browser/modules/archive/parse.base.js +0 -610
  265. package/dist/browser/modules/archive/utils/zip-extra.d.ts +0 -18
  266. package/dist/browser/modules/archive/utils/zip-extra.js +0 -68
  267. package/dist/browser/modules/archive/zip-builder.d.ts +0 -117
  268. package/dist/browser/modules/archive/zip-builder.js +0 -292
  269. package/dist/browser/modules/archive/zip-constants.d.ts +0 -18
  270. package/dist/browser/modules/archive/zip-constants.js +0 -23
  271. package/dist/browser/modules/archive/zip-records.js +0 -84
  272. package/dist/cjs/modules/archive/byte-queue.js +0 -129
  273. package/dist/cjs/modules/archive/parse.base.js +0 -632
  274. package/dist/cjs/modules/archive/utils/zip-extra.js +0 -74
  275. package/dist/cjs/modules/archive/zip-builder.js +0 -297
  276. package/dist/cjs/modules/archive/zip-constants.js +0 -26
  277. package/dist/cjs/modules/archive/zip-records.js +0 -90
  278. package/dist/esm/modules/archive/byte-queue.js +0 -125
  279. package/dist/esm/modules/archive/parse.base.js +0 -610
  280. package/dist/esm/modules/archive/utils/zip-extra.js +0 -68
  281. package/dist/esm/modules/archive/zip-builder.js +0 -292
  282. package/dist/esm/modules/archive/zip-constants.js +0 -23
  283. package/dist/esm/modules/archive/zip-records.js +0 -84
  284. package/dist/types/modules/archive/byte-queue.d.ts +0 -18
  285. package/dist/types/modules/archive/utils/zip-extra.d.ts +0 -18
  286. package/dist/types/modules/archive/zip-builder.d.ts +0 -117
  287. package/dist/types/modules/archive/zip-constants.d.ts +0 -18
  288. /package/dist/browser/modules/archive/{crc32.base.d.ts → compression/crc32.base.d.ts} +0 -0
  289. /package/dist/browser/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
  290. /package/dist/browser/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
  291. /package/dist/browser/modules/archive/{deflate-fallback.d.ts → compression/deflate-fallback.d.ts} +0 -0
  292. /package/dist/browser/modules/archive/{streaming-compress.base.d.ts → compression/streaming-compress.base.d.ts} +0 -0
  293. /package/dist/browser/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
  294. /package/dist/browser/modules/archive/{extract.js → unzip/extract.js} +0 -0
  295. /package/dist/browser/modules/archive/{zip-entry-metadata.d.ts → zip/zip-entry-metadata.d.ts} +0 -0
  296. /package/dist/browser/modules/archive/{zip-entry-info.d.ts → zip-spec/zip-entry-info.d.ts} +0 -0
  297. /package/dist/browser/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
  298. /package/dist/cjs/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
  299. /package/dist/cjs/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
  300. /package/dist/cjs/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
  301. /package/dist/cjs/modules/archive/{extract.js → unzip/extract.js} +0 -0
  302. /package/dist/cjs/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
  303. /package/dist/esm/modules/archive/{crc32.base.js → compression/crc32.base.js} +0 -0
  304. /package/dist/esm/modules/archive/{crc32.browser.js → compression/crc32.browser.js} +0 -0
  305. /package/dist/esm/modules/archive/{streaming-compress.base.js → compression/streaming-compress.base.js} +0 -0
  306. /package/dist/esm/modules/archive/{extract.js → unzip/extract.js} +0 -0
  307. /package/dist/esm/modules/archive/{zip-entry-info.js → zip-spec/zip-entry-info.js} +0 -0
  308. /package/dist/{LICENSE → iife/LICENSE} +0 -0
  309. /package/dist/types/modules/archive/{compress.d.ts → compression/compress.d.ts} +0 -0
  310. /package/dist/types/modules/archive/{crc32.base.d.ts → compression/crc32.base.d.ts} +0 -0
  311. /package/dist/types/modules/archive/{crc32.browser.d.ts → compression/crc32.browser.d.ts} +0 -0
  312. /package/dist/types/modules/archive/{crc32.d.ts → compression/crc32.d.ts} +0 -0
  313. /package/dist/types/modules/archive/{deflate-fallback.d.ts → compression/deflate-fallback.d.ts} +0 -0
  314. /package/dist/types/modules/archive/{streaming-compress.base.d.ts → compression/streaming-compress.base.d.ts} +0 -0
  315. /package/dist/types/modules/archive/{streaming-compress.d.ts → compression/streaming-compress.d.ts} +0 -0
  316. /package/dist/types/modules/archive/{extract.d.ts → unzip/extract.d.ts} +0 -0
  317. /package/dist/types/modules/archive/{zip-entry-info.d.ts → zip-spec/zip-entry-info.d.ts} +0 -0
@@ -5,8 +5,9 @@
5
5
  * Provides Readable, Writable, Transform, Duplex, and PassThrough streams.
6
6
  */
7
7
  import { Readable, Writable as NodeWritable, Transform, Duplex, PassThrough, pipeline as nodePipeline, finished as nodeFinished } from "stream";
8
- import { BufferedStream as StandaloneBufferedStream, StringChunk as StandaloneStringChunk, BufferChunk as StandaloneBufferChunk } from "./buffered-stream.js";
9
- import { PullStream as StandalonePullStream } from "./pull-stream.js";
8
+ import { BufferedStream, BufferChunk, StringChunk } from "./buffered-stream.js";
9
+ import { PullStream } from "./pull-stream.js";
10
+ import { isAsyncIterable, isReadableStream, isTransformStream, isWritableStream } from "./internal/type-guards.js";
10
11
  /**
11
12
  * Unified Writable class - wraps Node.js Writable with browser-compatible API
12
13
  *
@@ -16,20 +17,34 @@ export class Writable extends NodeWritable {
16
17
  constructor(options) {
17
18
  // If wrapping an existing stream, proxy to it
18
19
  if (options?.stream) {
20
+ const underlying = options.stream;
19
21
  // Create a pass-through wrapper that proxies to the underlying stream
20
22
  super({
21
23
  highWaterMark: options?.highWaterMark,
22
24
  objectMode: options?.objectMode,
23
25
  write(chunk, encoding, callback) {
24
- options.stream.write(chunk, encoding, callback);
26
+ underlying.write(chunk, encoding, callback);
25
27
  },
26
28
  final(callback) {
27
- options.stream.end(callback);
29
+ underlying.end(callback);
28
30
  }
29
31
  });
30
- // Proxy events from underlying stream
31
- options.stream.on("error", err => this.emit("error", err));
32
- options.stream.on("close", () => this.emit("close"));
32
+ // Proxy events from underlying stream, but ensure we clean up listeners so
33
+ // the underlying stream cannot retain this wrapper longer than necessary.
34
+ const onUnderlyingError = (err) => {
35
+ this.emit("error", err);
36
+ };
37
+ const onUnderlyingClose = () => {
38
+ this.emit("close");
39
+ };
40
+ const cleanup = () => {
41
+ underlying.off("error", onUnderlyingError);
42
+ underlying.off("close", onUnderlyingClose);
43
+ };
44
+ underlying.on("error", onUnderlyingError);
45
+ underlying.on("close", onUnderlyingClose);
46
+ this.once("close", cleanup);
47
+ this.once("finish", cleanup);
33
48
  }
34
49
  else {
35
50
  super({
@@ -45,6 +60,8 @@ export class Writable extends NodeWritable {
45
60
  // Re-export native classes with our interfaces
46
61
  // =============================================================================
47
62
  export { Readable, Transform, Duplex, PassThrough };
63
+ // Standalone cross-platform helpers
64
+ export { PullStream, BufferedStream, StringChunk, BufferChunk };
48
65
  // =============================================================================
49
66
  // Cross-environment stream normalization
50
67
  // =============================================================================
@@ -57,43 +74,25 @@ export function normalizeWritable(stream) {
57
74
  if (stream instanceof Writable) {
58
75
  return stream;
59
76
  }
60
- // Node.js Writable: accept structurally even if typed as unknown.
77
+ // Node.js Writable: already compatible, avoid extra wrapper allocation.
61
78
  if (stream instanceof NodeWritable) {
62
- return new Writable({ stream: stream });
79
+ return stream;
63
80
  }
64
81
  // Web WritableStream: detect by getWriter() (avoid relying on global WritableStream).
65
82
  if (stream?.getWriter) {
66
- const nodeWritable = NodeWritable.fromWeb(stream);
67
- return new Writable({ stream: nodeWritable });
83
+ return NodeWritable.fromWeb(stream);
68
84
  }
69
- // Assume it structurally matches Node's Writable; wrap for consistent API.
70
- return new Writable({ stream: stream });
85
+ // Assume it structurally matches Node's Writable.
86
+ return stream;
71
87
  }
72
88
  // Import for internal use
73
89
  import { textDecoder } from "./shared.js";
74
- const isReadableStream = (value) => !!value && typeof value === "object" && typeof value.getReader === "function";
75
- const isAsyncIterable = (value) => {
76
- if (!value || (typeof value !== "object" && typeof value !== "function")) {
77
- return false;
78
- }
79
- return typeof value[Symbol.asyncIterator] === "function";
80
- };
81
- const isWritableStream = (value) => !!value && typeof value === "object" && typeof value.getWriter === "function";
82
- const isTransformStream = (value) => !!value &&
83
- typeof value === "object" &&
84
- !!value.readable &&
85
- !!value.writable &&
86
- isReadableStream(value.readable) &&
87
- isWritableStream(value.writable);
88
90
  const isPipelineOptions = (value) => {
89
91
  if (!value || typeof value !== "object") {
90
92
  return false;
91
93
  }
92
- // IMPORTANT:
93
- // Do NOT use `"end" in obj` here because streams have `.end()` and would be
94
- // misclassified as options, breaking argument parsing and potentially hanging.
94
+ // Avoid treating streams as options objects.
95
95
  if (typeof value.pipe === "function" ||
96
- typeof value.write === "function" ||
97
96
  typeof value.end === "function" ||
98
97
  typeof value.getReader === "function" ||
99
98
  typeof value.getWriter === "function") {
@@ -180,12 +179,13 @@ export function finished(stream, optionsOrCallback, callback) {
180
179
  const promise = new Promise((resolve, reject) => {
181
180
  const normalizedStream = toNodePipelineStream(stream);
182
181
  nodeFinished(normalizedStream, options, (err) => {
183
- if (err && !(options && options.error)) {
182
+ // Node.js semantics: options.error defaults to true (report errors).
183
+ // If options.error === false, ignore errors and resolve.
184
+ if (err && options?.error !== false) {
184
185
  reject(err);
186
+ return;
185
187
  }
186
- else {
187
- resolve();
188
- }
188
+ resolve();
189
189
  });
190
190
  });
191
191
  if (cb) {
@@ -411,8 +411,6 @@ export function createCollector(options) {
411
411
  // =============================================================================
412
412
  // Pull Stream - Read data on demand with pattern matching
413
413
  // =============================================================================
414
- export class PullStream extends StandalonePullStream {
415
- }
416
414
  /**
417
415
  * Create a pull stream
418
416
  */
@@ -422,21 +420,6 @@ export function createPullStream(options) {
422
420
  // =============================================================================
423
421
  // Buffered Stream - Efficient chunk management
424
422
  // =============================================================================
425
- /**
426
- * String chunk implementation
427
- */
428
- export class StringChunk extends StandaloneStringChunk {
429
- }
430
- /**
431
- * Buffer chunk implementation
432
- */
433
- export class BufferChunk extends StandaloneBufferChunk {
434
- }
435
- /**
436
- * Buffered stream with efficient chunk management
437
- */
438
- export class BufferedStream extends StandaloneBufferedStream {
439
- }
440
423
  /**
441
424
  * Create a buffered stream
442
425
  */
@@ -533,13 +516,28 @@ export function addAbortSignal(signal, stream) {
533
516
  stream.destroy(new Error("Aborted"));
534
517
  return stream;
535
518
  }
519
+ const cleanup = () => {
520
+ signal.removeEventListener("abort", onAbort);
521
+ stream.off?.("close", onDone);
522
+ stream.off?.("end", onDone);
523
+ stream.off?.("finish", onDone);
524
+ stream.off?.("error", onError);
525
+ };
536
526
  const onAbort = () => {
527
+ cleanup();
537
528
  stream.destroy(new Error("Aborted"));
538
529
  };
530
+ const onDone = () => {
531
+ cleanup();
532
+ };
533
+ const onError = () => {
534
+ cleanup();
535
+ };
539
536
  signal.addEventListener("abort", onAbort, { once: true });
540
- stream.on("close", () => {
541
- signal.removeEventListener("abort", onAbort);
542
- });
537
+ stream.once?.("close", onDone);
538
+ stream.once?.("end", onDone);
539
+ stream.once?.("finish", onDone);
540
+ stream.once?.("error", onError);
543
541
  return stream;
544
542
  }
545
543
  /**
@@ -582,56 +580,109 @@ export function compose(...transforms) {
582
580
  if (len === 1 && isNativeTransform(transforms[0])) {
583
581
  return transforms[0];
584
582
  }
585
- // Chain all transforms together
583
+ // Chain all transforms together once.
586
584
  for (let i = 0; i < len - 1; i++) {
587
585
  transforms[i].pipe(transforms[i + 1]);
588
586
  }
589
- // Create a Duplex that writes to first and reads from last
590
587
  const first = transforms[0];
591
588
  const last = transforms[len - 1];
592
- // Create a PassThrough as the composed stream
593
- const composed = new PassThrough({ objectMode: first.readableObjectMode });
594
- // Store original methods for forwarding
595
- const passthroughWrite = composed.write.bind(composed);
596
- const passthroughEnd = composed.end.bind(composed);
597
- // Override write to write to first transform
598
- composed.write = function (chunk, encodingOrCallback, callback) {
599
- if (typeof encodingOrCallback === "function") {
600
- return first.write(chunk, encodingOrCallback);
601
- }
602
- return first.write(chunk, encodingOrCallback, callback);
603
- };
604
- // Override end to end first transform
605
- composed.end = function (chunkOrCallback, encodingOrCallback, callback) {
606
- if (typeof chunkOrCallback === "function") {
607
- first.end(chunkOrCallback);
589
+ // Use a private output stream so we don't have to monkey-patch `write()` on the
590
+ // public composed stream (which would break piping into it).
591
+ const output = new PassThrough({ objectMode: last.readableObjectMode ?? true });
592
+ last.pipe(output);
593
+ let outputEnded = false;
594
+ const pumpOutput = (target) => {
595
+ if (outputEnded) {
596
+ return;
608
597
  }
609
- else if (typeof encodingOrCallback === "function") {
610
- first.end(chunkOrCallback, encodingOrCallback);
598
+ while (true) {
599
+ const chunk = output.read();
600
+ if (chunk === null) {
601
+ break;
602
+ }
603
+ if (!target.push(chunk)) {
604
+ break;
605
+ }
611
606
  }
612
- else {
613
- first.end(chunkOrCallback, encodingOrCallback, callback);
607
+ };
608
+ const composed = new Transform({
609
+ readableObjectMode: last.readableObjectMode,
610
+ writableObjectMode: first.writableObjectMode,
611
+ transform(chunk, encoding, callback) {
612
+ try {
613
+ // Forward writes into the head of the chain.
614
+ first.write(chunk, encoding, callback);
615
+ }
616
+ catch (err) {
617
+ callback(err);
618
+ }
619
+ },
620
+ flush(callback) {
621
+ // End the head of the chain; readable completion is driven by `output` ending.
622
+ const onFinish = () => {
623
+ cleanupFlush();
624
+ callback();
625
+ };
626
+ const onError = (err) => {
627
+ cleanupFlush();
628
+ callback(err);
629
+ };
630
+ const cleanupFlush = () => {
631
+ first.off?.("finish", onFinish);
632
+ first.off?.("error", onError);
633
+ };
634
+ first.once?.("finish", onFinish);
635
+ first.once?.("error", onError);
636
+ first.end();
637
+ },
638
+ read() {
639
+ pumpOutput(this);
640
+ },
641
+ destroy(err, callback) {
642
+ try {
643
+ output.destroy(err ?? undefined);
644
+ for (const t of transforms) {
645
+ t.destroy?.(err ?? undefined);
646
+ }
647
+ }
648
+ finally {
649
+ callback(err);
650
+ }
614
651
  }
615
- return composed;
652
+ });
653
+ const onOutputReadable = () => {
654
+ pumpOutput(composed);
616
655
  };
617
- // Override pipe to pipe from last transform
618
- composed.pipe = function (dest) {
619
- return last.pipe(dest);
656
+ const onOutputEnd = () => {
657
+ cleanupListeners();
658
+ outputEnded = true;
659
+ composed.push(null);
620
660
  };
621
- // Forward data from last to composed
622
- last.on("data", (chunk) => {
623
- passthroughWrite(chunk);
624
- });
625
- // Forward end from last
626
- last.on("end", () => {
627
- passthroughEnd();
661
+ const onAnyError = (err) => {
662
+ cleanupListeners();
663
+ composed.destroy(err);
664
+ };
665
+ const transformErrorListeners = [];
666
+ const cleanupListeners = () => {
667
+ output.off("readable", onOutputReadable);
668
+ output.off("end", onOutputEnd);
669
+ output.off("error", onAnyError);
670
+ for (const { t, fn } of transformErrorListeners) {
671
+ t.off?.("error", fn);
672
+ }
673
+ transformErrorListeners.length = 0;
674
+ };
675
+ output.on("readable", onOutputReadable);
676
+ output.once("end", onOutputEnd);
677
+ output.once("error", onAnyError);
678
+ for (const t of transforms) {
679
+ const tt = t;
680
+ tt.once?.("error", onAnyError);
681
+ transformErrorListeners.push({ t: tt, fn: onAnyError });
682
+ }
683
+ composed.once("close", () => {
684
+ cleanupListeners();
628
685
  });
629
- // Forward errors from any transform
630
- for (const transform of transforms) {
631
- transform.on("error", (err) => {
632
- composed.emit("error", err);
633
- });
634
- }
635
686
  return composed;
636
687
  }
637
688
  /**
@@ -712,7 +763,7 @@ export function once(emitter, event, options) {
712
763
  onAbort();
713
764
  return;
714
765
  }
715
- options.signal.addEventListener("abort", onAbort);
766
+ options.signal.addEventListener("abort", onAbort, { once: true });
716
767
  }
717
768
  });
718
769
  }
@@ -4,8 +4,8 @@
4
4
  * Small, cross-platform helpers built on top of the platform stream
5
5
  * implementation selected by `./streams` (Node.js or browser).
6
6
  */
7
- import { createReadableFromArray, createTransform } from "./streams.js";
8
- import { stringToUint8Array as _stringToUint8Array, uint8ArrayToString as _uint8ArrayToString } from "./shared.js";
7
+ import { consumers, createReadableFromArray, createTransform } from "./streams.js";
8
+ import { stringToUint8Array as _stringToUint8Array } from "./shared.js";
9
9
  // =============================================================================
10
10
  // High-Level Stream Consumers
11
11
  // =============================================================================
@@ -17,46 +17,13 @@ export async function collect(stream) {
17
17
  return result;
18
18
  }
19
19
  export async function text(stream) {
20
- const chunks = [];
21
- let totalLength = 0;
22
- for await (const chunk of stream) {
23
- chunks.push(chunk);
24
- totalLength += chunk.length;
25
- }
26
- if (chunks.length === 1) {
27
- return _uint8ArrayToString(chunks[0]);
28
- }
29
- const result = new Uint8Array(totalLength);
30
- let offset = 0;
31
- for (let i = 0, len = chunks.length; i < len; i++) {
32
- const c = chunks[i];
33
- result.set(c, offset);
34
- offset += c.length;
35
- }
36
- return _uint8ArrayToString(result);
20
+ return consumers.text(stream);
37
21
  }
38
22
  export async function json(stream) {
39
- const str = await text(stream);
40
- return JSON.parse(str);
23
+ return consumers.json(stream);
41
24
  }
42
25
  export async function bytes(stream) {
43
- const chunks = [];
44
- let totalLength = 0;
45
- for await (const chunk of stream) {
46
- chunks.push(chunk);
47
- totalLength += chunk.length;
48
- }
49
- if (chunks.length === 1) {
50
- return chunks[0];
51
- }
52
- const result = new Uint8Array(totalLength);
53
- let offset = 0;
54
- for (let i = 0, len = chunks.length; i < len; i++) {
55
- const c = chunks[i];
56
- result.set(c, offset);
57
- offset += c.length;
58
- }
59
- return result;
26
+ return consumers.buffer(stream);
60
27
  }
61
28
  // =============================================================================
62
29
  // Stream Factory Helpers
@@ -0,0 +1,81 @@
1
+ # Third-Party Notices
2
+
3
+ This project includes software developed by third parties. The following notices are provided for attribution and license compliance.
4
+
5
+ ---
6
+
7
+ ## Third-party component
8
+
9
+ ExcelJS is licensed under the MIT License:
10
+
11
+ The MIT License (MIT)
12
+
13
+ Copyright (c) 2014-2019 Guyon Roche
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+
33
+ ---
34
+
35
+ ## Third-party component
36
+
37
+ fast-csv is licensed under the MIT License:
38
+
39
+ The MIT License (MIT)
40
+
41
+ Copyright (c) 2011-2025 C2FO
42
+
43
+ Permission is hereby granted, free of charge, to any person obtaining a copy
44
+ of this software and associated documentation files (the "Software"), to deal
45
+ in the Software without restriction, including without limitation the rights
46
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
47
+ copies of the Software, and to permit persons to whom the Software is
48
+ furnished to do so, subject to the following conditions:
49
+
50
+ The above copyright notice and this permission notice shall be included in all
51
+ copies or substantial portions of the Software.
52
+
53
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
56
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
57
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
59
+ SOFTWARE.
60
+
61
+ ---
62
+
63
+ ## Third-party component
64
+
65
+ saxes is licensed under the ISC License:
66
+
67
+ The ISC License
68
+
69
+ Copyright (c) Contributors
70
+
71
+ Permission to use, copy, modify, and/or distribute this software for any
72
+ purpose with or without fee is hereby granted, provided that the above
73
+ copyright notice and this permission notice appear in all copies.
74
+
75
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
76
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
77
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
78
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
79
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
80
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
81
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.