@adviser/cement 0.3.4 → 0.3.6

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 (550) hide show
  1. package/{base-sys-abstraction-B-PcaG0B.d.ts → base-sys-abstraction-CKI4xiRR.d.ts} +4 -4
  2. package/{base-sys-abstraction-CLlfCI2Q.d.cts → base-sys-abstraction-DLnSeH4s.d.cts} +4 -4
  3. package/cf/index.cjs +200 -6
  4. package/cf/index.cjs.map +1 -1
  5. package/cf/index.d.cts +3 -3
  6. package/cf/index.d.ts +3 -3
  7. package/cf/index.js +3 -3
  8. package/{chunk-OQ4NGEJR.js → chunk-4QRZPFED.js} +67 -10
  9. package/chunk-4QRZPFED.js.map +1 -0
  10. package/{chunk-A7OPSHUV.js → chunk-N5ISHPJ6.js} +14 -5
  11. package/chunk-N5ISHPJ6.js.map +1 -0
  12. package/{chunk-MFC4AD5O.js → chunk-OIIUVSUX.js} +3 -3
  13. package/chunk-OIIUVSUX.js.map +1 -0
  14. package/{chunk-HFP74WLI.js → chunk-PHS255C5.js} +64 -4
  15. package/chunk-PHS255C5.js.map +1 -0
  16. package/chunk-QDDO6NOK.js +194 -0
  17. package/chunk-QDDO6NOK.js.map +1 -0
  18. package/{chunk-5GJADB3C.js → chunk-Z7F6652G.js} +19 -226
  19. package/chunk-Z7F6652G.js.map +1 -0
  20. package/deno/index.cjs +200 -6
  21. package/deno/index.cjs.map +1 -1
  22. package/deno/index.d.cts +3 -3
  23. package/deno/index.d.ts +3 -3
  24. package/deno/index.js +2 -2
  25. package/deno/index.js.map +1 -1
  26. package/get-params-result-Bhy5997x.d.cts +61 -0
  27. package/get-params-result-Bhy5997x.d.ts +61 -0
  28. package/{index-ChpAZoUE.d.ts → index-6ofzOS0J.d.ts} +6 -52
  29. package/{index-CI2cJ0-W.d.cts → index-CcNS7k5i.d.cts} +6 -52
  30. package/index-DjN6Y4N2.d.ts +83 -0
  31. package/index-TZQHtEZo.d.cts +83 -0
  32. package/index.cjs +241 -173
  33. package/index.cjs.map +1 -1
  34. package/index.d.cts +14 -11
  35. package/index.d.ts +14 -11
  36. package/index.js +16 -11
  37. package/index.js.map +1 -1
  38. package/node/index.cjs +204 -10
  39. package/node/index.cjs.map +1 -1
  40. package/node/index.d.cts +3 -3
  41. package/node/index.d.ts +3 -3
  42. package/node/index.js +6 -6
  43. package/node/index.js.map +1 -1
  44. package/package.json +4 -4
  45. package/src/base-sys-abstraction.ts +8 -6
  46. package/src/cf-test-main.ts +5 -0
  47. package/src/deno/deno-file-service.ts +1 -1
  48. package/src/http_header.ts +1 -1
  49. package/src/index.ts +3 -0
  50. package/src/jsr.json +1 -1
  51. package/src/log-writer-impl.ts +10 -5
  52. package/src/logger-impl.ts +9 -8
  53. package/src/logger.ts +4 -5
  54. package/src/node/mock-file-service.ts +4 -4
  55. package/src/resolve-once.ts +6 -5
  56. package/src/runtime.ts +3 -3
  57. package/src/sys-env.ts +60 -0
  58. package/src/test/log-write-stream.ts +2 -1
  59. package/src/tracer.ts +4 -6
  60. package/src/uri.ts +4 -69
  61. package/src/utils/console-write-stream.ts +4 -3
  62. package/src/utils/fanout-write-stream.ts +1 -1
  63. package/src/utils/get-params-result.ts +71 -0
  64. package/src/utils/index.ts +2 -0
  65. package/src/utils/rebuffer.ts +27 -21
  66. package/src/utils/relative-path.ts +1 -1
  67. package/src/utils/stream2string.ts +2 -2
  68. package/src/utils/stripper.ts +2 -2
  69. package/src/version.ts +2 -2
  70. package/src/web/web-sys-abstraction.ts +1 -1
  71. package/stripper-BpBUUZ9p.d.cts +4 -0
  72. package/stripper-BpBUUZ9p.d.ts +4 -0
  73. package/{sys-abstraction-Coxu8BjZ.d.cts → sys-abstraction-BRDT_TIU.d.cts} +8 -1
  74. package/{sys-abstraction-Coxu8BjZ.d.ts → sys-abstraction-Bd0EzwO6.d.ts} +8 -1
  75. package/test/index.cjs +407 -355
  76. package/test/index.cjs.map +1 -1
  77. package/test/index.d.cts +4 -3
  78. package/test/index.d.ts +4 -3
  79. package/test/index.js +5 -5
  80. package/ts/smoke/smoke.d.ts +2 -0
  81. package/ts/smoke/smoke.d.ts.map +1 -0
  82. package/ts/smoke/smoke.js +33 -0
  83. package/ts/smoke/smoke.js.map +1 -0
  84. package/ts/{base-sys-abstraction.d.ts → src/base-sys-abstraction.d.ts} +2 -2
  85. package/ts/src/base-sys-abstraction.d.ts.map +1 -0
  86. package/ts/{base-sys-abstraction.js → src/base-sys-abstraction.js} +4 -2
  87. package/ts/src/base-sys-abstraction.js.map +1 -0
  88. package/ts/src/base-sys-abstraction.test.d.ts.map +1 -0
  89. package/ts/src/base-sys-abstraction.test.js.map +1 -0
  90. package/ts/src/bin2text.d.ts.map +1 -0
  91. package/ts/src/bin2text.js.map +1 -0
  92. package/ts/{bin2text.test.d.ts.map → src/bin2text.test.d.ts.map} +1 -1
  93. package/ts/src/bin2text.test.js.map +1 -0
  94. package/ts/src/cf/cf-env-actions.d.ts.map +1 -0
  95. package/ts/src/cf/cf-env-actions.js.map +1 -0
  96. package/ts/src/cf/cf-sys-abstraction.d.ts.map +1 -0
  97. package/ts/src/cf/cf-sys-abstraction.js.map +1 -0
  98. package/ts/src/cf/index.d.ts.map +1 -0
  99. package/ts/src/cf/index.js.map +1 -0
  100. package/ts/src/cf-test-main.d.ts +5 -0
  101. package/ts/src/cf-test-main.d.ts.map +1 -0
  102. package/ts/src/cf-test-main.js +6 -0
  103. package/ts/src/cf-test-main.js.map +1 -0
  104. package/ts/src/crypto.d.ts.map +1 -0
  105. package/ts/src/crypto.js.map +1 -0
  106. package/ts/{crypto.test.d.ts.map → src/crypto.test.d.ts.map} +1 -1
  107. package/ts/{crypto.test.js → src/crypto.test.js} +1 -1
  108. package/ts/src/crypto.test.js.map +1 -0
  109. package/ts/src/deno/deno-env-actions.d.ts.map +1 -0
  110. package/ts/src/deno/deno-env-actions.js.map +1 -0
  111. package/ts/src/deno/deno-file-service.d.ts.map +1 -0
  112. package/ts/src/deno/deno-file-service.js.map +1 -0
  113. package/ts/src/deno/deno-sys-abstraction.d.ts.map +1 -0
  114. package/ts/src/deno/deno-sys-abstraction.js.map +1 -0
  115. package/ts/src/deno/index.d.ts.map +1 -0
  116. package/ts/src/deno/index.js.map +1 -0
  117. package/ts/src/file-service.d.ts.map +1 -0
  118. package/ts/{file-service.js.map → src/file-service.js.map} +1 -1
  119. package/ts/src/future.d.ts.map +1 -0
  120. package/ts/src/future.js.map +1 -0
  121. package/ts/{future.test.d.ts.map → src/future.test.d.ts.map} +1 -1
  122. package/ts/src/future.test.js.map +1 -0
  123. package/ts/src/http_header.d.ts.map +1 -0
  124. package/ts/src/http_header.js.map +1 -0
  125. package/ts/src/http_header.test.d.ts.map +1 -0
  126. package/ts/src/http_header.test.js.map +1 -0
  127. package/ts/{index.d.ts → src/index.d.ts} +2 -0
  128. package/ts/src/index.d.ts.map +1 -0
  129. package/ts/{index.js → src/index.js} +2 -0
  130. package/ts/src/index.js.map +1 -0
  131. package/ts/src/log-level-impl.d.ts.map +1 -0
  132. package/ts/src/log-level-impl.js.map +1 -0
  133. package/ts/src/log-writer-impl.d.ts.map +1 -0
  134. package/ts/{log-writer-impl.js → src/log-writer-impl.js} +4 -2
  135. package/ts/src/log-writer-impl.js.map +1 -0
  136. package/ts/{logger-impl.d.ts → src/logger-impl.d.ts} +1 -1
  137. package/ts/src/logger-impl.d.ts.map +1 -0
  138. package/ts/{logger-impl.js → src/logger-impl.js} +2 -3
  139. package/ts/src/logger-impl.js.map +1 -0
  140. package/ts/{logger.d.ts → src/logger.d.ts} +1 -1
  141. package/ts/src/logger.d.ts.map +1 -0
  142. package/ts/src/logger.js.map +1 -0
  143. package/ts/{logger.test.d.ts.map → src/logger.test.d.ts.map} +1 -1
  144. package/ts/{logger.test.js → src/logger.test.js} +4 -4
  145. package/ts/src/logger.test.js.map +1 -0
  146. package/ts/src/node/index.d.ts.map +1 -0
  147. package/ts/src/node/index.js.map +1 -0
  148. package/ts/src/node/mock-file-service.d.ts.map +1 -0
  149. package/ts/{node → src/node}/mock-file-service.js +4 -4
  150. package/ts/src/node/mock-file-service.js.map +1 -0
  151. package/ts/src/node/mock-file-service.test.d.ts.map +1 -0
  152. package/ts/src/node/mock-file-service.test.js.map +1 -0
  153. package/ts/src/node/node-env-actions.d.ts.map +1 -0
  154. package/ts/src/node/node-env-actions.js.map +1 -0
  155. package/ts/src/node/node-file-service.d.ts.map +1 -0
  156. package/ts/src/node/node-file-service.js.map +1 -0
  157. package/ts/src/node/node-sys-abstraction.d.ts.map +1 -0
  158. package/ts/src/node/node-sys-abstraction.js.map +1 -0
  159. package/ts/src/node/node-sys-abstraction.test.d.ts.map +1 -0
  160. package/ts/src/node/node-sys-abstraction.test.js.map +1 -0
  161. package/ts/src/option.d.ts.map +1 -0
  162. package/ts/src/option.js.map +1 -0
  163. package/ts/{resolve-once.d.ts → src/resolve-once.d.ts} +1 -1
  164. package/ts/src/resolve-once.d.ts.map +1 -0
  165. package/ts/{resolve-once.js → src/resolve-once.js} +5 -4
  166. package/ts/src/resolve-once.js.map +1 -0
  167. package/ts/src/resolve-once.test.d.ts.map +1 -0
  168. package/ts/{resolve-once.test.js → src/resolve-once.test.js} +20 -24
  169. package/ts/src/resolve-once.test.js.map +1 -0
  170. package/ts/src/result.d.ts.map +1 -0
  171. package/ts/src/result.js.map +1 -0
  172. package/ts/{result.test.d.ts.map → src/result.test.d.ts.map} +1 -1
  173. package/ts/{result.test.js → src/result.test.js} +2 -4
  174. package/ts/src/result.test.js.map +1 -0
  175. package/ts/src/runtime.d.ts.map +1 -0
  176. package/ts/src/runtime.js.map +1 -0
  177. package/ts/src/sys-abstraction.d.ts.map +1 -0
  178. package/ts/src/sys-abstraction.js.map +1 -0
  179. package/ts/{sys-env.d.ts → src/sys-env.d.ts} +7 -0
  180. package/ts/src/sys-env.d.ts.map +1 -0
  181. package/ts/{sys-env.js → src/sys-env.js} +53 -0
  182. package/ts/src/sys-env.js.map +1 -0
  183. package/ts/{sys-env.test.d.ts.map → src/sys-env.test.d.ts.map} +1 -1
  184. package/ts/{sys-env.test.js → src/sys-env.test.js} +68 -0
  185. package/ts/src/sys-env.test.js.map +1 -0
  186. package/ts/src/test/index.d.ts.map +1 -0
  187. package/ts/src/test/index.js.map +1 -0
  188. package/ts/src/test/log-write-stream.d.ts.map +1 -0
  189. package/ts/src/test/log-write-stream.js.map +1 -0
  190. package/ts/src/test/mock-logger.d.ts.map +1 -0
  191. package/ts/src/test/mock-logger.js.map +1 -0
  192. package/ts/src/test/mock-logger.test.d.ts.map +1 -0
  193. package/ts/src/test/mock-logger.test.js.map +1 -0
  194. package/ts/src/test/test-exit-handler.d.ts.map +1 -0
  195. package/ts/{test → src/test}/test-exit-handler.js +8 -3
  196. package/ts/src/test/test-exit-handler.js.map +1 -0
  197. package/ts/src/time.d.ts.map +1 -0
  198. package/ts/src/time.js.map +1 -0
  199. package/ts/src/tracer.d.ts.map +1 -0
  200. package/ts/src/tracer.js.map +1 -0
  201. package/ts/{tracer.test.d.ts.map → src/tracer.test.d.ts.map} +1 -1
  202. package/ts/{tracer.test.js → src/tracer.test.js} +5 -5
  203. package/ts/src/tracer.test.js.map +1 -0
  204. package/ts/src/txt-en-decoder.d.ts.map +1 -0
  205. package/ts/src/txt-en-decoder.js.map +1 -0
  206. package/ts/{uri.d.ts → src/uri.d.ts} +2 -13
  207. package/ts/src/uri.d.ts.map +1 -0
  208. package/ts/{uri.js → src/uri.js} +2 -56
  209. package/ts/src/uri.js.map +1 -0
  210. package/ts/{uri.test.d.ts.map → src/uri.test.d.ts.map} +1 -1
  211. package/ts/{uri.test.js → src/uri.test.js} +7 -7
  212. package/ts/src/uri.test.js.map +1 -0
  213. package/ts/{utils → src/utils}/console-write-stream.d.ts +1 -1
  214. package/ts/src/utils/console-write-stream.d.ts.map +1 -0
  215. package/ts/{utils → src/utils}/console-write-stream.js +4 -3
  216. package/ts/src/utils/console-write-stream.js.map +1 -0
  217. package/ts/{utils → src/utils}/fanout-write-stream.d.ts +1 -1
  218. package/ts/src/utils/fanout-write-stream.d.ts.map +1 -0
  219. package/ts/src/utils/fanout-write-stream.js.map +1 -0
  220. package/ts/src/utils/get-params-result.d.ts +19 -0
  221. package/ts/src/utils/get-params-result.d.ts.map +1 -0
  222. package/ts/src/utils/get-params-result.js +58 -0
  223. package/ts/src/utils/get-params-result.js.map +1 -0
  224. package/ts/{utils → src/utils}/index.d.ts +2 -0
  225. package/ts/src/utils/index.d.ts.map +1 -0
  226. package/ts/{utils → src/utils}/index.js +2 -0
  227. package/ts/src/utils/index.js.map +1 -0
  228. package/ts/src/utils/rebuffer.d.ts.map +1 -0
  229. package/ts/{utils → src/utils}/rebuffer.js +7 -1
  230. package/ts/src/utils/rebuffer.js.map +1 -0
  231. package/ts/src/utils/rebuffer.test.d.ts.map +1 -0
  232. package/ts/src/utils/rebuffer.test.js.map +1 -0
  233. package/ts/src/utils/relative-path.d.ts.map +1 -0
  234. package/ts/src/utils/relative-path.js.map +1 -0
  235. package/ts/src/utils/relative-path.test.d.ts.map +1 -0
  236. package/ts/src/utils/relative-path.test.js.map +1 -0
  237. package/ts/src/utils/stream-map.d.ts.map +1 -0
  238. package/ts/src/utils/stream-map.js.map +1 -0
  239. package/ts/src/utils/stream-map.test.d.ts.map +1 -0
  240. package/ts/src/utils/stream-map.test.js.map +1 -0
  241. package/ts/src/utils/stream-test-helper.d.ts.map +1 -0
  242. package/ts/{utils → src/utils}/stream-test-helper.js +18 -10
  243. package/ts/src/utils/stream-test-helper.js.map +1 -0
  244. package/ts/src/utils/stream2string.d.ts.map +1 -0
  245. package/ts/src/utils/stream2string.js.map +1 -0
  246. package/ts/src/utils/stream2string.test.d.ts.map +1 -0
  247. package/ts/src/utils/stream2string.test.js.map +1 -0
  248. package/ts/src/utils/string2stream.d.ts.map +1 -0
  249. package/ts/src/utils/string2stream.js.map +1 -0
  250. package/ts/src/utils/string2stream.test.d.ts.map +1 -0
  251. package/ts/src/utils/string2stream.test.js.map +1 -0
  252. package/ts/src/utils/stripper.d.ts +3 -0
  253. package/ts/src/utils/stripper.d.ts.map +1 -0
  254. package/ts/src/utils/stripper.js.map +1 -0
  255. package/ts/src/utils/stripper.test.d.ts.map +1 -0
  256. package/ts/src/utils/stripper.test.js.map +1 -0
  257. package/ts/src/version.d.ts.map +1 -0
  258. package/ts/src/version.js.map +1 -0
  259. package/ts/src/web/index.d.ts.map +1 -0
  260. package/ts/src/web/index.js.map +1 -0
  261. package/ts/src/web/web-env-actions.d.ts.map +1 -0
  262. package/ts/src/web/web-env-actions.js.map +1 -0
  263. package/ts/{web → src/web}/web-sys-abstraction.d.ts +1 -1
  264. package/ts/src/web/web-sys-abstraction.d.ts.map +1 -0
  265. package/ts/src/web/web-sys-abstraction.js.map +1 -0
  266. package/ts/vitest.browser.config.d.ts +3 -0
  267. package/ts/vitest.browser.config.d.ts.map +1 -0
  268. package/ts/vitest.browser.config.js +17 -0
  269. package/ts/vitest.browser.config.js.map +1 -0
  270. package/ts/vitest.cf-runtime.config.d.ts +3 -0
  271. package/ts/vitest.cf-runtime.config.d.ts.map +1 -0
  272. package/ts/vitest.cf-runtime.config.js +16 -0
  273. package/ts/vitest.cf-runtime.config.js.map +1 -0
  274. package/ts/vitest.config.d.ts +3 -0
  275. package/ts/vitest.config.d.ts.map +1 -0
  276. package/ts/vitest.config.js +8 -0
  277. package/ts/vitest.config.js.map +1 -0
  278. package/ts/vitest.node.config.d.ts +3 -0
  279. package/ts/vitest.node.config.d.ts.map +1 -0
  280. package/ts/vitest.node.config.js +11 -0
  281. package/ts/vitest.node.config.js.map +1 -0
  282. package/ts/vitest.workspace.d.ts +3 -0
  283. package/ts/vitest.workspace.d.ts.map +1 -0
  284. package/ts/vitest.workspace.js +6 -0
  285. package/ts/vitest.workspace.js.map +1 -0
  286. package/utils/index.cjs +210 -3
  287. package/utils/index.cjs.map +1 -1
  288. package/utils/index.d.cts +3 -2
  289. package/utils/index.d.ts +3 -2
  290. package/utils/index.js +11 -4
  291. package/web/index.cjs +200 -6
  292. package/web/index.cjs.map +1 -1
  293. package/web/index.d.cts +4 -4
  294. package/web/index.d.ts +4 -4
  295. package/web/index.js +3 -3
  296. package/chunk-5GJADB3C.js.map +0 -1
  297. package/chunk-A7OPSHUV.js.map +0 -1
  298. package/chunk-HFP74WLI.js.map +0 -1
  299. package/chunk-MFC4AD5O.js.map +0 -1
  300. package/chunk-OQ4NGEJR.js.map +0 -1
  301. package/chunk-PPS4L4VW.js +0 -38
  302. package/chunk-PPS4L4VW.js.map +0 -1
  303. package/index-Q3phXzYr.d.cts +0 -75
  304. package/index-tIGZMHTc.d.ts +0 -75
  305. package/ts/base-sys-abstraction.d.ts.map +0 -1
  306. package/ts/base-sys-abstraction.js.map +0 -1
  307. package/ts/base-sys-abstraction.test.d.ts.map +0 -1
  308. package/ts/base-sys-abstraction.test.js.map +0 -1
  309. package/ts/bin2text.d.ts.map +0 -1
  310. package/ts/bin2text.js.map +0 -1
  311. package/ts/bin2text.test.js.map +0 -1
  312. package/ts/cf/cf-env-actions.d.ts.map +0 -1
  313. package/ts/cf/cf-env-actions.js.map +0 -1
  314. package/ts/cf/cf-sys-abstraction.d.ts.map +0 -1
  315. package/ts/cf/cf-sys-abstraction.js.map +0 -1
  316. package/ts/cf/index.d.ts.map +0 -1
  317. package/ts/cf/index.js.map +0 -1
  318. package/ts/crypto.d.ts.map +0 -1
  319. package/ts/crypto.js.map +0 -1
  320. package/ts/crypto.test.js.map +0 -1
  321. package/ts/deno/deno-env-actions.d.ts.map +0 -1
  322. package/ts/deno/deno-env-actions.js.map +0 -1
  323. package/ts/deno/deno-file-service.d.ts.map +0 -1
  324. package/ts/deno/deno-file-service.js.map +0 -1
  325. package/ts/deno/deno-sys-abstraction.d.ts.map +0 -1
  326. package/ts/deno/deno-sys-abstraction.js.map +0 -1
  327. package/ts/deno/index.d.ts.map +0 -1
  328. package/ts/deno/index.js.map +0 -1
  329. package/ts/file-service.d.ts.map +0 -1
  330. package/ts/future.d.ts.map +0 -1
  331. package/ts/future.js.map +0 -1
  332. package/ts/future.test.js.map +0 -1
  333. package/ts/http_header.d.ts.map +0 -1
  334. package/ts/http_header.js.map +0 -1
  335. package/ts/http_header.test.d.ts.map +0 -1
  336. package/ts/http_header.test.js.map +0 -1
  337. package/ts/index.d.ts.map +0 -1
  338. package/ts/index.js.map +0 -1
  339. package/ts/log-level-impl.d.ts.map +0 -1
  340. package/ts/log-level-impl.js.map +0 -1
  341. package/ts/log-writer-impl.d.ts.map +0 -1
  342. package/ts/log-writer-impl.js.map +0 -1
  343. package/ts/logger-impl.d.ts.map +0 -1
  344. package/ts/logger-impl.js.map +0 -1
  345. package/ts/logger.d.ts.map +0 -1
  346. package/ts/logger.js.map +0 -1
  347. package/ts/logger.test.js.map +0 -1
  348. package/ts/node/index.d.ts.map +0 -1
  349. package/ts/node/index.js.map +0 -1
  350. package/ts/node/mock-file-service.d.ts.map +0 -1
  351. package/ts/node/mock-file-service.js.map +0 -1
  352. package/ts/node/mock-file-service.test.d.ts.map +0 -1
  353. package/ts/node/mock-file-service.test.js.map +0 -1
  354. package/ts/node/node-env-actions.d.ts.map +0 -1
  355. package/ts/node/node-env-actions.js.map +0 -1
  356. package/ts/node/node-file-service.d.ts.map +0 -1
  357. package/ts/node/node-file-service.js.map +0 -1
  358. package/ts/node/node-sys-abstraction.d.ts.map +0 -1
  359. package/ts/node/node-sys-abstraction.js.map +0 -1
  360. package/ts/node/node-sys-abstraction.test.d.ts.map +0 -1
  361. package/ts/node/node-sys-abstraction.test.js.map +0 -1
  362. package/ts/option.d.ts.map +0 -1
  363. package/ts/option.js.map +0 -1
  364. package/ts/resolve-once.d.ts.map +0 -1
  365. package/ts/resolve-once.js.map +0 -1
  366. package/ts/resolve-once.test.d.ts.map +0 -1
  367. package/ts/resolve-once.test.js.map +0 -1
  368. package/ts/result.d.ts.map +0 -1
  369. package/ts/result.js.map +0 -1
  370. package/ts/result.test.js.map +0 -1
  371. package/ts/runtime.d.ts.map +0 -1
  372. package/ts/runtime.js.map +0 -1
  373. package/ts/sys-abstraction.d.ts.map +0 -1
  374. package/ts/sys-abstraction.js.map +0 -1
  375. package/ts/sys-env.d.ts.map +0 -1
  376. package/ts/sys-env.js.map +0 -1
  377. package/ts/sys-env.test.js.map +0 -1
  378. package/ts/test/index.d.ts.map +0 -1
  379. package/ts/test/index.js.map +0 -1
  380. package/ts/test/log-write-stream.d.ts.map +0 -1
  381. package/ts/test/log-write-stream.js.map +0 -1
  382. package/ts/test/mock-logger.d.ts.map +0 -1
  383. package/ts/test/mock-logger.js.map +0 -1
  384. package/ts/test/mock-logger.test.d.ts.map +0 -1
  385. package/ts/test/mock-logger.test.js.map +0 -1
  386. package/ts/test/test-exit-handler.d.ts.map +0 -1
  387. package/ts/test/test-exit-handler.js.map +0 -1
  388. package/ts/time.d.ts.map +0 -1
  389. package/ts/time.js.map +0 -1
  390. package/ts/tracer.d.ts.map +0 -1
  391. package/ts/tracer.js.map +0 -1
  392. package/ts/tracer.test.js.map +0 -1
  393. package/ts/txt-en-decoder.d.ts.map +0 -1
  394. package/ts/txt-en-decoder.js.map +0 -1
  395. package/ts/uri.d.ts.map +0 -1
  396. package/ts/uri.js.map +0 -1
  397. package/ts/uri.test.js.map +0 -1
  398. package/ts/utils/console-write-stream.d.ts.map +0 -1
  399. package/ts/utils/console-write-stream.js.map +0 -1
  400. package/ts/utils/fanout-write-stream.d.ts.map +0 -1
  401. package/ts/utils/fanout-write-stream.js.map +0 -1
  402. package/ts/utils/index.d.ts.map +0 -1
  403. package/ts/utils/index.js.map +0 -1
  404. package/ts/utils/rebuffer.d.ts.map +0 -1
  405. package/ts/utils/rebuffer.js.map +0 -1
  406. package/ts/utils/rebuffer.test.d.ts.map +0 -1
  407. package/ts/utils/rebuffer.test.js.map +0 -1
  408. package/ts/utils/relative-path.d.ts.map +0 -1
  409. package/ts/utils/relative-path.js.map +0 -1
  410. package/ts/utils/relative-path.test.d.ts.map +0 -1
  411. package/ts/utils/relative-path.test.js.map +0 -1
  412. package/ts/utils/stream-map.d.ts.map +0 -1
  413. package/ts/utils/stream-map.js.map +0 -1
  414. package/ts/utils/stream-map.test.d.ts.map +0 -1
  415. package/ts/utils/stream-map.test.js.map +0 -1
  416. package/ts/utils/stream-test-helper.d.ts.map +0 -1
  417. package/ts/utils/stream-test-helper.js.map +0 -1
  418. package/ts/utils/stream2string.d.ts.map +0 -1
  419. package/ts/utils/stream2string.js.map +0 -1
  420. package/ts/utils/stream2string.test.d.ts.map +0 -1
  421. package/ts/utils/stream2string.test.js.map +0 -1
  422. package/ts/utils/string2stream.d.ts.map +0 -1
  423. package/ts/utils/string2stream.js.map +0 -1
  424. package/ts/utils/string2stream.test.d.ts.map +0 -1
  425. package/ts/utils/string2stream.test.js.map +0 -1
  426. package/ts/utils/stripper.d.ts +0 -3
  427. package/ts/utils/stripper.d.ts.map +0 -1
  428. package/ts/utils/stripper.js.map +0 -1
  429. package/ts/utils/stripper.test.d.ts.map +0 -1
  430. package/ts/utils/stripper.test.js.map +0 -1
  431. package/ts/version.d.ts.map +0 -1
  432. package/ts/version.js.map +0 -1
  433. package/ts/web/index.d.ts.map +0 -1
  434. package/ts/web/index.js.map +0 -1
  435. package/ts/web/web-env-actions.d.ts.map +0 -1
  436. package/ts/web/web-env-actions.js.map +0 -1
  437. package/ts/web/web-sys-abstraction.d.ts.map +0 -1
  438. package/ts/web/web-sys-abstraction.js.map +0 -1
  439. package/txt-en-decoder-CZYJUju2.d.cts +0 -11
  440. package/txt-en-decoder-CZYJUju2.d.ts +0 -11
  441. /package/ts/{base-sys-abstraction.test.d.ts → src/base-sys-abstraction.test.d.ts} +0 -0
  442. /package/ts/{base-sys-abstraction.test.js → src/base-sys-abstraction.test.js} +0 -0
  443. /package/ts/{bin2text.d.ts → src/bin2text.d.ts} +0 -0
  444. /package/ts/{bin2text.js → src/bin2text.js} +0 -0
  445. /package/ts/{bin2text.test.d.ts → src/bin2text.test.d.ts} +0 -0
  446. /package/ts/{bin2text.test.js → src/bin2text.test.js} +0 -0
  447. /package/ts/{cf → src/cf}/cf-env-actions.d.ts +0 -0
  448. /package/ts/{cf → src/cf}/cf-env-actions.js +0 -0
  449. /package/ts/{cf → src/cf}/cf-sys-abstraction.d.ts +0 -0
  450. /package/ts/{cf → src/cf}/cf-sys-abstraction.js +0 -0
  451. /package/ts/{cf → src/cf}/index.d.ts +0 -0
  452. /package/ts/{cf → src/cf}/index.js +0 -0
  453. /package/ts/{crypto.d.ts → src/crypto.d.ts} +0 -0
  454. /package/ts/{crypto.js → src/crypto.js} +0 -0
  455. /package/ts/{crypto.test.d.ts → src/crypto.test.d.ts} +0 -0
  456. /package/ts/{deno → src/deno}/deno-env-actions.d.ts +0 -0
  457. /package/ts/{deno → src/deno}/deno-env-actions.js +0 -0
  458. /package/ts/{deno → src/deno}/deno-file-service.d.ts +0 -0
  459. /package/ts/{deno → src/deno}/deno-file-service.js +0 -0
  460. /package/ts/{deno → src/deno}/deno-sys-abstraction.d.ts +0 -0
  461. /package/ts/{deno → src/deno}/deno-sys-abstraction.js +0 -0
  462. /package/ts/{deno → src/deno}/index.d.ts +0 -0
  463. /package/ts/{deno → src/deno}/index.js +0 -0
  464. /package/ts/{file-service.d.ts → src/file-service.d.ts} +0 -0
  465. /package/ts/{file-service.js → src/file-service.js} +0 -0
  466. /package/ts/{future.d.ts → src/future.d.ts} +0 -0
  467. /package/ts/{future.js → src/future.js} +0 -0
  468. /package/ts/{future.test.d.ts → src/future.test.d.ts} +0 -0
  469. /package/ts/{future.test.js → src/future.test.js} +0 -0
  470. /package/ts/{http_header.d.ts → src/http_header.d.ts} +0 -0
  471. /package/ts/{http_header.js → src/http_header.js} +0 -0
  472. /package/ts/{http_header.test.d.ts → src/http_header.test.d.ts} +0 -0
  473. /package/ts/{http_header.test.js → src/http_header.test.js} +0 -0
  474. /package/ts/{log-level-impl.d.ts → src/log-level-impl.d.ts} +0 -0
  475. /package/ts/{log-level-impl.js → src/log-level-impl.js} +0 -0
  476. /package/ts/{log-writer-impl.d.ts → src/log-writer-impl.d.ts} +0 -0
  477. /package/ts/{logger.js → src/logger.js} +0 -0
  478. /package/ts/{logger.test.d.ts → src/logger.test.d.ts} +0 -0
  479. /package/ts/{node → src/node}/index.d.ts +0 -0
  480. /package/ts/{node → src/node}/index.js +0 -0
  481. /package/ts/{node → src/node}/mock-file-service.d.ts +0 -0
  482. /package/ts/{node → src/node}/mock-file-service.test.d.ts +0 -0
  483. /package/ts/{node → src/node}/mock-file-service.test.js +0 -0
  484. /package/ts/{node → src/node}/node-env-actions.d.ts +0 -0
  485. /package/ts/{node → src/node}/node-env-actions.js +0 -0
  486. /package/ts/{node → src/node}/node-file-service.d.ts +0 -0
  487. /package/ts/{node → src/node}/node-file-service.js +0 -0
  488. /package/ts/{node → src/node}/node-sys-abstraction.d.ts +0 -0
  489. /package/ts/{node → src/node}/node-sys-abstraction.js +0 -0
  490. /package/ts/{node → src/node}/node-sys-abstraction.test.d.ts +0 -0
  491. /package/ts/{node → src/node}/node-sys-abstraction.test.js +0 -0
  492. /package/ts/{option.d.ts → src/option.d.ts} +0 -0
  493. /package/ts/{option.js → src/option.js} +0 -0
  494. /package/ts/{resolve-once.test.d.ts → src/resolve-once.test.d.ts} +0 -0
  495. /package/ts/{result.d.ts → src/result.d.ts} +0 -0
  496. /package/ts/{result.js → src/result.js} +0 -0
  497. /package/ts/{result.test.d.ts → src/result.test.d.ts} +0 -0
  498. /package/ts/{runtime.d.ts → src/runtime.d.ts} +0 -0
  499. /package/ts/{runtime.js → src/runtime.js} +0 -0
  500. /package/ts/{sys-abstraction.d.ts → src/sys-abstraction.d.ts} +0 -0
  501. /package/ts/{sys-abstraction.js → src/sys-abstraction.js} +0 -0
  502. /package/ts/{sys-env.test.d.ts → src/sys-env.test.d.ts} +0 -0
  503. /package/ts/{test → src/test}/index.d.ts +0 -0
  504. /package/ts/{test → src/test}/index.js +0 -0
  505. /package/ts/{test → src/test}/log-write-stream.d.ts +0 -0
  506. /package/ts/{test → src/test}/log-write-stream.js +0 -0
  507. /package/ts/{test → src/test}/mock-logger.d.ts +0 -0
  508. /package/ts/{test → src/test}/mock-logger.js +0 -0
  509. /package/ts/{test → src/test}/mock-logger.test.d.ts +0 -0
  510. /package/ts/{test → src/test}/mock-logger.test.js +0 -0
  511. /package/ts/{test → src/test}/test-exit-handler.d.ts +0 -0
  512. /package/ts/{time.d.ts → src/time.d.ts} +0 -0
  513. /package/ts/{time.js → src/time.js} +0 -0
  514. /package/ts/{tracer.d.ts → src/tracer.d.ts} +0 -0
  515. /package/ts/{tracer.js → src/tracer.js} +0 -0
  516. /package/ts/{tracer.test.d.ts → src/tracer.test.d.ts} +0 -0
  517. /package/ts/{txt-en-decoder.d.ts → src/txt-en-decoder.d.ts} +0 -0
  518. /package/ts/{txt-en-decoder.js → src/txt-en-decoder.js} +0 -0
  519. /package/ts/{uri.test.d.ts → src/uri.test.d.ts} +0 -0
  520. /package/ts/{utils → src/utils}/fanout-write-stream.js +0 -0
  521. /package/ts/{utils → src/utils}/rebuffer.d.ts +0 -0
  522. /package/ts/{utils → src/utils}/rebuffer.test.d.ts +0 -0
  523. /package/ts/{utils → src/utils}/rebuffer.test.js +0 -0
  524. /package/ts/{utils → src/utils}/relative-path.d.ts +0 -0
  525. /package/ts/{utils → src/utils}/relative-path.js +0 -0
  526. /package/ts/{utils → src/utils}/relative-path.test.d.ts +0 -0
  527. /package/ts/{utils → src/utils}/relative-path.test.js +0 -0
  528. /package/ts/{utils → src/utils}/stream-map.d.ts +0 -0
  529. /package/ts/{utils → src/utils}/stream-map.js +0 -0
  530. /package/ts/{utils → src/utils}/stream-map.test.d.ts +0 -0
  531. /package/ts/{utils → src/utils}/stream-map.test.js +0 -0
  532. /package/ts/{utils → src/utils}/stream-test-helper.d.ts +0 -0
  533. /package/ts/{utils → src/utils}/stream2string.d.ts +0 -0
  534. /package/ts/{utils → src/utils}/stream2string.js +0 -0
  535. /package/ts/{utils → src/utils}/stream2string.test.d.ts +0 -0
  536. /package/ts/{utils → src/utils}/stream2string.test.js +0 -0
  537. /package/ts/{utils → src/utils}/string2stream.d.ts +0 -0
  538. /package/ts/{utils → src/utils}/string2stream.js +0 -0
  539. /package/ts/{utils → src/utils}/string2stream.test.d.ts +0 -0
  540. /package/ts/{utils → src/utils}/string2stream.test.js +0 -0
  541. /package/ts/{utils → src/utils}/stripper.js +0 -0
  542. /package/ts/{utils → src/utils}/stripper.test.d.ts +0 -0
  543. /package/ts/{utils → src/utils}/stripper.test.js +0 -0
  544. /package/ts/{version.d.ts → src/version.d.ts} +0 -0
  545. /package/ts/{version.js → src/version.js} +0 -0
  546. /package/ts/{web → src/web}/index.d.ts +0 -0
  547. /package/ts/{web → src/web}/index.js +0 -0
  548. /package/ts/{web → src/web}/web-env-actions.d.ts +0 -0
  549. /package/ts/{web → src/web}/web-env-actions.js +0 -0
  550. /package/ts/{web → src/web}/web-sys-abstraction.js +0 -0
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
  }
@@ -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;
package/src/runtime.ts CHANGED
@@ -6,14 +6,13 @@ export interface Runtime {
6
6
  isCFWorker: boolean;
7
7
  }
8
8
 
9
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
- function isSet(value: string, ref: any = globalThis): boolean {
9
+ function isSet(value: string, ref: Record<string, unknown> = globalThis): boolean {
11
10
  const [head, ...tail] = value.split(".");
12
11
  if (["object", "function"].includes(typeof ref) && ref && ["object", "function"].includes(typeof ref[head]) && ref[head]) {
13
12
  if (tail.length <= 1) {
14
13
  return true;
15
14
  }
16
- return isSet(tail.join("."), ref[head]);
15
+ return isSet(tail.join("."), ref[head] as Record<string, unknown>);
17
16
  }
18
17
  return false;
19
18
  }
@@ -24,6 +23,7 @@ export function runtimeFn(): Runtime {
24
23
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
24
  const gt: any = globalThis;
26
25
  let isReactNative =
26
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
27
27
  isSet("navigator.product") && typeof gt["navigator"] === "object" && gt["navigator"]["product"] === "ReactNative";
28
28
  let isNodeIsh = false;
29
29
  if (!isSet("Deno")) {
package/src/sys-env.ts CHANGED
@@ -3,6 +3,10 @@ import { NodeEnvActions } from "./node/node-env-actions.js";
3
3
  import { BrowserEnvActions } from "./web/web-env-actions.js";
4
4
  import { CFEnvActions } from "./cf/cf-env-actions.js";
5
5
  import { KeyedResolvOnce } from "./resolve-once.js";
6
+ import { Result } from "./result.js";
7
+ import { getParamsResult, KeysParam } from "./utils/get-params-result.js";
8
+
9
+ export type EnvTuple = ([string, string] | [string, string][] | Record<string, string> | Iterator<[string, string]>)[];
6
10
 
7
11
  export interface EnvMap {
8
12
  get(key: string): string | undefined;
@@ -28,6 +32,9 @@ export interface OnSetItem {
28
32
 
29
33
  export interface Env extends EnvMap {
30
34
  onSet(fn: OnSetFn, ...filter: string[]): void;
35
+
36
+ gets(...kparams: KeysParam): Result<Record<string, string>>;
37
+ sets(...keys: EnvTuple): void;
31
38
  }
32
39
 
33
40
  export type EnvFactoryFn = (opts: Partial<EnvFactoryOpts>) => EnvActions;
@@ -66,12 +73,65 @@ export function envFactory(opts: Partial<EnvFactoryOpts> = {}): Env {
66
73
  });
67
74
  }
68
75
 
76
+ function isIterable(obj: unknown): obj is Iterable<[string, string]> {
77
+ // checks for null and undefined
78
+ if (obj == null) {
79
+ return false;
80
+ }
81
+ return typeof (obj as Record<symbol, unknown>)[Symbol.iterator] === "function";
82
+ }
83
+
69
84
  export class EnvImpl implements Env {
70
85
  readonly _map: EnvMap;
71
86
  constructor(map: EnvMap, opts: Partial<EnvFactoryOpts> = {}) {
72
87
  this._map = map;
73
88
  this._updatePresets(opts.presetEnv);
74
89
  }
90
+ gets(...kparams: KeysParam): Result<Record<string, string>> {
91
+ return getParamsResult(kparams, {
92
+ getParam: (k) => this.get(k),
93
+ });
94
+ }
95
+ sets(...keys: EnvTuple): void {
96
+ keys.forEach((key) => {
97
+ if (Array.isArray(key)) {
98
+ if (key.length === 2) {
99
+ const [k, v] = key;
100
+ if (typeof k === "string" && typeof v === "string") {
101
+ this.set(k, v);
102
+ return;
103
+ }
104
+ }
105
+ for (const item of key) {
106
+ if (Array.isArray(item)) {
107
+ // [string, string]
108
+ if (item.length === 2) {
109
+ const [k, v] = item;
110
+ if (typeof k === "string" && typeof v === "string") {
111
+ this.set(k, v);
112
+ }
113
+ }
114
+ }
115
+ }
116
+ } else {
117
+ if (isIterable(key)) {
118
+ for (const [k, v] of key) {
119
+ if (typeof k === "string" && typeof v === "string") {
120
+ this.set(k, v);
121
+ }
122
+ }
123
+ } else {
124
+ const rKey = key as Record<string, string>;
125
+ for (const k in rKey) {
126
+ const v = rKey[k];
127
+ if (typeof k === "string" && typeof v === "string") {
128
+ this.set(k, v);
129
+ }
130
+ }
131
+ }
132
+ }
133
+ });
134
+ }
75
135
  _updatePresets(presetEnv?: Map<string, string>): void {
76
136
  if (!presetEnv) {
77
137
  return;
@@ -61,7 +61,7 @@ export class LogCollector implements WritableStream<Uint8Array> {
61
61
 
62
62
  getWriter(): WritableStreamDefaultWriter<Uint8Array> {
63
63
  if (!this._writer) {
64
- const dests: WritableStreamDefaultWriter[] = [new LogWriteStream(this._bufferArr)];
64
+ const dests: WritableStreamDefaultWriter<Uint8Array>[] = [new LogWriteStream(this._bufferArr)];
65
65
  if (this._pass) {
66
66
  dests.push(this._pass);
67
67
  }
@@ -87,6 +87,7 @@ export class LogCollector implements WritableStream<Uint8Array> {
87
87
  if (!notJsonLine) {
88
88
  const splitStr = jsonNlStr.split("\n");
89
89
  const filterStr = splitStr.filter((a) => a.length);
90
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
90
91
  const mapStr = filterStr.map((a) => JSON.parse(a));
91
92
  return mapStr;
92
93
  }
package/src/tracer.ts CHANGED
@@ -38,14 +38,12 @@ export class Metric<T> {
38
38
  add<R extends number | ArrayLike<T>>(value: R): void {
39
39
  if (typeof value === "number") {
40
40
  if (this.value === undefined) {
41
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
- this.value = 0 as any;
41
+ this.value = 0 as T;
43
42
  }
44
- (this.value as number) = ((this.value as number) + value) as number;
43
+ this.value = ((this.value as number) + value) as T;
45
44
  } else if (Array.isArray(value)) {
46
45
  if (!Array.isArray(this.value)) {
47
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
- this.value = [] as any;
46
+ this.value = [] as T;
49
47
  }
50
48
  (this.value as T[]).push(...value);
51
49
  } else {
@@ -145,7 +143,7 @@ export class TraceNode {
145
143
  const spanRefs = this.metrics.toJSON.call({ map: this.metrics.spanRefs });
146
144
  const metricsRefs = Object.keys(spanRefs).length > 0 ? { metricRefs: spanRefs } : {};
147
145
  return {
148
- ctx: cleanCtx as CleanCtx,
146
+ ctx: cleanCtx,
149
147
  invokations: this.invokations,
150
148
  ...metricsRefs,
151
149
  };
package/src/uri.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { exception2Result, Result } from "./result.js";
2
+ import { getParamsResult, KeysParam, param } from "./utils/get-params-result.js";
2
3
  import { relativePath } from "./utils/relative-path.js";
3
4
  import { StripCommand, stripper } from "./utils/stripper.js";
4
5
 
@@ -6,30 +7,14 @@ type NullOrUndef = null | undefined;
6
7
 
7
8
  type OneKey<K extends string, V = string> = Record<K, V>;
8
9
 
9
- export type MsgFn = (...keys: string[]) => string;
10
+ /** @deprecated use param from get-params-result */
11
+ export const key = param;
12
+
10
13
  /*
11
14
  if KeyParam is a Object
12
15
  if the right side is a string, it is the default value
13
16
  if the right side is a !string | REQUIRED, it is required
14
17
  */
15
- class _REQUIRED {
16
- readonly val = "REQUIRED";
17
- }
18
- class _OPTIONAL {
19
- readonly val = "OPTIONAL";
20
- }
21
-
22
- interface _key {
23
- readonly REQUIRED: _REQUIRED;
24
- readonly OPTIONAL: _OPTIONAL;
25
- }
26
-
27
- export const key: _key = {
28
- REQUIRED: new _REQUIRED(),
29
- OPTIONAL: new _OPTIONAL(),
30
- };
31
-
32
- export type KeysParam = (string | MsgFn | Record<string, _REQUIRED | _OPTIONAL | unknown>)[];
33
18
 
34
19
  // type ReturnType<T extends (...args: KeysParam) => unknown> = T extends (...args: KeysParam) => infer R ? R : unknown;
35
20
 
@@ -272,56 +257,6 @@ function getParamResult(
272
257
  return Result.Ok(val);
273
258
  }
274
259
 
275
- function getParamsResult(
276
- keys: KeysParam,
277
- getParam: { getParam: (key: string) => string | undefined },
278
- ): Result<Record<string, string>> {
279
- const keyDef = keys.flat().reduce(
280
- (acc, i) => {
281
- if (typeof i === "string") {
282
- acc.push({ key: i, def: undefined, isOptional: false });
283
- } else if (typeof i === "object") {
284
- acc.push(
285
- ...Object.keys(i).map((k) => ({
286
- key: k,
287
- def: typeof i[k] === "string" ? i[k] : undefined,
288
- isOptional: i[k] instanceof _OPTIONAL,
289
- })),
290
- );
291
- }
292
- return acc;
293
- },
294
- [] as { key: string; def?: string; isOptional: boolean }[],
295
- );
296
- //.filter((k) => typeof k === "string");
297
- const msgFn =
298
- keys.find((k) => typeof k === "function") ||
299
- ((...keys: string[]): string => {
300
- const msg = keys.join(",");
301
- return `missing parameters: ${msg}`;
302
- });
303
- const errors: string[] = [];
304
- const result: Record<string, string> = {};
305
- for (const kd of keyDef) {
306
- const val = getParam.getParam(kd.key);
307
- if (val === undefined) {
308
- if (typeof kd.def === "string") {
309
- result[kd.key] = kd.def;
310
- } else {
311
- if (!kd.isOptional) {
312
- errors.push(kd.key);
313
- }
314
- }
315
- } else {
316
- result[kd.key] = val;
317
- }
318
- }
319
- if (errors.length) {
320
- return Result.Err(msgFn(...errors));
321
- }
322
- return Result.Ok(result);
323
- }
324
-
325
260
  export class BuildURI implements URIInterface<BuildURI> {
326
261
  _url: MutableURL; // pathname needs this
327
262
  private constructor(url: MutableURL) {
@@ -23,7 +23,7 @@ export class ConsoleWriterStreamDefaultWriter implements WritableStreamDefaultWr
23
23
  this.ready = Promise.resolve(undefined);
24
24
  this.closed = Promise.resolve(undefined);
25
25
  }
26
- async write(chunk?: Uint8Array | undefined): Promise<void> {
26
+ write(chunk?: Uint8Array): Promise<void> {
27
27
  let strObj: string | { level: string } = this.decoder.decode(chunk).trimEnd();
28
28
  let output = "log";
29
29
  try {
@@ -46,6 +46,7 @@ export class ConsoleWriterStreamDefaultWriter implements WritableStreamDefaultWr
46
46
  // eslint-disable-next-line no-console
47
47
  console.log(strObj);
48
48
  }
49
+ return Promise.resolve();
49
50
  }
50
51
  }
51
52
 
@@ -56,8 +57,8 @@ export class ConsoleWriterStream implements WritableStream<Uint8Array> {
56
57
  abort(reason?: any): Promise<void> {
57
58
  throw new Error("Method not implemented.");
58
59
  }
59
- async close(): Promise<void> {
60
- return;
60
+ close(): Promise<void> {
61
+ return Promise.resolve();
61
62
  }
62
63
  getWriter(): WritableStreamDefaultWriter<Uint8Array> {
63
64
  if (this.locked) {
@@ -24,7 +24,7 @@ export class FanoutWriteStream implements WritableStreamDefaultWriter<Uint8Array
24
24
  this._writers.map((w) => w.releaseLock());
25
25
  }
26
26
 
27
- write(chunk?: Uint8Array | undefined): Promise<void> {
27
+ write(chunk?: Uint8Array): Promise<void> {
28
28
  return Promise.all(this._writers.map((w) => w.write(chunk))).then(() => {
29
29
  /* do nothing */
30
30
  });
@@ -0,0 +1,71 @@
1
+ import { Result } from "../result.js";
2
+
3
+ class _REQUIRED {
4
+ readonly val = "REQUIRED";
5
+ }
6
+ class _OPTIONAL {
7
+ readonly val = "OPTIONAL";
8
+ }
9
+
10
+ export interface Param {
11
+ readonly REQUIRED: _REQUIRED;
12
+ readonly OPTIONAL: _OPTIONAL;
13
+ }
14
+
15
+ export const param: Param = {
16
+ REQUIRED: new _REQUIRED(),
17
+ OPTIONAL: new _OPTIONAL(),
18
+ };
19
+
20
+ export type MsgFn = (...keys: string[]) => string;
21
+ export type KeysParam = (string | MsgFn | Record<string, _REQUIRED | _OPTIONAL | number | string | boolean | undefined | null>)[];
22
+
23
+ export function getParamsResult(
24
+ keys: KeysParam,
25
+ getParam: { getParam: (key: string) => string | undefined },
26
+ ): Result<Record<string, string>> {
27
+ const keyDef = keys.flat().reduce(
28
+ (acc, i) => {
29
+ if (typeof i === "string") {
30
+ acc.push({ key: i, def: undefined, isOptional: false });
31
+ } else if (typeof i === "object") {
32
+ acc.push(
33
+ ...Object.keys(i).map((k) => ({
34
+ key: k,
35
+ def: typeof i[k] === "string" ? i[k] : undefined,
36
+ isOptional: i[k] === param.OPTIONAL,
37
+ })),
38
+ );
39
+ }
40
+ return acc;
41
+ },
42
+ [] as { key: string; def?: string; isOptional: boolean }[],
43
+ );
44
+ //.filter((k) => typeof k === "string");
45
+ const msgFn =
46
+ keys.find((k) => typeof k === "function") ||
47
+ ((...keys: string[]): string => {
48
+ const msg = keys.join(",");
49
+ return `missing parameters: ${msg}`;
50
+ });
51
+ const errors: string[] = [];
52
+ const result: Record<string, string> = {};
53
+ for (const kd of keyDef) {
54
+ const val = getParam.getParam(kd.key);
55
+ if (val === undefined) {
56
+ if (typeof kd.def === "string") {
57
+ result[kd.key] = kd.def;
58
+ } else {
59
+ if (!kd.isOptional) {
60
+ errors.push(kd.key);
61
+ }
62
+ }
63
+ } else {
64
+ result[kd.key] = val;
65
+ }
66
+ }
67
+ if (errors.length) {
68
+ return Result.Err(msgFn(...errors));
69
+ }
70
+ return Result.Ok(result);
71
+ }
@@ -4,3 +4,5 @@ export * from "./stream2string.js";
4
4
  export * from "./string2stream.js";
5
5
  export * from "./console-write-stream.js";
6
6
  export * from "./fanout-write-stream.js";
7
+ export * from "./get-params-result.js";
8
+ export * from "./stripper.js";
@@ -33,29 +33,35 @@ interface pumpState {
33
33
  }
34
34
 
35
35
  function pump(ps: pumpState, controller: ReadableStreamDefaultController<Uint8Array>, next: () => void): void {
36
- ps.reader.read().then(({ done, value }) => {
37
- if (done) {
38
- if (ps.tmpLen > 0) {
39
- controller.enqueue(reChunk(ps.tmp, ps.tmpLen).chunk);
36
+ ps.reader
37
+ .read()
38
+ .then(({ done, value }) => {
39
+ if (done) {
40
+ if (ps.tmpLen > 0) {
41
+ controller.enqueue(reChunk(ps.tmp, ps.tmpLen).chunk);
42
+ }
43
+ controller.close();
44
+ next();
45
+ return;
40
46
  }
41
- controller.close();
42
- next();
43
- return;
44
- }
45
- if (ps.tmpLen + value.length > ps.chunkSize) {
46
- ps.tmp.push(value);
47
- const res = reChunk(ps.tmp, ps.chunkSize);
48
- controller.enqueue(res.chunk);
49
- ps.tmp = [res.rest];
50
- ps.tmpLen = res.rest.length;
47
+ if (ps.tmpLen + value.length > ps.chunkSize) {
48
+ ps.tmp.push(value);
49
+ const res = reChunk(ps.tmp, ps.chunkSize);
50
+ controller.enqueue(res.chunk);
51
+ ps.tmp = [res.rest];
52
+ ps.tmpLen = res.rest.length;
53
+ next();
54
+ return;
55
+ } else if (value.length) {
56
+ ps.tmp.push(value);
57
+ ps.tmpLen += value.length;
58
+ }
59
+ pump(ps, controller, next);
60
+ })
61
+ .catch((err) => {
62
+ controller.error(err);
51
63
  next();
52
- return;
53
- } else if (value.length) {
54
- ps.tmp.push(value);
55
- ps.tmpLen += value.length;
56
- }
57
- pump(ps, controller, next);
58
- });
64
+ });
59
65
  }
60
66
 
61
67
  export function rebuffer(a: ReadableStream<Uint8Array>, chunkSize: number): ReadableStream<Uint8Array> {
@@ -38,7 +38,7 @@ export class Path {
38
38
  if (this.parts.includes(PartType.Root) && part === PartType.Root) {
39
39
  throw new Error("Cannot add absolute part to absolute path");
40
40
  }
41
- const last = this.parts[this.parts.length - 1] as number;
41
+ const last = this.parts[this.parts.length - 1] as PartType;
42
42
  if (last & PartType.Slash && part === PartType.Slash) {
43
43
  return;
44
44
  }
@@ -19,7 +19,7 @@ export async function stream2string(stream?: ReadableStream<Uint8Array> | null,
19
19
  rSize += read.value.length;
20
20
  res += block;
21
21
  } catch (err) {
22
- return Promise.reject(err);
22
+ return Promise.reject(err as Error);
23
23
  }
24
24
  }
25
25
  return Promise.resolve(res);
@@ -40,7 +40,7 @@ export async function stream2uint8array(stream?: ReadableStream<Uint8Array> | nu
40
40
  }
41
41
  res = new Uint8Array([...res, ...value]);
42
42
  } catch (err) {
43
- return Promise.reject(err);
43
+ return Promise.reject(err as Error);
44
44
  }
45
45
  }
46
46
  return Promise.resolve(res);
@@ -1,6 +1,6 @@
1
1
  export type StripCommand = string | RegExp;
2
2
 
3
- export function stripper<T extends unknown | ArrayLike<unknown>>(
3
+ export function stripper<T extends ArrayLike<S> | S, S>(
4
4
  strip: StripCommand | StripCommand[],
5
5
  obj: T,
6
6
  ): T extends ArrayLike<unknown> ? Record<string, unknown>[] : Record<string, unknown> {
@@ -49,7 +49,7 @@ function localStripper<T>(path: string | undefined, restrips: RegExp[], obj: T):
49
49
  }
50
50
  if (typeof ret[key] === "object") {
51
51
  if (Array.isArray(ret[key])) {
52
- ret[key] = ret[key].reduce((acc, v, i) => {
52
+ ret[key] = ret[key].reduce((acc: unknown[], v, i) => {
53
53
  const toDelete = matcher(key, `${nextPath}[${i}]`);
54
54
  if (!toDelete) {
55
55
  acc.push(localStripper(`${nextPath}[${i}]`, restrips, v));
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
- export const VERSION = Object.keys({
1
+ export const VERSION: string = Object.keys({
2
2
  __packageVersion__: "xxxx",
3
- })[0] as string;
3
+ })[0];
@@ -29,7 +29,7 @@ export class WebFileService implements FileService {
29
29
  throw new Error("join-Method not implemented.");
30
30
  }
31
31
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
32
- relative(from: string, to?: string | undefined): string {
32
+ relative(from: string, to?: string): string {
33
33
  throw new Error("relative-Method not implemented.");
34
34
  }
35
35
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -0,0 +1,4 @@
1
+ type StripCommand = string | RegExp;
2
+ declare function stripper<T extends ArrayLike<S> | S, S>(strip: StripCommand | StripCommand[], obj: T): T extends ArrayLike<unknown> ? Record<string, unknown>[] : Record<string, unknown>;
3
+
4
+ export { type StripCommand as S, stripper as s };
@@ -0,0 +1,4 @@
1
+ type StripCommand = string | RegExp;
2
+ declare function stripper<T extends ArrayLike<S> | S, S>(strip: StripCommand | StripCommand[], obj: T): T extends ArrayLike<unknown> ? Record<string, unknown>[] : Record<string, unknown>;
3
+
4
+ export { type StripCommand as S, stripper as s };
@@ -1,3 +1,5 @@
1
+ import { K as KeysParam, R as Result } from './get-params-result-Bhy5997x.cjs';
2
+
1
3
  interface NamedWritableStream {
2
4
  readonly name: string;
3
5
  readonly stream: WritableStream<Uint8Array>;
@@ -15,6 +17,7 @@ interface FileService {
15
17
  isAbsolute(fname: string): boolean;
16
18
  }
17
19
 
20
+ type EnvTuple = ([string, string] | [string, string][] | Record<string, string> | Iterator<[string, string]>)[];
18
21
  interface EnvMap {
19
22
  get(key: string): string | undefined;
20
23
  set(key: string, value?: string): void;
@@ -36,6 +39,8 @@ interface OnSetItem {
36
39
  }
37
40
  interface Env extends EnvMap {
38
41
  onSet(fn: OnSetFn, ...filter: string[]): void;
42
+ gets(...kparams: KeysParam): Result<Record<string, string>>;
43
+ sets(...keys: EnvTuple): void;
39
44
  }
40
45
  type EnvFactoryFn = (opts: Partial<EnvFactoryOpts>) => EnvActions;
41
46
  declare function registerEnvAction(fn: EnvFactoryFn): () => void;
@@ -43,6 +48,8 @@ declare function envFactory(opts?: Partial<EnvFactoryOpts>): Env;
43
48
  declare class EnvImpl implements Env {
44
49
  readonly _map: EnvMap;
45
50
  constructor(map: EnvMap, opts?: Partial<EnvFactoryOpts>);
51
+ gets(...kparams: KeysParam): Result<Record<string, string>>;
52
+ sets(...keys: EnvTuple): void;
46
53
  _updatePresets(presetEnv?: Map<string, string>): void;
47
54
  _applyOnSet(onSet: OnSetItem[], key?: string, value?: string): void;
48
55
  readonly _onSet: OnSetItem[];
@@ -99,4 +106,4 @@ interface SysAbstraction {
99
106
  FileSystem(): FileService;
100
107
  }
101
108
 
102
- export { type Duration as D, type Env as E, type FileService as F, IDMode as I, type NamedWritableStream as N, type OnSetItem as O, RandomMode as R, type SystemService as S, Time as T, type VoidFunc as V, type SysAbstraction as a, TimeMode as b, String2TimeMode as c, type EnvMap as d, type EnvActions as e, type EnvFactoryOpts as f, type EnvFactoryFn as g, envFactory as h, EnvImpl as i, TimeUnits as j, registerEnvAction as r };
109
+ export { type Duration as D, type Env as E, type FileService as F, IDMode as I, type NamedWritableStream as N, type OnSetItem as O, RandomMode as R, type SystemService as S, Time as T, type VoidFunc as V, type SysAbstraction as a, TimeMode as b, String2TimeMode as c, type EnvTuple as d, type EnvMap as e, type EnvActions as f, type EnvFactoryOpts as g, type EnvFactoryFn as h, envFactory as i, EnvImpl as j, TimeUnits as k, registerEnvAction as r };