@adviser/cement 0.3.3 → 0.3.5

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 (546) hide show
  1. package/{base-sys-abstraction-CR_Z-Ceg.d.ts → base-sys-abstraction-CKI4xiRR.d.ts} +4 -4
  2. package/{base-sys-abstraction-DWtPI7Kg.d.cts → base-sys-abstraction-DLnSeH4s.d.cts} +4 -4
  3. package/cf/index.cjs +298 -284
  4. package/cf/index.cjs.map +1 -1
  5. package/cf/index.d.cts +4 -18
  6. package/cf/index.d.ts +4 -18
  7. package/cf/index.js +39 -6
  8. package/cf/index.js.map +1 -1
  9. package/{chunk-P6LDM7PY.js → chunk-4QRZPFED.js} +112 -506
  10. package/chunk-4QRZPFED.js.map +1 -0
  11. package/{chunk-HFP74WLI.js → chunk-4U6TAOIU.js} +5 -4
  12. package/chunk-4U6TAOIU.js.map +1 -0
  13. package/{chunk-PRCFKZR7.js → chunk-6AG3MRNY.js} +22 -170
  14. package/chunk-6AG3MRNY.js.map +1 -0
  15. package/{chunk-A7OPSHUV.js → chunk-LRJXXDF5.js} +11 -4
  16. package/chunk-LRJXXDF5.js.map +1 -0
  17. package/chunk-OIIUVSUX.js +88 -0
  18. package/chunk-OIIUVSUX.js.map +1 -0
  19. package/chunk-QDDO6NOK.js +194 -0
  20. package/chunk-QDDO6NOK.js.map +1 -0
  21. package/deno/index.cjs +274 -166
  22. package/deno/index.cjs.map +1 -1
  23. package/deno/index.d.cts +4 -24
  24. package/deno/index.d.ts +4 -24
  25. package/deno/index.js +174 -8
  26. package/deno/index.js.map +1 -1
  27. package/get-params-result-Bhy5997x.d.cts +61 -0
  28. package/get-params-result-Bhy5997x.d.ts +61 -0
  29. package/{index-CfSl8Gmj.d.ts → index-1R-hTV11.d.ts} +5 -50
  30. package/{index-BfZxTAe_.d.cts → index-98HXQB3i.d.cts} +5 -50
  31. package/{index-Q3phXzYr.d.cts → index-BMCdndbY.d.cts} +28 -23
  32. package/{index-tIGZMHTc.d.ts → index-IrV5jK1W.d.ts} +28 -23
  33. package/index.cjs +327 -430
  34. package/index.cjs.map +1 -1
  35. package/index.d.cts +13 -11
  36. package/index.d.ts +13 -11
  37. package/index.js +18 -12
  38. package/index.js.map +1 -1
  39. package/node/index.cjs +247 -139
  40. package/node/index.cjs.map +1 -1
  41. package/node/index.d.cts +4 -17
  42. package/node/index.d.ts +4 -17
  43. package/node/index.js +183 -12
  44. package/node/index.js.map +1 -1
  45. package/package.json +1 -1
  46. package/src/base-sys-abstraction.ts +8 -6
  47. package/src/cf/cf-env-actions.ts +53 -0
  48. package/src/cf/cf-sys-abstraction.ts +1 -53
  49. package/src/cf-test-main.ts +5 -0
  50. package/src/deno/deno-env-actions.ts +57 -0
  51. package/src/deno/deno-file-service.ts +1 -1
  52. package/src/deno/deno-sys-abstraction.ts +1 -57
  53. package/src/http_header.ts +1 -1
  54. package/src/index.ts +3 -0
  55. package/src/jsr.json +1 -1
  56. package/src/log-writer-impl.ts +10 -5
  57. package/src/logger-impl.ts +9 -8
  58. package/src/logger.ts +4 -5
  59. package/src/node/mock-file-service.ts +4 -4
  60. package/src/node/node-env-actions.ts +45 -0
  61. package/src/node/node-sys-abstraction.ts +1 -45
  62. package/src/resolve-once.ts +6 -5
  63. package/src/runtime.ts +3 -3
  64. package/src/sys-env.ts +64 -4
  65. package/src/test/log-write-stream.ts +2 -1
  66. package/src/tracer.ts +4 -6
  67. package/src/uri.ts +4 -69
  68. package/src/utils/console-write-stream.ts +4 -3
  69. package/src/utils/fanout-write-stream.ts +1 -1
  70. package/src/utils/get-params-result.ts +71 -0
  71. package/src/utils/index.ts +1 -0
  72. package/src/utils/rebuffer.ts +27 -21
  73. package/src/utils/relative-path.ts +1 -1
  74. package/src/utils/stream2string.ts +2 -2
  75. package/src/utils/stripper.ts +2 -2
  76. package/src/version.ts +2 -2
  77. package/src/web/web-env-actions.ts +41 -0
  78. package/src/web/web-sys-abstraction.ts +2 -42
  79. package/{sys-abstraction-GNnBj2sz.d.cts → sys-abstraction-BRDT_TIU.d.cts} +8 -1
  80. package/{sys-abstraction-GNnBj2sz.d.ts → sys-abstraction-Bd0EzwO6.d.ts} +8 -1
  81. package/test/index.cjs +460 -578
  82. package/test/index.cjs.map +1 -1
  83. package/test/index.d.cts +3 -3
  84. package/test/index.d.ts +3 -3
  85. package/test/index.js +5 -4
  86. package/ts/smoke/smoke.d.ts +2 -0
  87. package/ts/smoke/smoke.d.ts.map +1 -0
  88. package/ts/smoke/smoke.js +33 -0
  89. package/ts/smoke/smoke.js.map +1 -0
  90. package/ts/{base-sys-abstraction.d.ts → src/base-sys-abstraction.d.ts} +2 -2
  91. package/ts/src/base-sys-abstraction.d.ts.map +1 -0
  92. package/ts/{base-sys-abstraction.js → src/base-sys-abstraction.js} +4 -2
  93. package/ts/src/base-sys-abstraction.js.map +1 -0
  94. package/ts/src/base-sys-abstraction.test.d.ts.map +1 -0
  95. package/ts/src/base-sys-abstraction.test.js.map +1 -0
  96. package/ts/src/bin2text.d.ts.map +1 -0
  97. package/ts/src/bin2text.js.map +1 -0
  98. package/ts/{bin2text.test.d.ts.map → src/bin2text.test.d.ts.map} +1 -1
  99. package/ts/src/bin2text.test.js.map +1 -0
  100. package/ts/src/cf/cf-env-actions.d.ts +16 -0
  101. package/ts/src/cf/cf-env-actions.d.ts.map +1 -0
  102. package/ts/{cf/cf-sys-abstraction.js → src/cf/cf-env-actions.js} +1 -30
  103. package/ts/src/cf/cf-env-actions.js.map +1 -0
  104. package/ts/src/cf/cf-sys-abstraction.d.ts +11 -0
  105. package/ts/src/cf/cf-sys-abstraction.d.ts.map +1 -0
  106. package/ts/src/cf/cf-sys-abstraction.js +30 -0
  107. package/ts/src/cf/cf-sys-abstraction.js.map +1 -0
  108. package/ts/src/cf/index.d.ts.map +1 -0
  109. package/ts/src/cf/index.js.map +1 -0
  110. package/ts/src/cf-test-main.d.ts +5 -0
  111. package/ts/src/cf-test-main.d.ts.map +1 -0
  112. package/ts/src/cf-test-main.js +6 -0
  113. package/ts/src/cf-test-main.js.map +1 -0
  114. package/ts/src/crypto.d.ts.map +1 -0
  115. package/ts/src/crypto.js.map +1 -0
  116. package/ts/{crypto.test.d.ts.map → src/crypto.test.d.ts.map} +1 -1
  117. package/ts/{crypto.test.js → src/crypto.test.js} +8 -1
  118. package/ts/src/crypto.test.js.map +1 -0
  119. package/ts/src/deno/deno-env-actions.d.ts +23 -0
  120. package/ts/src/deno/deno-env-actions.d.ts.map +1 -0
  121. package/ts/src/deno/deno-env-actions.js +46 -0
  122. package/ts/src/deno/deno-env-actions.js.map +1 -0
  123. package/ts/src/deno/deno-file-service.d.ts.map +1 -0
  124. package/ts/src/deno/deno-file-service.js.map +1 -0
  125. package/ts/{deno → src/deno}/deno-sys-abstraction.d.ts +1 -22
  126. package/ts/src/deno/deno-sys-abstraction.d.ts.map +1 -0
  127. package/ts/{deno → src/deno}/deno-sys-abstraction.js +0 -45
  128. package/ts/src/deno/deno-sys-abstraction.js.map +1 -0
  129. package/ts/src/deno/index.d.ts.map +1 -0
  130. package/ts/src/deno/index.js.map +1 -0
  131. package/ts/src/file-service.d.ts.map +1 -0
  132. package/ts/{file-service.js.map → src/file-service.js.map} +1 -1
  133. package/ts/src/future.d.ts.map +1 -0
  134. package/ts/src/future.js.map +1 -0
  135. package/ts/{future.test.d.ts.map → src/future.test.d.ts.map} +1 -1
  136. package/ts/src/future.test.js.map +1 -0
  137. package/ts/src/http_header.d.ts.map +1 -0
  138. package/ts/src/http_header.js.map +1 -0
  139. package/ts/src/http_header.test.d.ts.map +1 -0
  140. package/ts/src/http_header.test.js.map +1 -0
  141. package/ts/{index.d.ts → src/index.d.ts} +2 -0
  142. package/ts/src/index.d.ts.map +1 -0
  143. package/ts/{index.js → src/index.js} +2 -0
  144. package/ts/src/index.js.map +1 -0
  145. package/ts/src/log-level-impl.d.ts.map +1 -0
  146. package/ts/src/log-level-impl.js.map +1 -0
  147. package/ts/src/log-writer-impl.d.ts.map +1 -0
  148. package/ts/{log-writer-impl.js → src/log-writer-impl.js} +4 -2
  149. package/ts/src/log-writer-impl.js.map +1 -0
  150. package/ts/{logger-impl.d.ts → src/logger-impl.d.ts} +1 -1
  151. package/ts/src/logger-impl.d.ts.map +1 -0
  152. package/ts/{logger-impl.js → src/logger-impl.js} +2 -3
  153. package/ts/src/logger-impl.js.map +1 -0
  154. package/ts/{logger.d.ts → src/logger.d.ts} +1 -1
  155. package/ts/src/logger.d.ts.map +1 -0
  156. package/ts/src/logger.js.map +1 -0
  157. package/ts/{logger.test.d.ts.map → src/logger.test.d.ts.map} +1 -1
  158. package/ts/{logger.test.js → src/logger.test.js} +4 -4
  159. package/ts/src/logger.test.js.map +1 -0
  160. package/ts/src/node/index.d.ts.map +1 -0
  161. package/ts/src/node/index.js.map +1 -0
  162. package/ts/src/node/mock-file-service.d.ts.map +1 -0
  163. package/ts/{node → src/node}/mock-file-service.js +4 -4
  164. package/ts/src/node/mock-file-service.js.map +1 -0
  165. package/ts/src/node/mock-file-service.test.d.ts.map +1 -0
  166. package/ts/src/node/mock-file-service.test.js.map +1 -0
  167. package/ts/src/node/node-env-actions.d.ts +15 -0
  168. package/ts/src/node/node-env-actions.d.ts.map +1 -0
  169. package/ts/src/node/node-env-actions.js +44 -0
  170. package/ts/src/node/node-env-actions.js.map +1 -0
  171. package/ts/src/node/node-file-service.d.ts.map +1 -0
  172. package/ts/src/node/node-file-service.js.map +1 -0
  173. package/ts/{node → src/node}/node-sys-abstraction.d.ts +1 -14
  174. package/ts/src/node/node-sys-abstraction.d.ts.map +1 -0
  175. package/ts/{node → src/node}/node-sys-abstraction.js +0 -43
  176. package/ts/src/node/node-sys-abstraction.js.map +1 -0
  177. package/ts/src/node/node-sys-abstraction.test.d.ts.map +1 -0
  178. package/ts/src/node/node-sys-abstraction.test.js.map +1 -0
  179. package/ts/src/option.d.ts.map +1 -0
  180. package/ts/src/option.js.map +1 -0
  181. package/ts/{resolve-once.d.ts → src/resolve-once.d.ts} +1 -1
  182. package/ts/src/resolve-once.d.ts.map +1 -0
  183. package/ts/{resolve-once.js → src/resolve-once.js} +5 -4
  184. package/ts/src/resolve-once.js.map +1 -0
  185. package/ts/src/resolve-once.test.d.ts.map +1 -0
  186. package/ts/{resolve-once.test.js → src/resolve-once.test.js} +20 -24
  187. package/ts/src/resolve-once.test.js.map +1 -0
  188. package/ts/src/result.d.ts.map +1 -0
  189. package/ts/src/result.js.map +1 -0
  190. package/ts/{result.test.d.ts.map → src/result.test.d.ts.map} +1 -1
  191. package/ts/{result.test.js → src/result.test.js} +2 -4
  192. package/ts/src/result.test.js.map +1 -0
  193. package/ts/src/runtime.d.ts.map +1 -0
  194. package/ts/src/runtime.js.map +1 -0
  195. package/ts/src/sys-abstraction.d.ts.map +1 -0
  196. package/ts/src/sys-abstraction.js.map +1 -0
  197. package/ts/{sys-env.d.ts → src/sys-env.d.ts} +7 -0
  198. package/ts/src/sys-env.d.ts.map +1 -0
  199. package/ts/{sys-env.js → src/sys-env.js} +57 -4
  200. package/ts/src/sys-env.js.map +1 -0
  201. package/ts/{sys-env.test.d.ts.map → src/sys-env.test.d.ts.map} +1 -1
  202. package/ts/{sys-env.test.js → src/sys-env.test.js} +70 -2
  203. package/ts/src/sys-env.test.js.map +1 -0
  204. package/ts/src/test/index.d.ts.map +1 -0
  205. package/ts/src/test/index.js.map +1 -0
  206. package/ts/src/test/log-write-stream.d.ts.map +1 -0
  207. package/ts/src/test/log-write-stream.js.map +1 -0
  208. package/ts/src/test/mock-logger.d.ts.map +1 -0
  209. package/ts/src/test/mock-logger.js.map +1 -0
  210. package/ts/src/test/mock-logger.test.d.ts.map +1 -0
  211. package/ts/src/test/mock-logger.test.js.map +1 -0
  212. package/ts/src/test/test-exit-handler.d.ts.map +1 -0
  213. package/ts/{test → src/test}/test-exit-handler.js +8 -3
  214. package/ts/src/test/test-exit-handler.js.map +1 -0
  215. package/ts/src/time.d.ts.map +1 -0
  216. package/ts/src/time.js.map +1 -0
  217. package/ts/src/tracer.d.ts.map +1 -0
  218. package/ts/src/tracer.js.map +1 -0
  219. package/ts/{tracer.test.d.ts.map → src/tracer.test.d.ts.map} +1 -1
  220. package/ts/{tracer.test.js → src/tracer.test.js} +5 -5
  221. package/ts/src/tracer.test.js.map +1 -0
  222. package/ts/src/txt-en-decoder.d.ts.map +1 -0
  223. package/ts/src/txt-en-decoder.js.map +1 -0
  224. package/ts/{uri.d.ts → src/uri.d.ts} +2 -13
  225. package/ts/src/uri.d.ts.map +1 -0
  226. package/ts/{uri.js → src/uri.js} +2 -56
  227. package/ts/src/uri.js.map +1 -0
  228. package/ts/{uri.test.d.ts.map → src/uri.test.d.ts.map} +1 -1
  229. package/ts/{uri.test.js → src/uri.test.js} +7 -7
  230. package/ts/src/uri.test.js.map +1 -0
  231. package/ts/{utils → src/utils}/console-write-stream.d.ts +1 -1
  232. package/ts/src/utils/console-write-stream.d.ts.map +1 -0
  233. package/ts/{utils → src/utils}/console-write-stream.js +4 -3
  234. package/ts/src/utils/console-write-stream.js.map +1 -0
  235. package/ts/{utils → src/utils}/fanout-write-stream.d.ts +1 -1
  236. package/ts/src/utils/fanout-write-stream.d.ts.map +1 -0
  237. package/ts/src/utils/fanout-write-stream.js.map +1 -0
  238. package/ts/src/utils/get-params-result.d.ts +19 -0
  239. package/ts/src/utils/get-params-result.d.ts.map +1 -0
  240. package/ts/src/utils/get-params-result.js +58 -0
  241. package/ts/src/utils/get-params-result.js.map +1 -0
  242. package/ts/{utils → src/utils}/index.d.ts +1 -0
  243. package/ts/src/utils/index.d.ts.map +1 -0
  244. package/ts/{utils → src/utils}/index.js +1 -0
  245. package/ts/src/utils/index.js.map +1 -0
  246. package/ts/src/utils/rebuffer.d.ts.map +1 -0
  247. package/ts/{utils → src/utils}/rebuffer.js +7 -1
  248. package/ts/src/utils/rebuffer.js.map +1 -0
  249. package/ts/src/utils/rebuffer.test.d.ts.map +1 -0
  250. package/ts/src/utils/rebuffer.test.js.map +1 -0
  251. package/ts/src/utils/relative-path.d.ts.map +1 -0
  252. package/ts/src/utils/relative-path.js.map +1 -0
  253. package/ts/src/utils/relative-path.test.d.ts.map +1 -0
  254. package/ts/src/utils/relative-path.test.js.map +1 -0
  255. package/ts/src/utils/stream-map.d.ts.map +1 -0
  256. package/ts/src/utils/stream-map.js.map +1 -0
  257. package/ts/src/utils/stream-map.test.d.ts.map +1 -0
  258. package/ts/src/utils/stream-map.test.js.map +1 -0
  259. package/ts/src/utils/stream-test-helper.d.ts.map +1 -0
  260. package/ts/{utils → src/utils}/stream-test-helper.js +18 -10
  261. package/ts/src/utils/stream-test-helper.js.map +1 -0
  262. package/ts/src/utils/stream2string.d.ts.map +1 -0
  263. package/ts/src/utils/stream2string.js.map +1 -0
  264. package/ts/src/utils/stream2string.test.d.ts.map +1 -0
  265. package/ts/src/utils/stream2string.test.js.map +1 -0
  266. package/ts/src/utils/string2stream.d.ts.map +1 -0
  267. package/ts/src/utils/string2stream.js.map +1 -0
  268. package/ts/src/utils/string2stream.test.d.ts.map +1 -0
  269. package/ts/src/utils/string2stream.test.js.map +1 -0
  270. package/ts/src/utils/stripper.d.ts +3 -0
  271. package/ts/src/utils/stripper.d.ts.map +1 -0
  272. package/ts/src/utils/stripper.js.map +1 -0
  273. package/ts/src/utils/stripper.test.d.ts.map +1 -0
  274. package/ts/src/utils/stripper.test.js.map +1 -0
  275. package/ts/src/version.d.ts.map +1 -0
  276. package/ts/src/version.js.map +1 -0
  277. package/ts/src/web/index.d.ts.map +1 -0
  278. package/ts/src/web/index.js.map +1 -0
  279. package/ts/src/web/web-env-actions.d.ts +14 -0
  280. package/ts/src/web/web-env-actions.d.ts.map +1 -0
  281. package/ts/src/web/web-env-actions.js +35 -0
  282. package/ts/src/web/web-env-actions.js.map +1 -0
  283. package/ts/{web → src/web}/web-sys-abstraction.d.ts +1 -14
  284. package/ts/src/web/web-sys-abstraction.d.ts.map +1 -0
  285. package/ts/{web → src/web}/web-sys-abstraction.js +0 -34
  286. package/ts/src/web/web-sys-abstraction.js.map +1 -0
  287. package/ts/vitest.browser.config.d.ts +3 -0
  288. package/ts/vitest.browser.config.d.ts.map +1 -0
  289. package/ts/vitest.browser.config.js +17 -0
  290. package/ts/vitest.browser.config.js.map +1 -0
  291. package/ts/vitest.cf-runtime.config.d.ts +3 -0
  292. package/ts/vitest.cf-runtime.config.d.ts.map +1 -0
  293. package/ts/vitest.cf-runtime.config.js +16 -0
  294. package/ts/vitest.cf-runtime.config.js.map +1 -0
  295. package/ts/vitest.config.d.ts +3 -0
  296. package/ts/vitest.config.d.ts.map +1 -0
  297. package/ts/vitest.config.js +8 -0
  298. package/ts/vitest.config.js.map +1 -0
  299. package/ts/vitest.node.config.d.ts +3 -0
  300. package/ts/vitest.node.config.d.ts.map +1 -0
  301. package/ts/vitest.node.config.js +11 -0
  302. package/ts/vitest.node.config.js.map +1 -0
  303. package/ts/vitest.workspace.d.ts +3 -0
  304. package/ts/vitest.workspace.d.ts.map +1 -0
  305. package/ts/vitest.workspace.js +6 -0
  306. package/ts/vitest.workspace.js.map +1 -0
  307. package/utils/index.cjs +150 -3
  308. package/utils/index.cjs.map +1 -1
  309. package/utils/index.d.cts +2 -2
  310. package/utils/index.d.ts +2 -2
  311. package/utils/index.js +8 -3
  312. package/web/index.cjs +251 -239
  313. package/web/index.cjs.map +1 -1
  314. package/web/index.d.cts +5 -17
  315. package/web/index.d.ts +5 -17
  316. package/web/index.js +3 -4
  317. package/chunk-A7OPSHUV.js.map +0 -1
  318. package/chunk-HFP74WLI.js.map +0 -1
  319. package/chunk-P6LDM7PY.js.map +0 -1
  320. package/chunk-PPS4L4VW.js +0 -38
  321. package/chunk-PPS4L4VW.js.map +0 -1
  322. package/chunk-PRCFKZR7.js.map +0 -1
  323. package/ts/base-sys-abstraction.d.ts.map +0 -1
  324. package/ts/base-sys-abstraction.js.map +0 -1
  325. package/ts/base-sys-abstraction.test.d.ts.map +0 -1
  326. package/ts/base-sys-abstraction.test.js.map +0 -1
  327. package/ts/bin2text.d.ts.map +0 -1
  328. package/ts/bin2text.js.map +0 -1
  329. package/ts/bin2text.test.js.map +0 -1
  330. package/ts/cf/cf-sys-abstraction.d.ts +0 -25
  331. package/ts/cf/cf-sys-abstraction.d.ts.map +0 -1
  332. package/ts/cf/cf-sys-abstraction.js.map +0 -1
  333. package/ts/cf/index.d.ts.map +0 -1
  334. package/ts/cf/index.js.map +0 -1
  335. package/ts/crypto.d.ts.map +0 -1
  336. package/ts/crypto.js.map +0 -1
  337. package/ts/crypto.test.js.map +0 -1
  338. package/ts/deno/deno-file-service.d.ts.map +0 -1
  339. package/ts/deno/deno-file-service.js.map +0 -1
  340. package/ts/deno/deno-sys-abstraction.d.ts.map +0 -1
  341. package/ts/deno/deno-sys-abstraction.js.map +0 -1
  342. package/ts/deno/index.d.ts.map +0 -1
  343. package/ts/deno/index.js.map +0 -1
  344. package/ts/file-service.d.ts.map +0 -1
  345. package/ts/future.d.ts.map +0 -1
  346. package/ts/future.js.map +0 -1
  347. package/ts/future.test.js.map +0 -1
  348. package/ts/http_header.d.ts.map +0 -1
  349. package/ts/http_header.js.map +0 -1
  350. package/ts/http_header.test.d.ts.map +0 -1
  351. package/ts/http_header.test.js.map +0 -1
  352. package/ts/index.d.ts.map +0 -1
  353. package/ts/index.js.map +0 -1
  354. package/ts/log-level-impl.d.ts.map +0 -1
  355. package/ts/log-level-impl.js.map +0 -1
  356. package/ts/log-writer-impl.d.ts.map +0 -1
  357. package/ts/log-writer-impl.js.map +0 -1
  358. package/ts/logger-impl.d.ts.map +0 -1
  359. package/ts/logger-impl.js.map +0 -1
  360. package/ts/logger.d.ts.map +0 -1
  361. package/ts/logger.js.map +0 -1
  362. package/ts/logger.test.js.map +0 -1
  363. package/ts/node/index.d.ts.map +0 -1
  364. package/ts/node/index.js.map +0 -1
  365. package/ts/node/mock-file-service.d.ts.map +0 -1
  366. package/ts/node/mock-file-service.js.map +0 -1
  367. package/ts/node/mock-file-service.test.d.ts.map +0 -1
  368. package/ts/node/mock-file-service.test.js.map +0 -1
  369. package/ts/node/node-file-service.d.ts.map +0 -1
  370. package/ts/node/node-file-service.js.map +0 -1
  371. package/ts/node/node-sys-abstraction.d.ts.map +0 -1
  372. package/ts/node/node-sys-abstraction.js.map +0 -1
  373. package/ts/node/node-sys-abstraction.test.d.ts.map +0 -1
  374. package/ts/node/node-sys-abstraction.test.js.map +0 -1
  375. package/ts/option.d.ts.map +0 -1
  376. package/ts/option.js.map +0 -1
  377. package/ts/resolve-once.d.ts.map +0 -1
  378. package/ts/resolve-once.js.map +0 -1
  379. package/ts/resolve-once.test.d.ts.map +0 -1
  380. package/ts/resolve-once.test.js.map +0 -1
  381. package/ts/result.d.ts.map +0 -1
  382. package/ts/result.js.map +0 -1
  383. package/ts/result.test.js.map +0 -1
  384. package/ts/runtime.d.ts.map +0 -1
  385. package/ts/runtime.js.map +0 -1
  386. package/ts/sys-abstraction.d.ts.map +0 -1
  387. package/ts/sys-abstraction.js.map +0 -1
  388. package/ts/sys-env.d.ts.map +0 -1
  389. package/ts/sys-env.js.map +0 -1
  390. package/ts/sys-env.test.js.map +0 -1
  391. package/ts/test/index.d.ts.map +0 -1
  392. package/ts/test/index.js.map +0 -1
  393. package/ts/test/log-write-stream.d.ts.map +0 -1
  394. package/ts/test/log-write-stream.js.map +0 -1
  395. package/ts/test/mock-logger.d.ts.map +0 -1
  396. package/ts/test/mock-logger.js.map +0 -1
  397. package/ts/test/mock-logger.test.d.ts.map +0 -1
  398. package/ts/test/mock-logger.test.js.map +0 -1
  399. package/ts/test/test-exit-handler.d.ts.map +0 -1
  400. package/ts/test/test-exit-handler.js.map +0 -1
  401. package/ts/time.d.ts.map +0 -1
  402. package/ts/time.js.map +0 -1
  403. package/ts/tracer.d.ts.map +0 -1
  404. package/ts/tracer.js.map +0 -1
  405. package/ts/tracer.test.js.map +0 -1
  406. package/ts/txt-en-decoder.d.ts.map +0 -1
  407. package/ts/txt-en-decoder.js.map +0 -1
  408. package/ts/uri.d.ts.map +0 -1
  409. package/ts/uri.js.map +0 -1
  410. package/ts/uri.test.js.map +0 -1
  411. package/ts/utils/console-write-stream.d.ts.map +0 -1
  412. package/ts/utils/console-write-stream.js.map +0 -1
  413. package/ts/utils/fanout-write-stream.d.ts.map +0 -1
  414. package/ts/utils/fanout-write-stream.js.map +0 -1
  415. package/ts/utils/index.d.ts.map +0 -1
  416. package/ts/utils/index.js.map +0 -1
  417. package/ts/utils/rebuffer.d.ts.map +0 -1
  418. package/ts/utils/rebuffer.js.map +0 -1
  419. package/ts/utils/rebuffer.test.d.ts.map +0 -1
  420. package/ts/utils/rebuffer.test.js.map +0 -1
  421. package/ts/utils/relative-path.d.ts.map +0 -1
  422. package/ts/utils/relative-path.js.map +0 -1
  423. package/ts/utils/relative-path.test.d.ts.map +0 -1
  424. package/ts/utils/relative-path.test.js.map +0 -1
  425. package/ts/utils/stream-map.d.ts.map +0 -1
  426. package/ts/utils/stream-map.js.map +0 -1
  427. package/ts/utils/stream-map.test.d.ts.map +0 -1
  428. package/ts/utils/stream-map.test.js.map +0 -1
  429. package/ts/utils/stream-test-helper.d.ts.map +0 -1
  430. package/ts/utils/stream-test-helper.js.map +0 -1
  431. package/ts/utils/stream2string.d.ts.map +0 -1
  432. package/ts/utils/stream2string.js.map +0 -1
  433. package/ts/utils/stream2string.test.d.ts.map +0 -1
  434. package/ts/utils/stream2string.test.js.map +0 -1
  435. package/ts/utils/string2stream.d.ts.map +0 -1
  436. package/ts/utils/string2stream.js.map +0 -1
  437. package/ts/utils/string2stream.test.d.ts.map +0 -1
  438. package/ts/utils/string2stream.test.js.map +0 -1
  439. package/ts/utils/stripper.d.ts +0 -3
  440. package/ts/utils/stripper.d.ts.map +0 -1
  441. package/ts/utils/stripper.js.map +0 -1
  442. package/ts/utils/stripper.test.d.ts.map +0 -1
  443. package/ts/utils/stripper.test.js.map +0 -1
  444. package/ts/version.d.ts.map +0 -1
  445. package/ts/version.js.map +0 -1
  446. package/ts/web/index.d.ts.map +0 -1
  447. package/ts/web/index.js.map +0 -1
  448. package/ts/web/web-sys-abstraction.d.ts.map +0 -1
  449. package/ts/web/web-sys-abstraction.js.map +0 -1
  450. package/txt-en-decoder-CZYJUju2.d.cts +0 -11
  451. package/txt-en-decoder-CZYJUju2.d.ts +0 -11
  452. /package/ts/{base-sys-abstraction.test.d.ts → src/base-sys-abstraction.test.d.ts} +0 -0
  453. /package/ts/{base-sys-abstraction.test.js → src/base-sys-abstraction.test.js} +0 -0
  454. /package/ts/{bin2text.d.ts → src/bin2text.d.ts} +0 -0
  455. /package/ts/{bin2text.js → src/bin2text.js} +0 -0
  456. /package/ts/{bin2text.test.d.ts → src/bin2text.test.d.ts} +0 -0
  457. /package/ts/{bin2text.test.js → src/bin2text.test.js} +0 -0
  458. /package/ts/{cf → src/cf}/index.d.ts +0 -0
  459. /package/ts/{cf → src/cf}/index.js +0 -0
  460. /package/ts/{crypto.d.ts → src/crypto.d.ts} +0 -0
  461. /package/ts/{crypto.js → src/crypto.js} +0 -0
  462. /package/ts/{crypto.test.d.ts → src/crypto.test.d.ts} +0 -0
  463. /package/ts/{deno → src/deno}/deno-file-service.d.ts +0 -0
  464. /package/ts/{deno → src/deno}/deno-file-service.js +0 -0
  465. /package/ts/{deno → src/deno}/index.d.ts +0 -0
  466. /package/ts/{deno → src/deno}/index.js +0 -0
  467. /package/ts/{file-service.d.ts → src/file-service.d.ts} +0 -0
  468. /package/ts/{file-service.js → src/file-service.js} +0 -0
  469. /package/ts/{future.d.ts → src/future.d.ts} +0 -0
  470. /package/ts/{future.js → src/future.js} +0 -0
  471. /package/ts/{future.test.d.ts → src/future.test.d.ts} +0 -0
  472. /package/ts/{future.test.js → src/future.test.js} +0 -0
  473. /package/ts/{http_header.d.ts → src/http_header.d.ts} +0 -0
  474. /package/ts/{http_header.js → src/http_header.js} +0 -0
  475. /package/ts/{http_header.test.d.ts → src/http_header.test.d.ts} +0 -0
  476. /package/ts/{http_header.test.js → src/http_header.test.js} +0 -0
  477. /package/ts/{log-level-impl.d.ts → src/log-level-impl.d.ts} +0 -0
  478. /package/ts/{log-level-impl.js → src/log-level-impl.js} +0 -0
  479. /package/ts/{log-writer-impl.d.ts → src/log-writer-impl.d.ts} +0 -0
  480. /package/ts/{logger.js → src/logger.js} +0 -0
  481. /package/ts/{logger.test.d.ts → src/logger.test.d.ts} +0 -0
  482. /package/ts/{node → src/node}/index.d.ts +0 -0
  483. /package/ts/{node → src/node}/index.js +0 -0
  484. /package/ts/{node → src/node}/mock-file-service.d.ts +0 -0
  485. /package/ts/{node → src/node}/mock-file-service.test.d.ts +0 -0
  486. /package/ts/{node → src/node}/mock-file-service.test.js +0 -0
  487. /package/ts/{node → src/node}/node-file-service.d.ts +0 -0
  488. /package/ts/{node → src/node}/node-file-service.js +0 -0
  489. /package/ts/{node → src/node}/node-sys-abstraction.test.d.ts +0 -0
  490. /package/ts/{node → src/node}/node-sys-abstraction.test.js +0 -0
  491. /package/ts/{option.d.ts → src/option.d.ts} +0 -0
  492. /package/ts/{option.js → src/option.js} +0 -0
  493. /package/ts/{resolve-once.test.d.ts → src/resolve-once.test.d.ts} +0 -0
  494. /package/ts/{result.d.ts → src/result.d.ts} +0 -0
  495. /package/ts/{result.js → src/result.js} +0 -0
  496. /package/ts/{result.test.d.ts → src/result.test.d.ts} +0 -0
  497. /package/ts/{runtime.d.ts → src/runtime.d.ts} +0 -0
  498. /package/ts/{runtime.js → src/runtime.js} +0 -0
  499. /package/ts/{sys-abstraction.d.ts → src/sys-abstraction.d.ts} +0 -0
  500. /package/ts/{sys-abstraction.js → src/sys-abstraction.js} +0 -0
  501. /package/ts/{sys-env.test.d.ts → src/sys-env.test.d.ts} +0 -0
  502. /package/ts/{test → src/test}/index.d.ts +0 -0
  503. /package/ts/{test → src/test}/index.js +0 -0
  504. /package/ts/{test → src/test}/log-write-stream.d.ts +0 -0
  505. /package/ts/{test → src/test}/log-write-stream.js +0 -0
  506. /package/ts/{test → src/test}/mock-logger.d.ts +0 -0
  507. /package/ts/{test → src/test}/mock-logger.js +0 -0
  508. /package/ts/{test → src/test}/mock-logger.test.d.ts +0 -0
  509. /package/ts/{test → src/test}/mock-logger.test.js +0 -0
  510. /package/ts/{test → src/test}/test-exit-handler.d.ts +0 -0
  511. /package/ts/{time.d.ts → src/time.d.ts} +0 -0
  512. /package/ts/{time.js → src/time.js} +0 -0
  513. /package/ts/{tracer.d.ts → src/tracer.d.ts} +0 -0
  514. /package/ts/{tracer.js → src/tracer.js} +0 -0
  515. /package/ts/{tracer.test.d.ts → src/tracer.test.d.ts} +0 -0
  516. /package/ts/{txt-en-decoder.d.ts → src/txt-en-decoder.d.ts} +0 -0
  517. /package/ts/{txt-en-decoder.js → src/txt-en-decoder.js} +0 -0
  518. /package/ts/{uri.test.d.ts → src/uri.test.d.ts} +0 -0
  519. /package/ts/{utils → src/utils}/fanout-write-stream.js +0 -0
  520. /package/ts/{utils → src/utils}/rebuffer.d.ts +0 -0
  521. /package/ts/{utils → src/utils}/rebuffer.test.d.ts +0 -0
  522. /package/ts/{utils → src/utils}/rebuffer.test.js +0 -0
  523. /package/ts/{utils → src/utils}/relative-path.d.ts +0 -0
  524. /package/ts/{utils → src/utils}/relative-path.js +0 -0
  525. /package/ts/{utils → src/utils}/relative-path.test.d.ts +0 -0
  526. /package/ts/{utils → src/utils}/relative-path.test.js +0 -0
  527. /package/ts/{utils → src/utils}/stream-map.d.ts +0 -0
  528. /package/ts/{utils → src/utils}/stream-map.js +0 -0
  529. /package/ts/{utils → src/utils}/stream-map.test.d.ts +0 -0
  530. /package/ts/{utils → src/utils}/stream-map.test.js +0 -0
  531. /package/ts/{utils → src/utils}/stream-test-helper.d.ts +0 -0
  532. /package/ts/{utils → src/utils}/stream2string.d.ts +0 -0
  533. /package/ts/{utils → src/utils}/stream2string.js +0 -0
  534. /package/ts/{utils → src/utils}/stream2string.test.d.ts +0 -0
  535. /package/ts/{utils → src/utils}/stream2string.test.js +0 -0
  536. /package/ts/{utils → src/utils}/string2stream.d.ts +0 -0
  537. /package/ts/{utils → src/utils}/string2stream.js +0 -0
  538. /package/ts/{utils → src/utils}/string2stream.test.d.ts +0 -0
  539. /package/ts/{utils → src/utils}/string2stream.test.js +0 -0
  540. /package/ts/{utils → src/utils}/stripper.js +0 -0
  541. /package/ts/{utils → src/utils}/stripper.test.d.ts +0 -0
  542. /package/ts/{utils → src/utils}/stripper.test.js +0 -0
  543. /package/ts/{version.d.ts → src/version.d.ts} +0 -0
  544. /package/ts/{version.js → src/version.js} +0 -0
  545. /package/ts/{web → src/web}/index.d.ts +0 -0
  546. /package/ts/{web → src/web}/index.js +0 -0
package/node/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/node/mock-file-service.ts"],"sourcesContent":["import { NamedWritableStream } from \"../file-service.js\";\nimport { NodeFileService } from \"./node-file-service.js\";\n\nexport interface FileCollector {\n readonly name: string;\n content: string;\n}\n\nexport class MockFileService extends NodeFileService {\n readonly files = {} as Record<string, FileCollector>;\n\n // override abs(fname: string): string {\n // return this.join(\"/mock/\", fname);\n // }\n\n override async create(fname: string): Promise<NamedWritableStream> {\n let oName = fname;\n if (!this.isAbsolute(fname)) {\n oName = await this.abs(fname);\n }\n\n const fc = {\n name: oName,\n content: \"\",\n };\n this.files[oName] = fc;\n this.files[fname] = fc;\n const decoder = new TextDecoder();\n\n return {\n name: oName,\n stream: new WritableStream<Uint8Array>({\n write(chunk): void {\n fc.content = fc.content + decoder.decode(chunk);\n },\n close(): void {\n // do nothing\n },\n abort(): void {\n throw new Error(\"not implemented\");\n },\n }),\n };\n }\n}\n"],"mappings":";;;;;;;;;;AAQO,IAAM,kBAAN,cAA8B,gBAAgB;AAAA,EAA9C;AAAA;AACL,SAAS,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlB,MAAe,OAAO,OAA6C;AACjE,QAAI,QAAQ;AACZ,QAAI,CAAC,KAAK,WAAW,KAAK,GAAG;AAC3B,cAAQ,MAAM,KAAK,IAAI,KAAK;AAAA,IAC9B;AAEA,UAAM,KAAK;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AACA,SAAK,MAAM,KAAK,IAAI;AACpB,SAAK,MAAM,KAAK,IAAI;AACpB,UAAM,UAAU,IAAI,YAAY;AAEhC,WAAO;AAAA,MACL,MAAM;AAAA,MACN,QAAQ,IAAI,eAA2B;AAAA,QACrC,MAAM,OAAa;AACjB,aAAG,UAAU,GAAG,UAAU,QAAQ,OAAO,KAAK;AAAA,QAChD;AAAA,QACA,QAAc;AAAA,QAEd;AAAA,QACA,QAAc;AACZ,gBAAM,IAAI,MAAM,iBAAiB;AAAA,QACnC;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/node/node-file-service.ts","../../../src/node/node-sys-abstraction.ts","../../../src/node/mock-file-service.ts"],"sourcesContent":["import path from \"node:path\";\nimport fs from \"node:fs\";\nimport process from \"node:process\";\nimport { FileService, NamedWritableStream } from \"../file-service.js\";\nimport { TxtEnDecoder, Utf8EnDecoderSingleton } from \"../txt-en-decoder.js\";\n\nexport class NodeFileService implements FileService {\n readonly baseDir: string;\n constructor(baseDir: string = process.cwd()) {\n this.baseDir = this.abs(baseDir);\n }\n\n // nodeImport(fname: string): string {\n // // console.log('nodeImport:'+ fname);\n // if (path.isAbsolute(fname)) {\n // return fname;\n // } else {\n // return \"./\" + path.normalize(fname);\n // }\n // }\n\n readFileString(fname: string): Promise<string> {\n return fs.promises.readFile(fname, { encoding: \"utf-8\" });\n }\n\n dirname(fname: string): string {\n return path.dirname(fname);\n }\n basename(fname: string): string {\n return path.basename(fname);\n }\n\n join(...paths: string[]): string {\n return path.join(...paths);\n }\n\n relative(from: string, to?: string): string {\n if (to === undefined) {\n to = from;\n from = process.cwd();\n }\n const ret = path.relative(from, to);\n // console.log('relative:'+ from + \" -> \" + to + \"= \" + ret);\n return ret;\n }\n\n abs(fname: string): string {\n if (path.isAbsolute(fname)) {\n return fname;\n } else {\n const cwd = process.cwd();\n return path.resolve(cwd, fname);\n }\n }\n\n isAbsolute(fname: string): boolean {\n return path.isAbsolute(fname);\n }\n\n async writeFileString(fname: string, content: string, ende: TxtEnDecoder = Utf8EnDecoderSingleton()): Promise<void> {\n const o = await this.create(fname);\n const wr = o.stream.getWriter();\n await wr.write(ende.encode(content));\n await wr.close();\n }\n\n async create(fname: string): Promise<NamedWritableStream> {\n let oName = fname;\n if (!path.isAbsolute(fname)) {\n oName = this.abs(fname);\n }\n\n const base = path.dirname(oName);\n await fs.promises.mkdir(base, { recursive: true });\n const out = fs.createWriteStream(oName);\n return {\n name: oName,\n stream: new WritableStream<Uint8Array>({\n write(chunk): void {\n out.write(chunk);\n },\n close(): void {\n out.close();\n },\n abort(): void {\n throw new Error(\"not implemented\");\n },\n }),\n };\n }\n}\n","import { SysAbstraction, SystemService, VoidFunc } from \"../sys-abstraction.js\";\nimport {\n BaseSysAbstraction,\n ExitHandler,\n ExitService,\n WrapperSysAbstraction,\n WrapperSysAbstractionParams,\n} from \"../base-sys-abstraction.js\";\nimport { NodeFileService } from \"./node-file-service.js\";\nimport { Env, envFactory } from \"../sys-env.js\";\nimport { Utf8EnDecoderSingleton } from \"../txt-en-decoder.js\";\nimport process from \"node:process\";\n\nexport class NodeExitServiceImpl implements ExitService {\n constructor() {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n process.on(\"unhandledRejection\", (reason: string, p: Promise<unknown>) => {\n this.exit(19);\n });\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n process.on(\"uncaughtException\", (error: Error) => {\n this.exit(18);\n });\n process.on(\"close\", () => {\n this.exit(0);\n });\n process.on(\"exit\", () => {\n this.exit(0);\n });\n process.on(\"SIGQUIT\", () => {\n this.exit(3);\n });\n process.on(\"SIGINT\", () => {\n this.exit(2);\n });\n process.on(\"SIGTERM\", () => {\n this.exit(9);\n });\n }\n _exitHandlers: ExitHandler[] = [];\n injectExitHandlers(hdls: ExitHandler[]): void {\n // console.log(\"ExitService: injecting exit handlers\", hdls)\n this._exitHandlers = hdls;\n }\n invoked = false;\n readonly _handleExit = async (): Promise<void> => {\n if (this.invoked) {\n // console.error(\"ExitService: already invoked\");\n return;\n }\n this.invoked = true;\n for (const h of this._exitHandlers) {\n try {\n // console.log(`ExitService: calling handler ${h.id}`)\n const ret = h.hdl();\n // console.log(`ExitService: called handler ${h.id}`, ret)\n if (typeof (ret as Promise<void>).then === \"function\") {\n await ret;\n }\n } finally {\n // ignore\n }\n }\n };\n\n exit(code: number): void {\n // console.log(\"ExitService: exit called\", code)\n this._handleExit()\n .then(() => {\n process.exit(code);\n })\n .catch((err) => {\n // eslint-disable-next-line no-console\n console.error(\"ExitService: failed to handle exit\", err);\n process.exit(code);\n });\n }\n}\n\nexport class NodeSystemService implements SystemService {\n static readonly _exitHandlers: ExitHandler[] = [];\n readonly _exitService: ExitService = new NodeExitServiceImpl();\n constructor() {\n this._exitService.injectExitHandlers(NodeSystemService._exitHandlers);\n }\n\n Env(): Env {\n return envFactory();\n }\n\n Args(): string[] {\n return process.argv;\n }\n\n OnExit(hdl: VoidFunc): VoidFunc {\n const id = crypto.randomUUID();\n NodeSystemService._exitHandlers.push({ hdl, id });\n return () => {\n const idx = NodeSystemService._exitHandlers.findIndex((h) => h.id === id);\n if (idx >= 0) {\n NodeSystemService._exitHandlers.splice(idx, 1);\n }\n };\n }\n\n Exit(code: number): void {\n this._exitService.exit(code);\n }\n}\n\nlet my: BaseSysAbstraction | undefined = undefined;\nexport function NodeSysAbstraction(param?: WrapperSysAbstractionParams): SysAbstraction {\n if (!my) {\n my = new BaseSysAbstraction({\n TxtEnDecoder: param?.TxtEnDecoder || Utf8EnDecoderSingleton(),\n FileSystem: new NodeFileService(),\n SystemService: new NodeSystemService(),\n });\n }\n return new WrapperSysAbstraction(my, param);\n}\n","import { NamedWritableStream } from \"../file-service.js\";\nimport { NodeFileService } from \"./node-file-service.js\";\n\nexport interface FileCollector {\n readonly name: string;\n content: string;\n}\n\nexport class MockFileService extends NodeFileService {\n readonly files = {} as Record<string, FileCollector>;\n\n // override abs(fname: string): string {\n // return this.join(\"/mock/\", fname);\n // }\n\n override create(fname: string): Promise<NamedWritableStream> {\n let oName = fname;\n if (!this.isAbsolute(fname)) {\n oName = this.abs(fname);\n }\n\n const fc = {\n name: oName,\n content: \"\",\n };\n this.files[oName] = fc;\n this.files[fname] = fc;\n const decoder = new TextDecoder();\n\n return Promise.resolve({\n name: oName,\n stream: new WritableStream<Uint8Array>({\n write(chunk): void {\n fc.content = fc.content + decoder.decode(chunk);\n },\n close(): void {\n // do nothing\n },\n abort(): void {\n throw new Error(\"not implemented\");\n },\n }),\n });\n }\n}\n"],"mappings":"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","names":["process"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adviser/cement",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "better try/catch/finally handling",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -152,16 +152,16 @@ function consumeReadableStream(
152
152
  });
153
153
  }
154
154
 
155
- function CFWriteableStream(writeFn: (chunk: Uint8Array) => Promise<void>): WritableStream {
156
- const ts = new TransformStream();
155
+ function CFWriteableStream(writeFn: (chunk: Uint8Array) => Promise<void>): WritableStream<Uint8Array> {
156
+ const ts = new TransformStream<Uint8Array, Uint8Array>();
157
157
  consumeReadableStream(ts.readable.getReader(), writeFn);
158
158
  return ts.writable;
159
159
  }
160
160
 
161
161
  export class BaseSysAbstraction {
162
162
  readonly _time: SysTime = new SysTime();
163
- readonly _stdout: WritableStream;
164
- readonly _stderr: WritableStream;
163
+ readonly _stdout: WritableStream<Uint8Array>;
164
+ readonly _stderr: WritableStream<Uint8Array>;
165
165
 
166
166
  readonly _idService: IdService = new IdService();
167
167
  readonly _randomService: RandomService = new RandomService(RandomMode.RANDOM);
@@ -174,15 +174,17 @@ export class BaseSysAbstraction {
174
174
  this._systemService = params.SystemService;
175
175
  this._txtEnDe = params.TxtEnDecoder;
176
176
  const decoder = this._txtEnDe;
177
- this._stdout = CFWriteableStream(async (chunk) => {
177
+ this._stdout = CFWriteableStream((chunk) => {
178
178
  const decoded = decoder.decode(chunk);
179
179
  // eslint-disable-next-line no-console
180
180
  console.log(decoded.trimEnd());
181
+ return Promise.resolve();
181
182
  });
182
- this._stderr = CFWriteableStream(async (chunk) => {
183
+ this._stderr = CFWriteableStream((chunk) => {
183
184
  const decoded = decoder.decode(chunk);
184
185
  // eslint-disable-next-line no-console
185
186
  console.error(decoded.trimEnd());
187
+ return Promise.resolve();
186
188
  });
187
189
  /* this is not CF worker compatible
188
190
  this._stdout = new WritableStream({
@@ -0,0 +1,53 @@
1
+ import { ResolveOnce } from "../resolve-once.js";
2
+ import { runtimeFn } from "../runtime.js";
3
+ import { EnvActions, EnvImpl, EnvFactoryOpts, Env } from "../sys-env.js";
4
+
5
+ const once = new ResolveOnce<CFEnvActions>();
6
+ export class CFEnvActions implements EnvActions {
7
+ readonly injectOnRegister: Record<string, string> = {};
8
+ readonly cfEnv: Map<string, string>;
9
+ env?: EnvImpl;
10
+ static new(opts: Partial<EnvFactoryOpts>): EnvActions {
11
+ return once.once(() => new CFEnvActions(opts));
12
+ }
13
+ static inject(o: Record<string, string>): void {
14
+ const env = CFEnvActions.new({}) as CFEnvActions;
15
+ for (const key in o) {
16
+ const value = o[key];
17
+ if (typeof value === "string") {
18
+ if (env.env) {
19
+ env.env.set(key, value);
20
+ } else {
21
+ env.injectOnRegister[key] = value;
22
+ }
23
+ }
24
+ }
25
+ }
26
+ private constructor(env: Partial<EnvFactoryOpts>) {
27
+ this.cfEnv = new Map<string, string>(Object.entries(env.presetEnv || {}));
28
+ }
29
+ active(): boolean {
30
+ return runtimeFn().isCFWorker;
31
+ }
32
+ register(env: Env): Env {
33
+ this.env = env as EnvImpl;
34
+ for (const key in this.injectOnRegister) {
35
+ env.set(key, this.injectOnRegister[key]);
36
+ }
37
+ return env;
38
+ }
39
+ get(key: string): string | undefined {
40
+ return this.cfEnv.get(key);
41
+ }
42
+ set(key: string, value?: string): void {
43
+ if (value) {
44
+ this.cfEnv.set(key, value);
45
+ }
46
+ }
47
+ delete(key: string): void {
48
+ this.cfEnv.delete(key);
49
+ }
50
+ keys(): string[] {
51
+ return Array.from(this.cfEnv.keys());
52
+ }
53
+ }
@@ -1,61 +1,9 @@
1
1
  import { BaseSysAbstraction, WrapperSysAbstraction, WrapperSysAbstractionParams } from "../base-sys-abstraction.js";
2
- import { ResolveOnce } from "../resolve-once.js";
3
- import { runtimeFn } from "../runtime.js";
4
2
  import { SysAbstraction, SystemService, VoidFunc } from "../sys-abstraction.js";
5
- import { Env, EnvActions, envFactory, EnvFactoryOpts, EnvImpl } from "../sys-env.js";
3
+ import { Env, envFactory } from "../sys-env.js";
6
4
  import { Utf8EnDecoderSingleton } from "../txt-en-decoder.js";
7
5
  import { WebFileService } from "../web/web-sys-abstraction.js";
8
6
 
9
- const once = new ResolveOnce<CFEnvActions>();
10
- export class CFEnvActions implements EnvActions {
11
- readonly injectOnRegister: Record<string, string> = {};
12
- readonly cfEnv: Map<string, string>;
13
- env?: EnvImpl;
14
- static new(opts: Partial<EnvFactoryOpts>): EnvActions {
15
- return once.once(() => new CFEnvActions(opts));
16
- }
17
- static inject(o: Record<string, string>): void {
18
- const env = CFEnvActions.new({}) as CFEnvActions;
19
- for (const key in o) {
20
- const value = o[key];
21
- if (typeof value === "string") {
22
- if (env.env) {
23
- env.env.set(key, value);
24
- } else {
25
- env.injectOnRegister[key] = value;
26
- }
27
- }
28
- }
29
- }
30
- private constructor(env: Partial<EnvFactoryOpts>) {
31
- this.cfEnv = new Map<string, string>(Object.entries(env.presetEnv || {}));
32
- }
33
- active(): boolean {
34
- return runtimeFn().isCFWorker;
35
- }
36
- register(env: Env): Env {
37
- this.env = env as EnvImpl;
38
- for (const key in this.injectOnRegister) {
39
- env.set(key, this.injectOnRegister[key]);
40
- }
41
- return env;
42
- }
43
- get(key: string): string | undefined {
44
- return this.cfEnv.get(key);
45
- }
46
- set(key: string, value?: string): void {
47
- if (value) {
48
- this.cfEnv.set(key, value);
49
- }
50
- }
51
- delete(key: string): void {
52
- this.cfEnv.delete(key);
53
- }
54
- keys(): string[] {
55
- return Array.from(this.cfEnv.keys());
56
- }
57
- }
58
-
59
7
  export class CFSystemService implements SystemService {
60
8
  Env(): Env {
61
9
  return envFactory();
@@ -0,0 +1,5 @@
1
+ export default {
2
+ fetch(): Response {
3
+ return new Response("Hello World!");
4
+ },
5
+ };
@@ -0,0 +1,57 @@
1
+ import { ResolveOnce } from "../resolve-once.js";
2
+ import { runtimeFn } from "../runtime.js";
3
+ import { Env, EnvActions, EnvFactoryOpts } from "../sys-env.js";
4
+
5
+ interface DenoEnv {
6
+ get: (key: string) => string | undefined;
7
+ toObject: () => Record<string, string>;
8
+ set: (key: string, value: string) => void;
9
+ has: (key: string) => boolean;
10
+ delete: (key: string) => void;
11
+ }
12
+
13
+ const once = new ResolveOnce<DenoEnvActions>();
14
+ export class DenoEnvActions implements EnvActions {
15
+ readonly #deno = globalThis as unknown as {
16
+ Deno: {
17
+ env: DenoEnv;
18
+ };
19
+ };
20
+
21
+ static new(opts: Partial<EnvFactoryOpts>): EnvActions {
22
+ return once.once(() => new DenoEnvActions(opts));
23
+ }
24
+
25
+ get _env(): DenoEnv {
26
+ return this.#deno.Deno.env;
27
+ }
28
+
29
+ readonly opts: Partial<EnvFactoryOpts>;
30
+ private constructor(opts: Partial<EnvFactoryOpts>) {
31
+ this.opts = opts;
32
+ }
33
+
34
+ register(env: Env): Env {
35
+ for (const key of env.keys()) {
36
+ this._env.set(key, env.get(key) || "");
37
+ }
38
+ return env;
39
+ }
40
+ active(): boolean {
41
+ return runtimeFn().isDeno;
42
+ }
43
+ keys(): string[] {
44
+ return Object.keys(this._env.toObject());
45
+ }
46
+ get(key: string): string | undefined {
47
+ return this._env.get(key);
48
+ }
49
+ set(key: string, value?: string): void {
50
+ if (value) {
51
+ this._env.set(key, value);
52
+ }
53
+ }
54
+ delete(key: string): void {
55
+ this._env.delete(key);
56
+ }
57
+ }
@@ -6,7 +6,7 @@ const Deno = (globalThis as unknown as { Deno: unknown }).Deno as {
6
6
  cwd(): string;
7
7
  readFile(fname: string): Promise<Uint8Array>;
8
8
  mkdir(base: string, options: { recursive: boolean }): Promise<void>;
9
- open(fname: string, options: { write: boolean; create: boolean; truncate: boolean }): Promise<WritableStream>;
9
+ open(fname: string, options: { write: boolean; create: boolean; truncate: boolean }): Promise<WritableStream<Uint8Array>>;
10
10
  };
11
11
 
12
12
  export class DenoFileService implements FileService {
@@ -5,10 +5,8 @@ import {
5
5
  WrapperSysAbstractionParams,
6
6
  WrapperSysAbstraction,
7
7
  } from "../base-sys-abstraction.js";
8
- import { ResolveOnce } from "../resolve-once.js";
9
- import { runtimeFn } from "../runtime.js";
10
8
  import { SysAbstraction, SystemService, VoidFunc } from "../sys-abstraction.js";
11
- import { Env, EnvActions, envFactory, EnvFactoryOpts } from "../sys-env.js";
9
+ import { Env, envFactory } from "../sys-env.js";
12
10
  import { Utf8EnDecoderSingleton } from "../txt-en-decoder.js";
13
11
  // import * as process from "node:process";
14
12
  import { DenoFileService } from "./deno-file-service.js";
@@ -19,60 +17,6 @@ const Deno = (globalThis as unknown as { Deno: unknown }).Deno as {
19
17
  args: string[];
20
18
  };
21
19
 
22
- interface DenoEnv {
23
- get: (key: string) => string | undefined;
24
- toObject: () => Record<string, string>;
25
- set: (key: string, value: string) => void;
26
- has: (key: string) => boolean;
27
- delete: (key: string) => void;
28
- }
29
-
30
- const once = new ResolveOnce<DenoEnvActions>();
31
- export class DenoEnvActions implements EnvActions {
32
- readonly #deno = globalThis as unknown as {
33
- Deno: {
34
- env: DenoEnv;
35
- };
36
- };
37
-
38
- static new(opts: Partial<EnvFactoryOpts>): EnvActions {
39
- return once.once(() => new DenoEnvActions(opts));
40
- }
41
-
42
- get _env(): DenoEnv {
43
- return this.#deno.Deno.env;
44
- }
45
-
46
- readonly opts: Partial<EnvFactoryOpts>;
47
- private constructor(opts: Partial<EnvFactoryOpts>) {
48
- this.opts = opts;
49
- }
50
-
51
- register(env: Env): Env {
52
- for (const key of env.keys()) {
53
- this._env.set(key, env.get(key) || "");
54
- }
55
- return env;
56
- }
57
- active(): boolean {
58
- return runtimeFn().isDeno;
59
- }
60
- keys(): string[] {
61
- return Object.keys(this._env.toObject());
62
- }
63
- get(key: string): string | undefined {
64
- return this._env.get(key);
65
- }
66
- set(key: string, value?: string): void {
67
- if (value) {
68
- this._env.set(key, value);
69
- }
70
- }
71
- delete(key: string): void {
72
- this._env.delete(key);
73
- }
74
- }
75
-
76
20
  export class DenoExitServiceImpl implements ExitService {
77
21
  constructor() {
78
22
  globalThis.addEventListener("unhandledrejection", (e) => {
@@ -44,7 +44,7 @@ export class HttpHeader {
44
44
  const h = new HttpHeader();
45
45
  if (headers) {
46
46
  if (Array.isArray(headers)) {
47
- for (const [k, v] of headers) {
47
+ for (const [k, v] of headers as [string, string][]) {
48
48
  if (v) {
49
49
  h.Add(k, v);
50
50
  }
package/src/index.ts CHANGED
@@ -20,3 +20,6 @@ export * from "./bin2text.js";
20
20
  export * from "./version.js";
21
21
  export * from "./http_header.js";
22
22
  export * as utils from "./utils/index.js";
23
+ // ugly
24
+ import * as utils from "./utils/index.js";
25
+ export const param = utils.param;
package/src/jsr.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adviser/cement",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./web": "./web/index.ts",
@@ -14,7 +14,7 @@ export class LogWriterStream {
14
14
  const writer = this._out.getWriter();
15
15
  await writer.ready;
16
16
  await writer.write(encoded);
17
- await writer.releaseLock();
17
+ writer.releaseLock();
18
18
  } catch (err) {
19
19
  // eslint-disable-next-line no-console
20
20
  console.error("Chunk error:", err);
@@ -50,9 +50,14 @@ export class LogWriterStream {
50
50
 
51
51
  // console.log(">>>Msg:", this._toFlush.length)
52
52
  const my = this._toFlush.shift();
53
- my?.().finally(() => {
54
- // console.log("<<<Msg:", this._toFlush.length)
55
- this._flush(this._toFlush);
56
- });
53
+ my?.()
54
+ .catch((e) => {
55
+ // eslint-disable-next-line no-console
56
+ console.error("Flush error:", e);
57
+ })
58
+ .finally(() => {
59
+ // console.log("<<<Msg:", this._toFlush.length)
60
+ this._flush(this._toFlush);
61
+ });
57
62
  }
58
63
  }
@@ -13,7 +13,6 @@ import {
13
13
  Sized,
14
14
  Lengthed,
15
15
  LogValue,
16
- asyncLogValue,
17
16
  LevelHandler,
18
17
  LogFormatter,
19
18
  LogValueArg,
@@ -176,7 +175,7 @@ export class LoggerImpl implements Logger {
176
175
  }
177
176
 
178
177
  Attributes(): Record<string, unknown> {
179
- return JSON.parse(JSON.stringify(this._attributes, null));
178
+ return JSON.parse(JSON.stringify(this._attributes, null)) as Record<string, unknown>;
180
179
  // return Array.from(Object.entries(this._attributes)).reduce(
181
180
  // (acc, [key, value]) => {
182
181
  // if (value instanceof LogValue) {
@@ -246,7 +245,7 @@ export class LoggerImpl implements Logger {
246
245
  this._attributes["level"] = logValue(Level.INFO, toLogValueCtx(this.levelHandler));
247
246
  return this;
248
247
  }
249
- Err(err: unknown | Result<unknown> | Error): Logger {
248
+ Err<T>(err: T | Result<T> | Error): Logger {
250
249
  let key = "error";
251
250
  if (Result.Is(err)) {
252
251
  if (err.isOk()) {
@@ -356,11 +355,13 @@ export class LoggerImpl implements Logger {
356
355
  return this;
357
356
  }
358
357
 
358
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
359
359
  Hash(value: unknown, key = "hash"): Logger {
360
- this._attributes[key] = asyncLogValue(
361
- async () => `${getLen(value, toLogValueCtx(this.levelHandler)).value()}:${await hash(value)}`,
362
- );
363
- return this;
360
+ throw new Error("Not implemented");
361
+ // this._attributes[key] = asyncLogValue(
362
+ // async () => `${getLen(value, toLogValueCtx(this.levelHandler)).value()}:${await hash(value)}`,
363
+ // );
364
+ // return this;
364
365
  }
365
366
 
366
367
  Url(url: CoerceURI, key = "url"): Logger {
@@ -592,7 +593,7 @@ class WithLoggerBuilder implements WithLogger {
592
593
  this._li.Timestamp();
593
594
  return this;
594
595
  }
595
- Any(key: string | Record<string, unknown>, value?: unknown | LogSerializable): WithLogger {
596
+ Any<T>(key: string | Record<string, unknown>, value?: T | LogSerializable): WithLogger {
596
597
  this._li.Any(key, value);
597
598
  return this;
598
599
  }
package/src/logger.ts CHANGED
@@ -75,7 +75,7 @@ function logValueInternal(val: LogValueArg, ctx: LogValueStateInternal): LogValu
75
75
  return new LogValue(val);
76
76
  case "string": {
77
77
  try {
78
- const ret = JSON.parse(val);
78
+ const ret = JSON.parse(val) as LogValueArg;
79
79
  if (typeof ret === "object" && ret !== null) {
80
80
  return logValueInternal(ret, ctx);
81
81
  }
@@ -108,7 +108,7 @@ function logValueInternal(val: LogValueArg, ctx: LogValueStateInternal): LogValu
108
108
  // should be injected
109
109
  const decoder = new TextDecoder();
110
110
  const asStr = decoder.decode(val);
111
- const obj = JSON.parse(asStr);
111
+ const obj = JSON.parse(asStr) as LogValueArg;
112
112
  return logValueInternal(obj, ctx);
113
113
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
114
114
  } catch (e) {
@@ -239,7 +239,7 @@ export interface LoggerInterface<R> {
239
239
  Log(): R;
240
240
  WithLevel(level: Level): R;
241
241
 
242
- Err(err: unknown | Result<unknown> | Error): R; // could be Error, or something which coerces to string
242
+ Err<T>(err: T | Result<T> | Error): R; // could be Error, or something which coerces to string
243
243
  Info(): R;
244
244
  Timestamp(): R;
245
245
  Dur(key: string, nsec: number): R;
@@ -266,8 +266,7 @@ export function IsLogger(obj: unknown): obj is Logger {
266
266
  "Dur",
267
267
  "Uint64",
268
268
  ]
269
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
270
- .map((fn) => typeof (obj as any)[fn] === "function")
269
+ .map((fn) => typeof (obj as Record<string, unknown>)[fn] === "function")
271
270
  .reduce((a, b) => a && b, true)
272
271
  );
273
272
  }
@@ -13,10 +13,10 @@ export class MockFileService extends NodeFileService {
13
13
  // return this.join("/mock/", fname);
14
14
  // }
15
15
 
16
- override async create(fname: string): Promise<NamedWritableStream> {
16
+ override create(fname: string): Promise<NamedWritableStream> {
17
17
  let oName = fname;
18
18
  if (!this.isAbsolute(fname)) {
19
- oName = await this.abs(fname);
19
+ oName = this.abs(fname);
20
20
  }
21
21
 
22
22
  const fc = {
@@ -27,7 +27,7 @@ export class MockFileService extends NodeFileService {
27
27
  this.files[fname] = fc;
28
28
  const decoder = new TextDecoder();
29
29
 
30
- return {
30
+ return Promise.resolve({
31
31
  name: oName,
32
32
  stream: new WritableStream<Uint8Array>({
33
33
  write(chunk): void {
@@ -40,6 +40,6 @@ export class MockFileService extends NodeFileService {
40
40
  throw new Error("not implemented");
41
41
  },
42
42
  }),
43
- };
43
+ });
44
44
  }
45
45
  }
@@ -0,0 +1,45 @@
1
+ import { ResolveOnce } from "../resolve-once.js";
2
+ import { runtimeFn } from "../runtime.js";
3
+ import { Env, EnvActions, EnvFactoryOpts } from "../sys-env.js";
4
+
5
+ const once = new ResolveOnce<NodeEnvActions>();
6
+ export class NodeEnvActions implements EnvActions {
7
+ readonly #node = globalThis as unknown as { process: { env: Record<string, string> } };
8
+
9
+ static new(opts: Partial<EnvFactoryOpts>): EnvActions {
10
+ return once.once(() => new NodeEnvActions(opts));
11
+ }
12
+
13
+ readonly opts: Partial<EnvFactoryOpts>;
14
+ private constructor(opts: Partial<EnvFactoryOpts>) {
15
+ this.opts = opts;
16
+ }
17
+
18
+ register(env: Env): Env {
19
+ for (const key of env.keys()) {
20
+ this._env[key] = env.get(key) || "";
21
+ }
22
+ return env;
23
+ }
24
+
25
+ active(): boolean {
26
+ return runtimeFn().isNodeIsh;
27
+ // typeof this.#node === "object" && typeof this.#node.process === "object" && typeof this.#node.process.env === "object";
28
+ }
29
+ readonly _env: Record<string, string> = this.active() ? this.#node.process.env : {};
30
+ keys(): string[] {
31
+ return Object.keys(this._env);
32
+ }
33
+ get(key: string): string | undefined {
34
+ return this._env[key];
35
+ }
36
+ set(key: string, value?: string): void {
37
+ if (value) {
38
+ this._env[key] = value;
39
+ }
40
+ }
41
+ delete(key: string): void {
42
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
43
+ delete this._env[key];
44
+ }
45
+ }
@@ -7,53 +7,9 @@ import {
7
7
  WrapperSysAbstractionParams,
8
8
  } from "../base-sys-abstraction.js";
9
9
  import { NodeFileService } from "./node-file-service.js";
10
- import { Env, EnvActions, envFactory, EnvFactoryOpts } from "../sys-env.js";
10
+ import { Env, envFactory } from "../sys-env.js";
11
11
  import { Utf8EnDecoderSingleton } from "../txt-en-decoder.js";
12
12
  import process from "node:process";
13
- import { runtimeFn } from "../runtime.js";
14
- import { ResolveOnce } from "../resolve-once.js";
15
-
16
- const once = new ResolveOnce<NodeEnvActions>();
17
- export class NodeEnvActions implements EnvActions {
18
- readonly #node = globalThis as unknown as { process: { env: Record<string, string> } };
19
-
20
- static new(opts: Partial<EnvFactoryOpts>): EnvActions {
21
- return once.once(() => new NodeEnvActions(opts));
22
- }
23
-
24
- readonly opts: Partial<EnvFactoryOpts>;
25
- private constructor(opts: Partial<EnvFactoryOpts>) {
26
- this.opts = opts;
27
- }
28
-
29
- register(env: Env): Env {
30
- for (const key of env.keys()) {
31
- this._env[key] = env.get(key) || "";
32
- }
33
- return env;
34
- }
35
-
36
- active(): boolean {
37
- return runtimeFn().isNodeIsh;
38
- // typeof this.#node === "object" && typeof this.#node.process === "object" && typeof this.#node.process.env === "object";
39
- }
40
- readonly _env: Record<string, string> = this.active() ? this.#node.process.env : {};
41
- keys(): string[] {
42
- return Object.keys(this._env);
43
- }
44
- get(key: string): string | undefined {
45
- return this._env[key];
46
- }
47
- set(key: string, value?: string): void {
48
- if (value) {
49
- this._env[key] = value;
50
- }
51
- }
52
- delete(key: string): void {
53
- // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
54
- delete this._env[key];
55
- }
56
- }
57
13
 
58
14
  export class NodeExitServiceImpl implements ExitService {
59
15
  constructor() {
@@ -14,10 +14,10 @@ export class ResolveSeq<T, C = void> {
14
14
  reset(): void {
15
15
  /* noop */
16
16
  }
17
- async _step(item?: ResolveSeqItem<T, C> | undefined): Promise<void> {
17
+ _step(item?: ResolveSeqItem<T, C>): Promise<void> {
18
18
  if (!item) {
19
19
  // done
20
- return;
20
+ return Promise.resolve();
21
21
  }
22
22
  item
23
23
  .fn(this.ctx)
@@ -25,15 +25,16 @@ export class ResolveSeq<T, C = void> {
25
25
  .catch((e) => item.future.reject(e as Error))
26
26
  .finally(() => {
27
27
  this._seqFutures.shift();
28
- this._step(this._seqFutures[0]);
28
+ void this._step(this._seqFutures[0]);
29
29
  });
30
+ return Promise.resolve();
30
31
  }
31
32
  readonly _seqFutures: ResolveSeqItem<T, C>[] = [];
32
33
  async add(fn: (c: C) => Promise<T>, id?: number): Promise<T> {
33
34
  const future = new Future<T>();
34
35
  this._seqFutures.push({ future, fn, id });
35
36
  if (this._seqFutures.length === 1) {
36
- this._step(this._seqFutures[0]);
37
+ void this._step(this._seqFutures[0]);
37
38
  }
38
39
  return future.asPromise();
39
40
  }
@@ -99,7 +100,7 @@ export class ResolveOnce<T, CTX = void> {
99
100
  this._onceFutures.length = 0;
100
101
  };
101
102
  const catchFn = (e: Error): void => {
102
- this._onceError = e as Error;
103
+ this._onceError = e;
103
104
  this._onceOk = false;
104
105
  this._onceValue = undefined;
105
106
  this._onceDone = true;