@adviser/cement 0.0.0-jsr-t1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (320) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +39 -0
  3. package/base-sys-abstraction-BkEiLHl0.d.ts +193 -0
  4. package/base-sys-abstraction-Qj7pkY1N.d.cts +193 -0
  5. package/chunk-7KFVMTOS.js +311 -0
  6. package/chunk-7KFVMTOS.js.map +1 -0
  7. package/chunk-GES3MUGV.js +92 -0
  8. package/chunk-GES3MUGV.js.map +1 -0
  9. package/chunk-Q65HLCNL.js +601 -0
  10. package/chunk-Q65HLCNL.js.map +1 -0
  11. package/chunk-WMMUXBDX.js +87 -0
  12. package/chunk-WMMUXBDX.js.map +1 -0
  13. package/index-Q3phXzYr.d.cts +75 -0
  14. package/index-tIGZMHTc.d.ts +75 -0
  15. package/index.cjs +2593 -0
  16. package/index.cjs.map +1 -0
  17. package/index.d.cts +532 -0
  18. package/index.d.ts +532 -0
  19. package/index.js +1533 -0
  20. package/index.js.map +1 -0
  21. package/node/index.cjs +924 -0
  22. package/node/index.cjs.map +1 -0
  23. package/node/index.d.cts +65 -0
  24. package/node/index.d.ts +65 -0
  25. package/node/index.js +398 -0
  26. package/node/index.js.map +1 -0
  27. package/package.json +81 -0
  28. package/src/base-sys-abstraction.test.ts +95 -0
  29. package/src/base-sys-abstraction.ts +242 -0
  30. package/src/bin2text.test.ts +59 -0
  31. package/src/bin2text.ts +47 -0
  32. package/src/crypto.test.ts +15 -0
  33. package/src/crypto.ts +125 -0
  34. package/src/file-service.ts +24 -0
  35. package/src/future.test.ts +32 -0
  36. package/src/future.ts +27 -0
  37. package/src/index.ts +22 -0
  38. package/src/jsr.json +20 -0
  39. package/src/log-level-impl.ts +87 -0
  40. package/src/log-writer-impl.ts +58 -0
  41. package/src/logger-impl.ts +498 -0
  42. package/src/logger.test.ts +1132 -0
  43. package/src/logger.ts +208 -0
  44. package/src/node/deno-file-service.ts +92 -0
  45. package/src/node/deno-sys-abstraction.ts +133 -0
  46. package/src/node/index.ts +4 -0
  47. package/src/node/mock-file-service.ts +45 -0
  48. package/src/node/node-file-service.ts +91 -0
  49. package/src/node/node-sys-abstraction.ts +121 -0
  50. package/src/option.ts +60 -0
  51. package/src/resolve-once.test.ts +321 -0
  52. package/src/resolve-once.ts +179 -0
  53. package/src/result.test.ts +102 -0
  54. package/src/result.ts +165 -0
  55. package/src/runtime.ts +36 -0
  56. package/src/sys-abstraction.ts +53 -0
  57. package/src/sys-env.test.ts +53 -0
  58. package/src/sys-env.ts +216 -0
  59. package/src/test/log-write-stream.ts +95 -0
  60. package/src/test/mock-logger.ts +40 -0
  61. package/src/time.ts +20 -0
  62. package/src/tracer.test.ts +314 -0
  63. package/src/tracer.ts +222 -0
  64. package/src/txt-en-decoder.ts +21 -0
  65. package/src/uri.test.ts +155 -0
  66. package/src/uri.ts +421 -0
  67. package/src/utils/console-write-stream.ts +72 -0
  68. package/src/utils/fanout-write-stream.ts +32 -0
  69. package/src/utils/index.ts +6 -0
  70. package/src/utils/rebuffer.ts +75 -0
  71. package/src/utils/stream-map.ts +67 -0
  72. package/src/utils/stream2string.ts +47 -0
  73. package/src/utils/string2stream.ts +14 -0
  74. package/src/version.ts +3 -0
  75. package/src/web/index.ts +1 -0
  76. package/src/web/web-sys-abstraction.ts +80 -0
  77. package/ts/LICENSE +201 -0
  78. package/ts/README.md +39 -0
  79. package/ts/base-sys-abstraction.d.ts +84 -0
  80. package/ts/base-sys-abstraction.d.ts.map +1 -0
  81. package/ts/base-sys-abstraction.js +178 -0
  82. package/ts/base-sys-abstraction.js.map +1 -0
  83. package/ts/base-sys-abstraction.test.d.ts +2 -0
  84. package/ts/base-sys-abstraction.test.d.ts.map +1 -0
  85. package/ts/base-sys-abstraction.test.js +82 -0
  86. package/ts/base-sys-abstraction.test.js.map +1 -0
  87. package/ts/bin2text.d.ts +3 -0
  88. package/ts/bin2text.d.ts.map +1 -0
  89. package/ts/bin2text.js +43 -0
  90. package/ts/bin2text.js.map +1 -0
  91. package/ts/bin2text.test.d.ts +2 -0
  92. package/ts/bin2text.test.d.ts.map +1 -0
  93. package/ts/bin2text.test.js +51 -0
  94. package/ts/bin2text.test.js.map +1 -0
  95. package/ts/crypto.d.ts +76 -0
  96. package/ts/crypto.d.ts.map +1 -0
  97. package/ts/crypto.js +22 -0
  98. package/ts/crypto.js.map +1 -0
  99. package/ts/crypto.test.d.ts +2 -0
  100. package/ts/crypto.test.d.ts.map +1 -0
  101. package/ts/crypto.test.js +14 -0
  102. package/ts/crypto.test.js.map +1 -0
  103. package/ts/file-service.d.ts +17 -0
  104. package/ts/file-service.d.ts.map +1 -0
  105. package/ts/file-service.js +2 -0
  106. package/ts/file-service.js.map +1 -0
  107. package/ts/future.d.ts +8 -0
  108. package/ts/future.d.ts.map +1 -0
  109. package/ts/future.js +38 -0
  110. package/ts/future.js.map +1 -0
  111. package/ts/future.test.d.ts +2 -0
  112. package/ts/future.test.d.ts.map +1 -0
  113. package/ts/future.test.js +28 -0
  114. package/ts/future.test.js.map +1 -0
  115. package/ts/index.d.ts +23 -0
  116. package/ts/index.d.ts.map +1 -0
  117. package/ts/index.js +23 -0
  118. package/ts/index.js.map +1 -0
  119. package/ts/log-level-impl.d.ts +14 -0
  120. package/ts/log-level-impl.d.ts.map +1 -0
  121. package/ts/log-level-impl.js +72 -0
  122. package/ts/log-level-impl.js.map +1 -0
  123. package/ts/log-writer-impl.d.ts +10 -0
  124. package/ts/log-writer-impl.d.ts.map +1 -0
  125. package/ts/log-writer-impl.js +45 -0
  126. package/ts/log-writer-impl.js.map +1 -0
  127. package/ts/logger-impl.d.ts +71 -0
  128. package/ts/logger-impl.d.ts.map +1 -0
  129. package/ts/logger-impl.js +412 -0
  130. package/ts/logger-impl.js.map +1 -0
  131. package/ts/logger.d.ts +84 -0
  132. package/ts/logger.d.ts.map +1 -0
  133. package/ts/logger.js +114 -0
  134. package/ts/logger.js.map +1 -0
  135. package/ts/logger.test.d.ts +2 -0
  136. package/ts/logger.test.d.ts.map +1 -0
  137. package/ts/logger.test.js +1023 -0
  138. package/ts/logger.test.js.map +1 -0
  139. package/ts/node/deno-file-service.d.ts +17 -0
  140. package/ts/node/deno-file-service.d.ts.map +1 -0
  141. package/ts/node/deno-file-service.js +65 -0
  142. package/ts/node/deno-file-service.js.map +1 -0
  143. package/ts/node/deno-sys-abstraction.d.ts +22 -0
  144. package/ts/node/deno-sys-abstraction.d.ts.map +1 -0
  145. package/ts/node/deno-sys-abstraction.js +101 -0
  146. package/ts/node/deno-sys-abstraction.js.map +1 -0
  147. package/ts/node/index.d.ts +5 -0
  148. package/ts/node/index.d.ts.map +1 -0
  149. package/ts/node/index.js +5 -0
  150. package/ts/node/index.js.map +1 -0
  151. package/ts/node/mock-file-service.d.ts +11 -0
  152. package/ts/node/mock-file-service.d.ts.map +1 -0
  153. package/ts/node/mock-file-service.js +34 -0
  154. package/ts/node/mock-file-service.js.map +1 -0
  155. package/ts/node/mock-file-service.test.d.ts +2 -0
  156. package/ts/node/mock-file-service.test.d.ts.map +1 -0
  157. package/ts/node/mock-file-service.test.js +31 -0
  158. package/ts/node/mock-file-service.test.js.map +1 -0
  159. package/ts/node/node-file-service.d.ts +16 -0
  160. package/ts/node/node-file-service.d.ts.map +1 -0
  161. package/ts/node/node-file-service.js +71 -0
  162. package/ts/node/node-file-service.js.map +1 -0
  163. package/ts/node/node-sys-abstraction.d.ts +22 -0
  164. package/ts/node/node-sys-abstraction.d.ts.map +1 -0
  165. package/ts/node/node-sys-abstraction.js +99 -0
  166. package/ts/node/node-sys-abstraction.js.map +1 -0
  167. package/ts/node/node-sys-abstraction.test.d.ts +2 -0
  168. package/ts/node/node-sys-abstraction.test.d.ts.map +1 -0
  169. package/ts/node/node-sys-abstraction.test.js +87 -0
  170. package/ts/node/node-sys-abstraction.test.js.map +1 -0
  171. package/ts/option.d.ts +25 -0
  172. package/ts/option.d.ts.map +1 -0
  173. package/ts/option.js +47 -0
  174. package/ts/option.js.map +1 -0
  175. package/ts/resolve-once.d.ts +46 -0
  176. package/ts/resolve-once.d.ts.map +1 -0
  177. package/ts/resolve-once.js +152 -0
  178. package/ts/resolve-once.js.map +1 -0
  179. package/ts/resolve-once.test.d.ts +2 -0
  180. package/ts/resolve-once.test.d.ts.map +1 -0
  181. package/ts/resolve-once.test.js +283 -0
  182. package/ts/resolve-once.test.js.map +1 -0
  183. package/ts/result.d.ts +34 -0
  184. package/ts/result.d.ts.map +1 -0
  185. package/ts/result.js +85 -0
  186. package/ts/result.js.map +1 -0
  187. package/ts/result.test.d.ts +2 -0
  188. package/ts/result.test.d.ts.map +1 -0
  189. package/ts/result.test.js +79 -0
  190. package/ts/result.test.js.map +1 -0
  191. package/ts/runtime.d.ts +8 -0
  192. package/ts/runtime.d.ts.map +1 -0
  193. package/ts/runtime.js +26 -0
  194. package/ts/runtime.js.map +1 -0
  195. package/ts/sys-abstraction.d.ts +36 -0
  196. package/ts/sys-abstraction.d.ts.map +1 -0
  197. package/ts/sys-abstraction.js +31 -0
  198. package/ts/sys-abstraction.js.map +1 -0
  199. package/ts/sys-env.d.ts +48 -0
  200. package/ts/sys-env.d.ts.map +1 -0
  201. package/ts/sys-env.js +176 -0
  202. package/ts/sys-env.js.map +1 -0
  203. package/ts/sys-env.test.d.ts +2 -0
  204. package/ts/sys-env.test.d.ts.map +1 -0
  205. package/ts/sys-env.test.js +51 -0
  206. package/ts/sys-env.test.js.map +1 -0
  207. package/ts/test/log-write-stream.d.ts +27 -0
  208. package/ts/test/log-write-stream.d.ts.map +1 -0
  209. package/ts/test/log-write-stream.js +74 -0
  210. package/ts/test/log-write-stream.js.map +1 -0
  211. package/ts/test/mock-logger.d.ts +14 -0
  212. package/ts/test/mock-logger.d.ts.map +1 -0
  213. package/ts/test/mock-logger.js +29 -0
  214. package/ts/test/mock-logger.js.map +1 -0
  215. package/ts/test/mock-logger.test.d.ts +2 -0
  216. package/ts/test/mock-logger.test.d.ts.map +1 -0
  217. package/ts/test/mock-logger.test.js +63 -0
  218. package/ts/test/mock-logger.test.js.map +1 -0
  219. package/ts/test/test-exit-handler.d.ts +2 -0
  220. package/ts/test/test-exit-handler.d.ts.map +1 -0
  221. package/ts/test/test-exit-handler.js +57 -0
  222. package/ts/test/test-exit-handler.js.map +1 -0
  223. package/ts/time.d.ts +13 -0
  224. package/ts/time.d.ts.map +1 -0
  225. package/ts/time.js +14 -0
  226. package/ts/time.js.map +1 -0
  227. package/ts/tracer.d.ts +59 -0
  228. package/ts/tracer.d.ts.map +1 -0
  229. package/ts/tracer.js +148 -0
  230. package/ts/tracer.js.map +1 -0
  231. package/ts/tracer.test.d.ts +2 -0
  232. package/ts/tracer.test.d.ts.map +1 -0
  233. package/ts/tracer.test.js +311 -0
  234. package/ts/tracer.test.js.map +1 -0
  235. package/ts/txt-en-decoder.d.ts +10 -0
  236. package/ts/txt-en-decoder.d.ts.map +1 -0
  237. package/ts/txt-en-decoder.js +15 -0
  238. package/ts/txt-en-decoder.js.map +1 -0
  239. package/ts/uri.d.ts +67 -0
  240. package/ts/uri.d.ts.map +1 -0
  241. package/ts/uri.js +283 -0
  242. package/ts/uri.js.map +1 -0
  243. package/ts/uri.test.d.ts +2 -0
  244. package/ts/uri.test.d.ts.map +1 -0
  245. package/ts/uri.test.js +119 -0
  246. package/ts/uri.test.js.map +1 -0
  247. package/ts/utils/console-write-stream.d.ts +21 -0
  248. package/ts/utils/console-write-stream.d.ts.map +1 -0
  249. package/ts/utils/console-write-stream.js +62 -0
  250. package/ts/utils/console-write-stream.js.map +1 -0
  251. package/ts/utils/fanout-write-stream.d.ts +12 -0
  252. package/ts/utils/fanout-write-stream.d.ts.map +1 -0
  253. package/ts/utils/fanout-write-stream.js +24 -0
  254. package/ts/utils/fanout-write-stream.js.map +1 -0
  255. package/ts/utils/index.d.ts +7 -0
  256. package/ts/utils/index.d.ts.map +1 -0
  257. package/ts/utils/index.js +7 -0
  258. package/ts/utils/index.js.map +1 -0
  259. package/ts/utils/rebuffer.d.ts +3 -0
  260. package/ts/utils/rebuffer.d.ts.map +1 -0
  261. package/ts/utils/rebuffer.js +60 -0
  262. package/ts/utils/rebuffer.js.map +1 -0
  263. package/ts/utils/rebuffer.test.d.ts +2 -0
  264. package/ts/utils/rebuffer.test.d.ts.map +1 -0
  265. package/ts/utils/rebuffer.test.js +77 -0
  266. package/ts/utils/rebuffer.test.js.map +1 -0
  267. package/ts/utils/stream-map.d.ts +9 -0
  268. package/ts/utils/stream-map.d.ts.map +1 -0
  269. package/ts/utils/stream-map.js +62 -0
  270. package/ts/utils/stream-map.js.map +1 -0
  271. package/ts/utils/stream-map.test.d.ts +2 -0
  272. package/ts/utils/stream-map.test.d.ts.map +1 -0
  273. package/ts/utils/stream-map.test.js +87 -0
  274. package/ts/utils/stream-map.test.js.map +1 -0
  275. package/ts/utils/stream-test-helper.d.ts +17 -0
  276. package/ts/utils/stream-test-helper.d.ts.map +1 -0
  277. package/ts/utils/stream-test-helper.js +37 -0
  278. package/ts/utils/stream-test-helper.js.map +1 -0
  279. package/ts/utils/stream2string.d.ts +3 -0
  280. package/ts/utils/stream2string.d.ts.map +1 -0
  281. package/ts/utils/stream2string.js +48 -0
  282. package/ts/utils/stream2string.js.map +1 -0
  283. package/ts/utils/stream2string.test.d.ts +2 -0
  284. package/ts/utils/stream2string.test.d.ts.map +1 -0
  285. package/ts/utils/stream2string.test.js +29 -0
  286. package/ts/utils/stream2string.test.js.map +1 -0
  287. package/ts/utils/string2stream.d.ts +4 -0
  288. package/ts/utils/string2stream.d.ts.map +1 -0
  289. package/ts/utils/string2stream.js +13 -0
  290. package/ts/utils/string2stream.js.map +1 -0
  291. package/ts/utils/string2stream.test.d.ts +2 -0
  292. package/ts/utils/string2stream.test.d.ts.map +1 -0
  293. package/ts/utils/string2stream.test.js +6 -0
  294. package/ts/utils/string2stream.test.js.map +1 -0
  295. package/ts/version.d.ts +2 -0
  296. package/ts/version.d.ts.map +1 -0
  297. package/ts/version.js +4 -0
  298. package/ts/version.js.map +1 -0
  299. package/ts/web/index.d.ts +2 -0
  300. package/ts/web/index.d.ts.map +1 -0
  301. package/ts/web/index.js +2 -0
  302. package/ts/web/index.js.map +1 -0
  303. package/ts/web/web-sys-abstraction.d.ts +4 -0
  304. package/ts/web/web-sys-abstraction.d.ts.map +1 -0
  305. package/ts/web/web-sys-abstraction.js +64 -0
  306. package/ts/web/web-sys-abstraction.js.map +1 -0
  307. package/txt-en-decoder-CZYJUju2.d.cts +11 -0
  308. package/txt-en-decoder-CZYJUju2.d.ts +11 -0
  309. package/utils/index.cjs +341 -0
  310. package/utils/index.cjs.map +1 -0
  311. package/utils/index.d.cts +2 -0
  312. package/utils/index.d.ts +2 -0
  313. package/utils/index.js +32 -0
  314. package/utils/index.js.map +1 -0
  315. package/web/index.cjs +593 -0
  316. package/web/index.cjs.map +1 -0
  317. package/web/index.d.cts +6 -0
  318. package/web/index.d.ts +6 -0
  319. package/web/index.js +9 -0
  320. package/web/index.js.map +1 -0
@@ -0,0 +1,2 @@
1
+ export * from "./web-sys-abstraction.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/web/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./web-sys-abstraction.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/web/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { WrapperSysAbstractionParams } from "../base-sys-abstraction.js";
2
+ import { SysAbstraction } from "../sys-abstraction.js";
3
+ export declare function WebSysAbstraction(param?: WrapperSysAbstractionParams): SysAbstraction;
4
+ //# sourceMappingURL=web-sys-abstraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-sys-abstraction.d.ts","sourceRoot":"","sources":["../../../src/web/web-sys-abstraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAEpH,OAAO,EAAE,cAAc,EAA2B,MAAM,uBAAuB,CAAC;AAoEhF,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,2BAA2B,GAAG,cAAc,CASrF"}
@@ -0,0 +1,64 @@
1
+ import { BaseSysAbstraction, WrapperSysAbstraction } from "../base-sys-abstraction.js";
2
+ import { envFactory } from "../sys-env.js";
3
+ import { Utf8EnDecoderSingleton } from "../txt-en-decoder.js";
4
+ class WebFileService {
5
+ get baseDir() {
6
+ throw new Error("basedir-Method not implemented.");
7
+ }
8
+ create(fname) {
9
+ throw new Error("create-Method not implemented.");
10
+ }
11
+ readFileString(fname) {
12
+ throw new Error("readFileString-Method not implemented.");
13
+ }
14
+ writeFileString(fname, content) {
15
+ throw new Error("writeFileString-Method not implemented.");
16
+ }
17
+ abs(fname) {
18
+ throw new Error("abs-Method not implemented.");
19
+ }
20
+ join(...paths) {
21
+ throw new Error("join-Method not implemented.");
22
+ }
23
+ relative(from, to) {
24
+ throw new Error("relative-Method not implemented.");
25
+ }
26
+ dirname(fname) {
27
+ throw new Error("dirname-Method not implemented.");
28
+ }
29
+ basename(fname) {
30
+ throw new Error("basename-Method not implemented.");
31
+ }
32
+ nodeImport(fname) {
33
+ throw new Error("nodeImport-Method not implemented.");
34
+ }
35
+ isAbsolute(fname) {
36
+ throw new Error("isAbsolute-Method not implemented.");
37
+ }
38
+ }
39
+ class WebSystemService {
40
+ Env() {
41
+ return envFactory();
42
+ }
43
+ Args() {
44
+ throw new Error("Args-Method not implemented.");
45
+ }
46
+ OnExit(hdl) {
47
+ throw new Error("OnExit-Method not implemented.");
48
+ }
49
+ Exit(code) {
50
+ throw new Error("Exit-Method not implemented.");
51
+ }
52
+ }
53
+ let my = undefined;
54
+ export function WebSysAbstraction(param) {
55
+ if (!my) {
56
+ my = new BaseSysAbstraction({
57
+ TxtEnDecoder: (param === null || param === void 0 ? void 0 : param.TxtEnDecoder) || Utf8EnDecoderSingleton(),
58
+ FileSystem: new WebFileService(),
59
+ SystemService: new WebSystemService(),
60
+ });
61
+ }
62
+ return new WrapperSysAbstraction(my, param);
63
+ }
64
+ //# sourceMappingURL=web-sys-abstraction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-sys-abstraction.js","sourceRoot":"","sources":["../../../src/web/web-sys-abstraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAA+B,MAAM,4BAA4B,CAAC;AAGpH,OAAO,EAAO,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,cAAc;IAClB,IAAI,OAAO;QACT,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,cAAc,CAAC,KAAa;QAC1B,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,eAAe,CAAC,KAAa,EAAE,OAAe;QAC5C,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,GAAG,CAAC,KAAa;QACf,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,CAAC,GAAG,KAAe;QACrB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED,QAAQ,CAAC,IAAY,EAAE,EAAuB;QAC5C,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,CAAC,KAAa;QACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED,UAAU,CAAC,KAAa;QACtB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;IAED,UAAU,CAAC,KAAa;QACtB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;CACF;AAED,MAAM,gBAAgB;IACpB,GAAG;QACD,OAAO,UAAU,EAAE,CAAC;IACtB,CAAC;IACD,IAAI;QACF,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,GAAa;QAClB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,CAAC,IAAY;QACf,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;CACF;AAED,IAAI,EAAE,GAAmC,SAAS,CAAC;AACnD,MAAM,UAAU,iBAAiB,CAAC,KAAmC;IACnE,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,EAAE,GAAG,IAAI,kBAAkB,CAAC;YAC1B,YAAY,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,YAAY,KAAI,sBAAsB,EAAE;YAC7D,UAAU,EAAE,IAAI,cAAc,EAAE;YAChC,aAAa,EAAE,IAAI,gBAAgB,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,11 @@
1
+ interface TxtEnDecoder {
2
+ encode(str: string): Uint8Array;
3
+ decode(data: Uint8Array): string;
4
+ }
5
+ declare class Utf8EnDecoder implements TxtEnDecoder {
6
+ encode(str: string): Uint8Array;
7
+ decode(data: Uint8Array): string;
8
+ }
9
+ declare function Utf8EnDecoderSingleton(): TxtEnDecoder;
10
+
11
+ export { type TxtEnDecoder as T, Utf8EnDecoder as U, Utf8EnDecoderSingleton as a };
@@ -0,0 +1,11 @@
1
+ interface TxtEnDecoder {
2
+ encode(str: string): Uint8Array;
3
+ decode(data: Uint8Array): string;
4
+ }
5
+ declare class Utf8EnDecoder implements TxtEnDecoder {
6
+ encode(str: string): Uint8Array;
7
+ decode(data: Uint8Array): string;
8
+ }
9
+ declare function Utf8EnDecoderSingleton(): TxtEnDecoder;
10
+
11
+ export { type TxtEnDecoder as T, Utf8EnDecoder as U, Utf8EnDecoderSingleton as a };
@@ -0,0 +1,341 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/index.ts
21
+ var utils_exports = {};
22
+ __export(utils_exports, {
23
+ ConsoleWriterStream: () => ConsoleWriterStream,
24
+ ConsoleWriterStreamDefaultWriter: () => ConsoleWriterStreamDefaultWriter,
25
+ FanoutWriteStream: () => FanoutWriteStream,
26
+ array2stream: () => array2stream,
27
+ devnull: () => devnull,
28
+ rebuffer: () => rebuffer,
29
+ rebufferArray: () => rebufferArray,
30
+ stream2array: () => stream2array,
31
+ stream2string: () => stream2string,
32
+ stream2uint8array: () => stream2uint8array,
33
+ streamMap: () => streamMap,
34
+ string2stream: () => string2stream,
35
+ uint8array2stream: () => uint8array2stream
36
+ });
37
+ module.exports = __toCommonJS(utils_exports);
38
+
39
+ // src/utils/stream-map.ts
40
+ function streamMap(s, sm) {
41
+ const state = { reader: s.getReader(), streamMap: sm, idx: 0 };
42
+ return new ReadableStream({
43
+ async pull(controller) {
44
+ const { done, value } = await state.reader.read();
45
+ if (done) {
46
+ if (state.streamMap.Close) {
47
+ state.streamMap.Close();
48
+ }
49
+ controller.close();
50
+ return;
51
+ }
52
+ const promiseOrU = state.streamMap.Map(value, state.idx++);
53
+ let mapped;
54
+ if (promiseOrU instanceof Promise || typeof promiseOrU.then === "function") {
55
+ mapped = await promiseOrU;
56
+ } else {
57
+ mapped = promiseOrU;
58
+ }
59
+ controller.enqueue(mapped);
60
+ }
61
+ });
62
+ }
63
+ async function devnull(a) {
64
+ const reader = a.getReader();
65
+ let cnt = 0;
66
+ while (true) {
67
+ const { done } = await reader.read();
68
+ if (done) {
69
+ break;
70
+ }
71
+ cnt++;
72
+ }
73
+ return cnt;
74
+ }
75
+ function array2stream(a) {
76
+ let i = 0;
77
+ return new ReadableStream({
78
+ pull(controller) {
79
+ if (i >= a.length) {
80
+ controller.close();
81
+ return;
82
+ }
83
+ controller.enqueue(a[i]);
84
+ i++;
85
+ }
86
+ });
87
+ }
88
+ async function stream2array(a) {
89
+ const ret = [];
90
+ const reader = a.getReader();
91
+ while (true) {
92
+ const { done, value } = await reader.read();
93
+ if (done) {
94
+ break;
95
+ }
96
+ ret.push(value);
97
+ }
98
+ return ret;
99
+ }
100
+
101
+ // src/utils/rebuffer.ts
102
+ async function rebufferArray(a, chunkSize) {
103
+ return stream2array(rebuffer(array2stream(a), chunkSize));
104
+ }
105
+ function reChunk(cs, chunkSize) {
106
+ const len = cs.reduce((acc, v) => acc + v.length, 0);
107
+ const last = cs[cs.length - 1];
108
+ const lastOfs = len - last.length;
109
+ const rest = last.subarray(chunkSize - lastOfs);
110
+ cs[cs.length - 1] = last.subarray(0, chunkSize - lastOfs);
111
+ const chunk = new Uint8Array(chunkSize);
112
+ let ofs = 0;
113
+ for (const c of cs) {
114
+ chunk.set(c, ofs);
115
+ ofs += c.length;
116
+ }
117
+ return { rest, chunk };
118
+ }
119
+ function pump(ps, controller, next) {
120
+ ps.reader.read().then(({ done, value }) => {
121
+ if (done) {
122
+ if (ps.tmpLen > 0) {
123
+ controller.enqueue(reChunk(ps.tmp, ps.tmpLen).chunk);
124
+ }
125
+ controller.close();
126
+ next();
127
+ return;
128
+ }
129
+ if (ps.tmpLen + value.length > ps.chunkSize) {
130
+ ps.tmp.push(value);
131
+ const res = reChunk(ps.tmp, ps.chunkSize);
132
+ controller.enqueue(res.chunk);
133
+ ps.tmp = [res.rest];
134
+ ps.tmpLen = res.rest.length;
135
+ next();
136
+ return;
137
+ } else if (value.length) {
138
+ ps.tmp.push(value);
139
+ ps.tmpLen += value.length;
140
+ }
141
+ pump(ps, controller, next);
142
+ });
143
+ }
144
+ function rebuffer(a, chunkSize) {
145
+ const state = {
146
+ reader: a.getReader(),
147
+ tmp: [],
148
+ tmpLen: 0,
149
+ chunkSize
150
+ };
151
+ return new ReadableStream({
152
+ async pull(controller) {
153
+ return new Promise((resolve) => {
154
+ pump(state, controller, resolve);
155
+ });
156
+ }
157
+ });
158
+ }
159
+
160
+ // src/utils/stream2string.ts
161
+ async function stream2string(stream, maxSize) {
162
+ if (!stream) {
163
+ return Promise.resolve("");
164
+ }
165
+ const reader = stream.getReader();
166
+ let res = "";
167
+ const decoder2 = new TextDecoder();
168
+ let rSize = 0;
169
+ while (typeof maxSize === "undefined" || rSize < maxSize) {
170
+ try {
171
+ const read = await reader.read();
172
+ if (read.done) {
173
+ break;
174
+ }
175
+ if (maxSize && rSize + read.value.length > maxSize) {
176
+ read.value = read.value.slice(0, maxSize - rSize);
177
+ }
178
+ const block = decoder2.decode(read.value, { stream: true });
179
+ rSize += read.value.length;
180
+ res += block;
181
+ } catch (err) {
182
+ return Promise.reject(err);
183
+ }
184
+ }
185
+ return Promise.resolve(res);
186
+ }
187
+ async function stream2uint8array(stream) {
188
+ if (!stream) {
189
+ return Promise.resolve(new Uint8Array());
190
+ }
191
+ const reader = stream.getReader();
192
+ let res = new Uint8Array();
193
+ while (1) {
194
+ try {
195
+ const { done, value } = await reader.read();
196
+ if (done) {
197
+ break;
198
+ }
199
+ res = new Uint8Array([...res, ...value]);
200
+ } catch (err) {
201
+ return Promise.reject(err);
202
+ }
203
+ }
204
+ return Promise.resolve(res);
205
+ }
206
+
207
+ // src/txt-en-decoder.ts
208
+ var encoder = new TextEncoder();
209
+ var decoder = new TextDecoder();
210
+ var Utf8EnDecoder = class {
211
+ encode(str) {
212
+ return encoder.encode(str);
213
+ }
214
+ decode(data) {
215
+ return decoder.decode(data);
216
+ }
217
+ };
218
+ var utf8EnDecoder = new Utf8EnDecoder();
219
+ function Utf8EnDecoderSingleton() {
220
+ return utf8EnDecoder;
221
+ }
222
+
223
+ // src/utils/string2stream.ts
224
+ function string2stream(str, ende = Utf8EnDecoderSingleton()) {
225
+ return uint8array2stream(ende.encode(str));
226
+ }
227
+ function uint8array2stream(str) {
228
+ return new ReadableStream({
229
+ start(controller) {
230
+ controller.enqueue(str);
231
+ controller.close();
232
+ }
233
+ });
234
+ }
235
+
236
+ // src/utils/console-write-stream.ts
237
+ var ConsoleWriterStreamDefaultWriter = class {
238
+ constructor(stream) {
239
+ this.stream = stream;
240
+ this.desiredSize = null;
241
+ this.decoder = new TextDecoder();
242
+ this._stream = stream;
243
+ this.ready = Promise.resolve(void 0);
244
+ this.closed = Promise.resolve(void 0);
245
+ }
246
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
247
+ abort(reason) {
248
+ throw new Error("Method not implemented.");
249
+ }
250
+ async close() {
251
+ }
252
+ releaseLock() {
253
+ this._stream.locked = false;
254
+ this.ready = Promise.resolve(void 0);
255
+ this.closed = Promise.resolve(void 0);
256
+ }
257
+ async write(chunk) {
258
+ const str = this.decoder.decode(chunk).trimEnd();
259
+ let output = "log";
260
+ try {
261
+ const decode = JSON.parse(str);
262
+ output = decode.level;
263
+ } catch (e) {
264
+ }
265
+ switch (output) {
266
+ case "error":
267
+ console.error(str);
268
+ break;
269
+ case "warn":
270
+ console.warn(str);
271
+ break;
272
+ default:
273
+ console.log(str);
274
+ }
275
+ }
276
+ };
277
+ var ConsoleWriterStream = class {
278
+ constructor() {
279
+ this.locked = false;
280
+ }
281
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
282
+ abort(reason) {
283
+ throw new Error("Method not implemented.");
284
+ }
285
+ async close() {
286
+ return;
287
+ }
288
+ getWriter() {
289
+ if (this.locked) {
290
+ throw new Error("Stream is locked");
291
+ }
292
+ this.locked = true;
293
+ if (!this._writer) {
294
+ this._writer = new ConsoleWriterStreamDefaultWriter(this);
295
+ }
296
+ return this._writer;
297
+ }
298
+ };
299
+
300
+ // src/utils/fanout-write-stream.ts
301
+ var FanoutWriteStream = class {
302
+ constructor(writers) {
303
+ this.desiredSize = null;
304
+ this._writers = writers;
305
+ this.ready = Promise.all(this._writers.map((w) => w.ready)).then(() => void 0);
306
+ this.closed = Promise.all(this._writers.map((w) => w.closed)).then(() => void 0);
307
+ }
308
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
309
+ abort(reason) {
310
+ return Promise.all(this._writers.map((w) => w.abort(reason))).then(() => {
311
+ });
312
+ }
313
+ close() {
314
+ return Promise.all(this._writers.map((w) => w.close())).then(() => {
315
+ });
316
+ }
317
+ releaseLock() {
318
+ this._writers.map((w) => w.releaseLock());
319
+ }
320
+ write(chunk) {
321
+ return Promise.all(this._writers.map((w) => w.write(chunk))).then(() => {
322
+ });
323
+ }
324
+ };
325
+ // Annotate the CommonJS export names for ESM import in node:
326
+ 0 && (module.exports = {
327
+ ConsoleWriterStream,
328
+ ConsoleWriterStreamDefaultWriter,
329
+ FanoutWriteStream,
330
+ array2stream,
331
+ devnull,
332
+ rebuffer,
333
+ rebufferArray,
334
+ stream2array,
335
+ stream2string,
336
+ stream2uint8array,
337
+ streamMap,
338
+ string2stream,
339
+ uint8array2stream
340
+ });
341
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/index.ts","../../../src/utils/stream-map.ts","../../../src/utils/rebuffer.ts","../../../src/utils/stream2string.ts","../../../src/txt-en-decoder.ts","../../../src/utils/string2stream.ts","../../../src/utils/console-write-stream.ts","../../../src/utils/fanout-write-stream.ts"],"sourcesContent":["export * from \"./rebuffer.js\";\nexport * from \"./stream-map.js\";\nexport * from \"./stream2string.js\";\nexport * from \"./string2stream.js\";\nexport * from \"./console-write-stream.js\";\nexport * from \"./fanout-write-stream.js\";\n","export interface StreamMap<T, U> {\n Map(s: T, idx: number): U | Promise<U>;\n readonly Close?: () => void;\n}\nexport function streamMap<T, U>(s: ReadableStream<T>, sm: StreamMap<T, U>): ReadableStream<U> {\n const state = { reader: s.getReader(), streamMap: sm, idx: 0 };\n return new ReadableStream<U>({\n async pull(controller): Promise<void> {\n const { done, value } = await state.reader.read();\n if (done) {\n if (state.streamMap.Close) {\n state.streamMap.Close();\n }\n controller.close();\n return;\n }\n const promiseOrU = state.streamMap.Map(value, state.idx++);\n let mapped: U;\n if (promiseOrU instanceof Promise || typeof (promiseOrU as { then: () => void }).then === \"function\") {\n mapped = await promiseOrU;\n } else {\n mapped = promiseOrU;\n }\n controller.enqueue(mapped);\n },\n });\n}\n\nexport async function devnull<T>(a: ReadableStream<T>): Promise<number> {\n const reader = a.getReader();\n let cnt = 0;\n while (true) {\n const { done } = await reader.read();\n if (done) {\n break;\n }\n cnt++;\n }\n return cnt;\n}\n\nexport function array2stream<T>(a: T[]): ReadableStream<T> {\n let i = 0;\n return new ReadableStream<T>({\n pull(controller): void {\n if (i >= a.length) {\n controller.close();\n return;\n }\n controller.enqueue(a[i]);\n i++;\n },\n });\n}\n\nexport async function stream2array<T>(a: ReadableStream<T>): Promise<T[]> {\n const ret: T[] = [];\n const reader = a.getReader();\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n ret.push(value);\n }\n return ret;\n}\n","import { array2stream, stream2array } from \"./stream-map.js\";\n\ninterface ReChunkResult {\n readonly rest: Uint8Array;\n readonly chunk: Uint8Array;\n}\n\nexport async function rebufferArray(a: Uint8Array[], chunkSize: number): Promise<Uint8Array[]> {\n return stream2array(rebuffer(array2stream(a), chunkSize));\n}\n\nfunction reChunk(cs: Uint8Array[], chunkSize: number): ReChunkResult {\n const len = cs.reduce((acc, v) => acc + v.length, 0);\n const last = cs[cs.length - 1];\n const lastOfs = len - last.length;\n // console.log(\"reChunk\", len, lastOfs, last.length, chunkSize, chunkSize - lastOfs)\n const rest = last.subarray(chunkSize - lastOfs);\n cs[cs.length - 1] = last.subarray(0, chunkSize - lastOfs);\n const chunk = new Uint8Array(chunkSize);\n let ofs = 0;\n for (const c of cs) {\n chunk.set(c, ofs);\n ofs += c.length;\n }\n return { rest, chunk };\n}\n\ninterface pumpState {\n readonly reader: ReadableStreamDefaultReader<Uint8Array>;\n tmp: Uint8Array[];\n tmpLen: number;\n readonly chunkSize: number;\n}\n\nfunction pump(ps: pumpState, controller: ReadableStreamDefaultController<Uint8Array>, next: () => void): void {\n ps.reader.read().then(({ done, value }) => {\n if (done) {\n if (ps.tmpLen > 0) {\n controller.enqueue(reChunk(ps.tmp, ps.tmpLen).chunk);\n }\n controller.close();\n next();\n return;\n }\n if (ps.tmpLen + value.length > ps.chunkSize) {\n ps.tmp.push(value);\n const res = reChunk(ps.tmp, ps.chunkSize);\n controller.enqueue(res.chunk);\n ps.tmp = [res.rest];\n ps.tmpLen = res.rest.length;\n next();\n return;\n } else if (value.length) {\n ps.tmp.push(value);\n ps.tmpLen += value.length;\n }\n pump(ps, controller, next);\n });\n}\n\nexport function rebuffer(a: ReadableStream<Uint8Array>, chunkSize: number): ReadableStream<Uint8Array> {\n const state: pumpState = {\n reader: a.getReader(),\n tmp: [],\n tmpLen: 0,\n chunkSize,\n };\n return new ReadableStream<Uint8Array>({\n async pull(controller): Promise<void> {\n return new Promise<void>((resolve) => {\n pump(state, controller, resolve);\n });\n },\n });\n}\n","export async function stream2string(stream?: ReadableStream<Uint8Array> | null, maxSize?: number): Promise<string> {\n if (!stream) {\n return Promise.resolve(\"\");\n }\n const reader = stream.getReader();\n let res = \"\";\n const decoder = new TextDecoder();\n let rSize = 0;\n while (typeof maxSize === \"undefined\" || rSize < maxSize) {\n try {\n const read = await reader.read();\n if (read.done) {\n break;\n }\n if (maxSize && rSize + read.value.length > maxSize) {\n read.value = read.value.slice(0, maxSize - rSize);\n }\n const block = decoder.decode(read.value, { stream: true });\n rSize += read.value.length;\n res += block;\n } catch (err) {\n return Promise.reject(err);\n }\n }\n return Promise.resolve(res);\n}\n\nexport async function stream2uint8array(stream?: ReadableStream<Uint8Array> | null): Promise<Uint8Array> {\n if (!stream) {\n return Promise.resolve(new Uint8Array());\n }\n const reader = stream.getReader();\n let res = new Uint8Array();\n // eslint-disable-next-line no-constant-condition\n while (1) {\n try {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n res = new Uint8Array([...res, ...value]);\n } catch (err) {\n return Promise.reject(err);\n }\n }\n return Promise.resolve(res);\n}\n","export interface TxtEnDecoder {\n encode(str: string): Uint8Array;\n decode(data: Uint8Array): string;\n}\n\nconst encoder = new TextEncoder();\nconst decoder = new TextDecoder();\n\nexport class Utf8EnDecoder implements TxtEnDecoder {\n encode(str: string): Uint8Array {\n return encoder.encode(str);\n }\n decode(data: Uint8Array): string {\n return decoder.decode(data);\n }\n}\n\nconst utf8EnDecoder = new Utf8EnDecoder();\nexport function Utf8EnDecoderSingleton(): TxtEnDecoder {\n return utf8EnDecoder;\n}\n","import { TxtEnDecoder, Utf8EnDecoderSingleton } from \"../txt-en-decoder.js\";\n\nexport function string2stream(str: string, ende: TxtEnDecoder = Utf8EnDecoderSingleton()): ReadableStream<Uint8Array> {\n return uint8array2stream(ende.encode(str));\n}\n\nexport function uint8array2stream(str: Uint8Array): ReadableStream<Uint8Array> {\n return new ReadableStream<Uint8Array>({\n start(controller): void {\n controller.enqueue(str);\n controller.close();\n },\n });\n}\n","export class ConsoleWriterStreamDefaultWriter implements WritableStreamDefaultWriter<Uint8Array> {\n readonly desiredSize: number | null = null;\n readonly decoder: TextDecoder = new TextDecoder();\n\n closed: Promise<undefined>;\n ready: Promise<undefined>;\n readonly _stream: ConsoleWriterStream;\n\n constructor(private stream: ConsoleWriterStream) {\n this._stream = stream;\n this.ready = Promise.resolve(undefined);\n this.closed = Promise.resolve(undefined);\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any\n abort(reason?: any): Promise<void> {\n throw new Error(\"Method not implemented.\");\n }\n async close(): Promise<void> {\n // noop\n }\n releaseLock(): void {\n this._stream.locked = false;\n this.ready = Promise.resolve(undefined);\n this.closed = Promise.resolve(undefined);\n }\n async write(chunk?: Uint8Array | undefined): Promise<void> {\n const str = this.decoder.decode(chunk).trimEnd();\n let output = \"log\";\n try {\n const decode = JSON.parse(str);\n output = decode.level;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n /* noop */\n }\n switch (output) {\n case \"error\":\n // eslint-disable-next-line no-console\n console.error(str);\n break;\n case \"warn\":\n // eslint-disable-next-line no-console\n console.warn(str);\n break;\n default:\n // eslint-disable-next-line no-console\n console.log(str);\n }\n }\n}\n\nexport class ConsoleWriterStream implements WritableStream<Uint8Array> {\n locked = false;\n _writer?: WritableStreamDefaultWriter<Uint8Array>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars\n abort(reason?: any): Promise<void> {\n throw new Error(\"Method not implemented.\");\n }\n async close(): Promise<void> {\n return;\n }\n getWriter(): WritableStreamDefaultWriter<Uint8Array> {\n if (this.locked) {\n throw new Error(\"Stream is locked\");\n }\n this.locked = true;\n if (!this._writer) {\n this._writer = new ConsoleWriterStreamDefaultWriter(this);\n }\n return this._writer;\n }\n}\n","export class FanoutWriteStream implements WritableStreamDefaultWriter<Uint8Array> {\n readonly _writers: WritableStreamDefaultWriter<Uint8Array>[];\n readonly ready: Promise<undefined>;\n readonly closed: Promise<undefined>;\n readonly desiredSize: number | null = null;\n constructor(writers: WritableStreamDefaultWriter<Uint8Array>[]) {\n this._writers = writers;\n this.ready = Promise.all(this._writers.map((w) => w.ready)).then(() => undefined);\n this.closed = Promise.all(this._writers.map((w) => w.closed)).then(() => undefined);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n abort(reason?: any): Promise<void> {\n return Promise.all(this._writers.map((w) => w.abort(reason))).then(() => {\n /* do nothing */\n });\n }\n close(): Promise<void> {\n return Promise.all(this._writers.map((w) => w.close())).then(() => {\n /* do nothing */\n });\n }\n releaseLock(): void {\n this._writers.map((w) => w.releaseLock());\n }\n\n write(chunk?: Uint8Array | undefined): Promise<void> {\n return Promise.all(this._writers.map((w) => w.write(chunk))).then(() => {\n /* do nothing */\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,SAAS,UAAgB,GAAsB,IAAwC;AAC5F,QAAM,QAAQ,EAAE,QAAQ,EAAE,UAAU,GAAG,WAAW,IAAI,KAAK,EAAE;AAC7D,SAAO,IAAI,eAAkB;AAAA,IAC3B,MAAM,KAAK,YAA2B;AACpC,YAAM,EAAE,MAAM,MAAM,IAAI,MAAM,MAAM,OAAO,KAAK;AAChD,UAAI,MAAM;AACR,YAAI,MAAM,UAAU,OAAO;AACzB,gBAAM,UAAU,MAAM;AAAA,QACxB;AACA,mBAAW,MAAM;AACjB;AAAA,MACF;AACA,YAAM,aAAa,MAAM,UAAU,IAAI,OAAO,MAAM,KAAK;AACzD,UAAI;AACJ,UAAI,sBAAsB,WAAW,OAAQ,WAAoC,SAAS,YAAY;AACpG,iBAAS,MAAM;AAAA,MACjB,OAAO;AACL,iBAAS;AAAA,MACX;AACA,iBAAW,QAAQ,MAAM;AA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riterStreamDefaultWriter, F as FanoutWriteStream, S as StreamMap, b as array2stream, d as devnull, a as rebuffer, r as rebufferArray, c as stream2array, e as stream2string, f as stream2uint8array, s as streamMap, g as string2stream, u as uint8array2stream } from '../index-Q3phXzYr.cjs';
2
+ import '../txt-en-decoder-CZYJUju2.cjs';
@@ -0,0 +1,2 @@
1
+ export { h as ConsoleWriterStream, C as ConsoleWriterStreamDefaultWriter, F as FanoutWriteStream, S as StreamMap, b as array2stream, d as devnull, a as rebuffer, r as rebufferArray, c as stream2array, e as stream2string, f as stream2uint8array, s as streamMap, g as string2stream, u as uint8array2stream } from '../index-tIGZMHTc.js';
2
+ import '../txt-en-decoder-CZYJUju2.js';
package/utils/index.js ADDED
@@ -0,0 +1,32 @@
1
+ import {
2
+ ConsoleWriterStream,
3
+ ConsoleWriterStreamDefaultWriter,
4
+ FanoutWriteStream,
5
+ array2stream,
6
+ devnull,
7
+ rebuffer,
8
+ rebufferArray,
9
+ stream2array,
10
+ stream2string,
11
+ stream2uint8array,
12
+ streamMap,
13
+ string2stream,
14
+ uint8array2stream
15
+ } from "../chunk-7KFVMTOS.js";
16
+ import "../chunk-GES3MUGV.js";
17
+ export {
18
+ ConsoleWriterStream,
19
+ ConsoleWriterStreamDefaultWriter,
20
+ FanoutWriteStream,
21
+ array2stream,
22
+ devnull,
23
+ rebuffer,
24
+ rebufferArray,
25
+ stream2array,
26
+ stream2string,
27
+ stream2uint8array,
28
+ streamMap,
29
+ string2stream,
30
+ uint8array2stream
31
+ };
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}