@davidsouther/jiffies 2.2.5 → 2026.4.0

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 (427) hide show
  1. package/LICENSE +1 -1
  2. package/package.json +22 -25
  3. package/src/assert.ts +5 -5
  4. package/src/components/button_bar.ts +28 -30
  5. package/src/components/inline_edit.ts +8 -7
  6. package/src/components/logger.ts +6 -6
  7. package/src/components/select.ts +7 -7
  8. package/src/components/test.ts +5 -0
  9. package/src/components/virtual_scroll.test.ts +9 -6
  10. package/src/components/virtual_scroll.ts +29 -24
  11. package/src/context.test.ts +4 -4
  12. package/src/context.ts +16 -11
  13. package/src/debounce.ts +9 -3
  14. package/src/diff.test.ts +4 -4
  15. package/src/diff.ts +14 -16
  16. package/src/dom/css/border.ts +11 -11
  17. package/src/dom/css/core.ts +1 -1
  18. package/src/dom/css/fstyle.ts +4 -4
  19. package/src/dom/css/sizing.ts +1 -1
  20. package/src/dom/dom.ts +59 -47
  21. package/src/dom/fc.test.ts +8 -8
  22. package/src/dom/fc.ts +32 -35
  23. package/src/dom/form/form.app.ts +9 -9
  24. package/src/dom/form/form.ts +21 -15
  25. package/src/dom/form/index.html +3 -2
  26. package/src/dom/html.test.ts +12 -10
  27. package/src/dom/html.ts +2 -3
  28. package/src/dom/index.ts +2 -0
  29. package/src/dom/observable.test.ts +6 -6
  30. package/src/dom/observable.ts +2 -2
  31. package/src/dom/provide.ts +1 -1
  32. package/src/dom/router/link.ts +3 -3
  33. package/src/dom/router/router.ts +5 -5
  34. package/src/dom/svg.ts +7 -6
  35. package/src/dom/test.ts +3 -0
  36. package/src/dom/types/css.ts +43 -61
  37. package/src/dom/types/html.ts +2 -4
  38. package/src/dom/xml.ts +2 -2
  39. package/src/equal.test.ts +3 -3
  40. package/src/equal.ts +27 -14
  41. package/src/flags.test.ts +2 -2
  42. package/src/flags.ts +2 -2
  43. package/src/fs.test.ts +5 -5
  44. package/src/fs.ts +26 -20
  45. package/src/fs_node.ts +4 -4
  46. package/src/fs_win.test.ts +1 -1
  47. package/src/generator.test.ts +4 -3
  48. package/src/generator.ts +1 -1
  49. package/src/hooks/_notes +4 -1
  50. package/src/index.html +7 -7
  51. package/src/lock.test.ts +4 -4
  52. package/src/lock.ts +8 -7
  53. package/src/log.ts +17 -18
  54. package/src/observable/event.ts +7 -7
  55. package/src/observable/observable.test.ts +3 -3
  56. package/src/observable/observable.ts +73 -52
  57. package/src/result.test.ts +7 -10
  58. package/src/result.ts +51 -47
  59. package/src/safe.ts +1 -1
  60. package/src/scope/describe.ts +12 -11
  61. package/src/scope/display/console.ts +4 -4
  62. package/src/scope/display/dom.ts +9 -9
  63. package/src/scope/display/junit.ts +21 -24
  64. package/src/scope/execute.ts +17 -12
  65. package/src/scope/expect.ts +22 -22
  66. package/src/scope/fix.ts +8 -7
  67. package/src/scope/index.ts +3 -3
  68. package/src/scope/scope.ts +2 -2
  69. package/src/scope/state.ts +2 -2
  70. package/src/server/http/apps.ts +5 -5
  71. package/src/server/http/css.ts +10 -26
  72. package/src/server/http/index.ts +30 -24
  73. package/src/server/http/response.ts +12 -5
  74. package/src/server/http/sitemap.ts +8 -8
  75. package/src/server/http/static.ts +9 -6
  76. package/src/server/http/typescript.ts +25 -25
  77. package/src/server/main.ts +7 -4
  78. package/src/test.mjs +8 -8
  79. package/src/test_all.ts +16 -13
  80. package/src/transpile.mjs +5 -18
  81. package/tsconfig.json +34 -0
  82. package/build/pico.css +0 -2466
  83. package/build/pico.css.map +0 -1
  84. package/lib/cjs/assert.d.ts +0 -26
  85. package/lib/cjs/assert.js +0 -46
  86. package/lib/cjs/awaitable.d.ts +0 -1
  87. package/lib/cjs/awaitable.js +0 -2
  88. package/lib/cjs/case.d.ts +0 -1
  89. package/lib/cjs/case.js +0 -9
  90. package/lib/cjs/components/button_bar.d.ts +0 -8
  91. package/lib/cjs/components/button_bar.js +0 -29
  92. package/lib/cjs/components/inline_edit.d.ts +0 -12
  93. package/lib/cjs/components/inline_edit.js +0 -51
  94. package/lib/cjs/components/logger.d.ts +0 -6
  95. package/lib/cjs/components/logger.js +0 -27
  96. package/lib/cjs/components/select.d.ts +0 -13
  97. package/lib/cjs/components/select.js +0 -6
  98. package/lib/cjs/components/test.d.ts +0 -1
  99. package/lib/cjs/components/test.js +0 -7
  100. package/lib/cjs/components/virtual_scroll.d.ts +0 -40
  101. package/lib/cjs/components/virtual_scroll.js +0 -102
  102. package/lib/cjs/components/virtual_scroll.test.d.ts +0 -1
  103. package/lib/cjs/components/virtual_scroll.test.js +0 -22
  104. package/lib/cjs/context.d.ts +0 -15
  105. package/lib/cjs/context.js +0 -48
  106. package/lib/cjs/context.test.d.ts +0 -1
  107. package/lib/cjs/context.test.js +0 -48
  108. package/lib/cjs/debounce.d.ts +0 -1
  109. package/lib/cjs/debounce.js +0 -12
  110. package/lib/cjs/diff.d.ts +0 -15
  111. package/lib/cjs/diff.js +0 -58
  112. package/lib/cjs/diff.test.d.ts +0 -1
  113. package/lib/cjs/diff.test.js +0 -41
  114. package/lib/cjs/display.d.ts +0 -5
  115. package/lib/cjs/display.js +0 -16
  116. package/lib/cjs/dom/css/border.d.ts +0 -11
  117. package/lib/cjs/dom/css/border.js +0 -33
  118. package/lib/cjs/dom/css/constants.d.ts +0 -31
  119. package/lib/cjs/dom/css/constants.js +0 -31
  120. package/lib/cjs/dom/css/core.d.ts +0 -5
  121. package/lib/cjs/dom/css/core.js +0 -31
  122. package/lib/cjs/dom/css/fstyle.d.ts +0 -5
  123. package/lib/cjs/dom/css/fstyle.js +0 -36
  124. package/lib/cjs/dom/css/sizing.d.ts +0 -5
  125. package/lib/cjs/dom/css/sizing.js +0 -14
  126. package/lib/cjs/dom/dom.d.ts +0 -27
  127. package/lib/cjs/dom/dom.js +0 -110
  128. package/lib/cjs/dom/fc.d.ts +0 -14
  129. package/lib/cjs/dom/fc.js +0 -39
  130. package/lib/cjs/dom/fc.test.d.ts +0 -1
  131. package/lib/cjs/dom/fc.test.js +0 -23
  132. package/lib/cjs/dom/form/form.app.d.ts +0 -1
  133. package/lib/cjs/dom/form/form.app.js +0 -27
  134. package/lib/cjs/dom/form/form.d.ts +0 -26
  135. package/lib/cjs/dom/form/form.js +0 -49
  136. package/lib/cjs/dom/form/form.test.d.ts +0 -0
  137. package/lib/cjs/dom/form/form.test.js +0 -1
  138. package/lib/cjs/dom/html.d.ts +0 -113
  139. package/lib/cjs/dom/html.js +0 -119
  140. package/lib/cjs/dom/html.test.d.ts +0 -1
  141. package/lib/cjs/dom/html.test.js +0 -60
  142. package/lib/cjs/dom/observable.d.ts +0 -2
  143. package/lib/cjs/dom/observable.js +0 -10
  144. package/lib/cjs/dom/observable.test.d.ts +0 -1
  145. package/lib/cjs/dom/observable.test.js +0 -35
  146. package/lib/cjs/dom/provide.d.ts +0 -3
  147. package/lib/cjs/dom/provide.js +0 -12
  148. package/lib/cjs/dom/router/link.d.ts +0 -6
  149. package/lib/cjs/dom/router/link.js +0 -7
  150. package/lib/cjs/dom/router/router.d.ts +0 -13
  151. package/lib/cjs/dom/router/router.js +0 -55
  152. package/lib/cjs/dom/svg.d.ts +0 -64
  153. package/lib/cjs/dom/svg.js +0 -69
  154. package/lib/cjs/dom/test.d.ts +0 -1
  155. package/lib/cjs/dom/test.js +0 -13
  156. package/lib/cjs/dom/types/css.d.ts +0 -6612
  157. package/lib/cjs/dom/types/css.js +0 -24
  158. package/lib/cjs/dom/types/dom.d.ts +0 -0
  159. package/lib/cjs/dom/types/dom.js +0 -1
  160. package/lib/cjs/dom/types/html.d.ts +0 -616
  161. package/lib/cjs/dom/types/html.js +0 -2
  162. package/lib/cjs/dom/xml.d.ts +0 -1
  163. package/lib/cjs/dom/xml.js +0 -8
  164. package/lib/cjs/equal.d.ts +0 -8
  165. package/lib/cjs/equal.js +0 -48
  166. package/lib/cjs/equal.test.d.ts +0 -1
  167. package/lib/cjs/equal.test.js +0 -22
  168. package/lib/cjs/flags.d.ts +0 -7
  169. package/lib/cjs/flags.js +0 -52
  170. package/lib/cjs/flags.test.d.ts +0 -1
  171. package/lib/cjs/flags.test.js +0 -37
  172. package/lib/cjs/fs.d.ts +0 -72
  173. package/lib/cjs/fs.js +0 -235
  174. package/lib/cjs/fs.test.d.ts +0 -1
  175. package/lib/cjs/fs.test.js +0 -86
  176. package/lib/cjs/fs_node.d.ts +0 -15
  177. package/lib/cjs/fs_node.js +0 -50
  178. package/lib/cjs/fs_win.test.d.ts +0 -1
  179. package/lib/cjs/fs_win.test.js +0 -10
  180. package/lib/cjs/generator.d.ts +0 -1
  181. package/lib/cjs/generator.js +0 -14
  182. package/lib/cjs/generator.test.d.ts +0 -1
  183. package/lib/cjs/generator.test.js +0 -26
  184. package/lib/cjs/is_browser.d.ts +0 -1
  185. package/lib/cjs/is_browser.js +0 -4
  186. package/lib/cjs/loader-register.d.mts +0 -1
  187. package/lib/cjs/loader-register.d.ts +0 -1
  188. package/lib/cjs/loader-register.js +0 -4
  189. package/lib/cjs/loader-register.mjs +0 -4
  190. package/lib/cjs/loader.d.mts +0 -23
  191. package/lib/cjs/loader.mjs +0 -41
  192. package/lib/cjs/lock.d.ts +0 -1
  193. package/lib/cjs/lock.js +0 -27
  194. package/lib/cjs/lock.test.d.ts +0 -1
  195. package/lib/cjs/lock.test.js +0 -18
  196. package/lib/cjs/log.d.ts +0 -56
  197. package/lib/cjs/log.js +0 -103
  198. package/lib/cjs/observable/event.d.ts +0 -35
  199. package/lib/cjs/observable/event.js +0 -61
  200. package/lib/cjs/observable/observable.d.ts +0 -132
  201. package/lib/cjs/observable/observable.js +0 -363
  202. package/lib/cjs/observable/observable.test.d.ts +0 -1
  203. package/lib/cjs/observable/observable.test.js +0 -65
  204. package/lib/cjs/package.json +0 -1
  205. package/lib/cjs/range.d.ts +0 -1
  206. package/lib/cjs/range.js +0 -11
  207. package/lib/cjs/result.d.ts +0 -31
  208. package/lib/cjs/result.js +0 -80
  209. package/lib/cjs/result.test.d.ts +0 -1
  210. package/lib/cjs/result.test.js +0 -78
  211. package/lib/cjs/safe.d.ts +0 -1
  212. package/lib/cjs/safe.js +0 -14
  213. package/lib/cjs/scope/describe.d.ts +0 -18
  214. package/lib/cjs/scope/describe.js +0 -73
  215. package/lib/cjs/scope/display/console.d.ts +0 -2
  216. package/lib/cjs/scope/display/console.js +0 -25
  217. package/lib/cjs/scope/display/dom.d.ts +0 -3
  218. package/lib/cjs/scope/display/dom.js +0 -30
  219. package/lib/cjs/scope/display/junit.d.ts +0 -2
  220. package/lib/cjs/scope/display/junit.js +0 -21
  221. package/lib/cjs/scope/execute.d.ts +0 -12
  222. package/lib/cjs/scope/execute.js +0 -91
  223. package/lib/cjs/scope/expect.d.ts +0 -23
  224. package/lib/cjs/scope/expect.js +0 -110
  225. package/lib/cjs/scope/fix.d.ts +0 -4
  226. package/lib/cjs/scope/fix.js +0 -26
  227. package/lib/cjs/scope/index.d.ts +0 -3
  228. package/lib/cjs/scope/index.js +0 -15
  229. package/lib/cjs/scope/scope.d.ts +0 -17
  230. package/lib/cjs/scope/scope.js +0 -2
  231. package/lib/cjs/scope/state.d.ts +0 -2
  232. package/lib/cjs/scope/state.js +0 -12
  233. package/lib/cjs/server/http/apps.d.ts +0 -5
  234. package/lib/cjs/server/http/apps.js +0 -27
  235. package/lib/cjs/server/http/css.d.ts +0 -5
  236. package/lib/cjs/server/http/css.js +0 -54
  237. package/lib/cjs/server/http/index.d.ts +0 -21
  238. package/lib/cjs/server/http/index.js +0 -77
  239. package/lib/cjs/server/http/response.d.ts +0 -4
  240. package/lib/cjs/server/http/response.js +0 -45
  241. package/lib/cjs/server/http/sitemap.d.ts +0 -2
  242. package/lib/cjs/server/http/sitemap.js +0 -46
  243. package/lib/cjs/server/http/static.d.ts +0 -2
  244. package/lib/cjs/server/http/static.js +0 -25
  245. package/lib/cjs/server/http/typescript.d.ts +0 -5
  246. package/lib/cjs/server/http/typescript.js +0 -44
  247. package/lib/cjs/server/main.d.ts +0 -2
  248. package/lib/cjs/server/main.js +0 -14
  249. package/lib/cjs/test.d.mts +0 -2
  250. package/lib/cjs/test.mjs +0 -28
  251. package/lib/cjs/test_all.d.ts +0 -9
  252. package/lib/cjs/test_all.js +0 -30
  253. package/lib/cjs/transpile.d.mts +0 -3
  254. package/lib/cjs/transpile.mjs +0 -22
  255. package/lib/cjs/tsconfig.tsbuildinfo +0 -1
  256. package/lib/esm/assert.d.ts +0 -26
  257. package/lib/esm/assert.js +0 -38
  258. package/lib/esm/awaitable.d.ts +0 -1
  259. package/lib/esm/awaitable.js +0 -1
  260. package/lib/esm/case.d.ts +0 -1
  261. package/lib/esm/case.js +0 -5
  262. package/lib/esm/components/button_bar.d.ts +0 -8
  263. package/lib/esm/components/button_bar.js +0 -27
  264. package/lib/esm/components/inline_edit.d.ts +0 -12
  265. package/lib/esm/components/inline_edit.js +0 -48
  266. package/lib/esm/components/logger.d.ts +0 -6
  267. package/lib/esm/components/logger.js +0 -22
  268. package/lib/esm/components/select.d.ts +0 -10
  269. package/lib/esm/components/select.js +0 -3
  270. package/lib/esm/components/test.d.ts +0 -1
  271. package/lib/esm/components/test.js +0 -3
  272. package/lib/esm/components/virtual_scroll.d.ts +0 -40
  273. package/lib/esm/components/virtual_scroll.js +0 -94
  274. package/lib/esm/components/virtual_scroll.test.d.ts +0 -1
  275. package/lib/esm/components/virtual_scroll.test.js +0 -20
  276. package/lib/esm/context.d.ts +0 -15
  277. package/lib/esm/context.js +0 -43
  278. package/lib/esm/context.test.d.ts +0 -1
  279. package/lib/esm/context.test.js +0 -46
  280. package/lib/esm/debounce.d.ts +0 -2
  281. package/lib/esm/debounce.js +0 -8
  282. package/lib/esm/diff.d.ts +0 -15
  283. package/lib/esm/diff.js +0 -54
  284. package/lib/esm/diff.test.d.ts +0 -1
  285. package/lib/esm/diff.test.js +0 -39
  286. package/lib/esm/display.d.ts +0 -5
  287. package/lib/esm/display.js +0 -11
  288. package/lib/esm/dom/css/border.d.ts +0 -11
  289. package/lib/esm/dom/css/border.js +0 -27
  290. package/lib/esm/dom/css/constants.d.ts +0 -31
  291. package/lib/esm/dom/css/constants.js +0 -28
  292. package/lib/esm/dom/css/core.d.ts +0 -5
  293. package/lib/esm/dom/css/core.js +0 -24
  294. package/lib/esm/dom/css/fstyle.d.ts +0 -5
  295. package/lib/esm/dom/css/fstyle.js +0 -32
  296. package/lib/esm/dom/css/sizing.d.ts +0 -5
  297. package/lib/esm/dom/css/sizing.js +0 -10
  298. package/lib/esm/dom/dom.d.ts +0 -27
  299. package/lib/esm/dom/dom.js +0 -104
  300. package/lib/esm/dom/fc.d.ts +0 -14
  301. package/lib/esm/dom/fc.js +0 -35
  302. package/lib/esm/dom/fc.test.d.ts +0 -1
  303. package/lib/esm/dom/fc.test.js +0 -21
  304. package/lib/esm/dom/form/form.app.d.ts +0 -1
  305. package/lib/esm/dom/form/form.app.js +0 -23
  306. package/lib/esm/dom/form/form.d.ts +0 -26
  307. package/lib/esm/dom/form/form.js +0 -34
  308. package/lib/esm/dom/form/form.test.d.ts +0 -0
  309. package/lib/esm/dom/form/form.test.js +0 -1
  310. package/lib/esm/dom/html.d.ts +0 -113
  311. package/lib/esm/dom/html.js +0 -114
  312. package/lib/esm/dom/html.test.d.ts +0 -1
  313. package/lib/esm/dom/html.test.js +0 -58
  314. package/lib/esm/dom/observable.d.ts +0 -2
  315. package/lib/esm/dom/observable.js +0 -6
  316. package/lib/esm/dom/observable.test.d.ts +0 -1
  317. package/lib/esm/dom/observable.test.js +0 -33
  318. package/lib/esm/dom/provide.d.ts +0 -3
  319. package/lib/esm/dom/provide.js +0 -7
  320. package/lib/esm/dom/router/link.d.ts +0 -6
  321. package/lib/esm/dom/router/link.js +0 -3
  322. package/lib/esm/dom/router/router.d.ts +0 -13
  323. package/lib/esm/dom/router/router.js +0 -52
  324. package/lib/esm/dom/svg.d.ts +0 -64
  325. package/lib/esm/dom/svg.js +0 -65
  326. package/lib/esm/dom/test.d.ts +0 -1
  327. package/lib/esm/dom/test.js +0 -9
  328. package/lib/esm/dom/types/css.d.ts +0 -6612
  329. package/lib/esm/dom/types/css.js +0 -23
  330. package/lib/esm/dom/types/dom.d.ts +0 -0
  331. package/lib/esm/dom/types/dom.js +0 -1
  332. package/lib/esm/dom/types/html.d.ts +0 -616
  333. package/lib/esm/dom/types/html.js +0 -1
  334. package/lib/esm/dom/xml.d.ts +0 -1
  335. package/lib/esm/dom/xml.js +0 -4
  336. package/lib/esm/equal.d.ts +0 -8
  337. package/lib/esm/equal.js +0 -41
  338. package/lib/esm/equal.test.d.ts +0 -1
  339. package/lib/esm/equal.test.js +0 -20
  340. package/lib/esm/flags.d.ts +0 -7
  341. package/lib/esm/flags.js +0 -48
  342. package/lib/esm/flags.test.d.ts +0 -1
  343. package/lib/esm/flags.test.js +0 -35
  344. package/lib/esm/fs.d.ts +0 -72
  345. package/lib/esm/fs.js +0 -226
  346. package/lib/esm/fs.test.d.ts +0 -1
  347. package/lib/esm/fs.test.js +0 -84
  348. package/lib/esm/fs_node.d.ts +0 -15
  349. package/lib/esm/fs_node.js +0 -45
  350. package/lib/esm/fs_win.test.d.ts +0 -1
  351. package/lib/esm/fs_win.test.js +0 -8
  352. package/lib/esm/generator.d.ts +0 -1
  353. package/lib/esm/generator.js +0 -10
  354. package/lib/esm/generator.test.d.ts +0 -1
  355. package/lib/esm/generator.test.js +0 -24
  356. package/lib/esm/is_browser.d.ts +0 -1
  357. package/lib/esm/is_browser.js +0 -1
  358. package/lib/esm/loader-register.d.mts +0 -1
  359. package/lib/esm/loader-register.mjs +0 -2
  360. package/lib/esm/loader.d.mts +0 -23
  361. package/lib/esm/loader.mjs +0 -36
  362. package/lib/esm/lock.d.ts +0 -1
  363. package/lib/esm/lock.js +0 -23
  364. package/lib/esm/lock.test.d.ts +0 -1
  365. package/lib/esm/lock.test.js +0 -16
  366. package/lib/esm/log.d.ts +0 -56
  367. package/lib/esm/log.js +0 -93
  368. package/lib/esm/observable/event.d.ts +0 -35
  369. package/lib/esm/observable/event.js +0 -46
  370. package/lib/esm/observable/observable.d.ts +0 -132
  371. package/lib/esm/observable/observable.js +0 -343
  372. package/lib/esm/observable/observable.test.d.ts +0 -1
  373. package/lib/esm/observable/observable.test.js +0 -63
  374. package/lib/esm/range.d.ts +0 -1
  375. package/lib/esm/range.js +0 -7
  376. package/lib/esm/result.d.ts +0 -31
  377. package/lib/esm/result.js +0 -65
  378. package/lib/esm/result.test.d.ts +0 -1
  379. package/lib/esm/result.test.js +0 -76
  380. package/lib/esm/safe.d.ts +0 -1
  381. package/lib/esm/safe.js +0 -10
  382. package/lib/esm/scope/describe.d.ts +0 -18
  383. package/lib/esm/scope/describe.js +0 -60
  384. package/lib/esm/scope/display/console.d.ts +0 -2
  385. package/lib/esm/scope/display/console.js +0 -21
  386. package/lib/esm/scope/display/dom.d.ts +0 -3
  387. package/lib/esm/scope/display/dom.js +0 -26
  388. package/lib/esm/scope/display/junit.d.ts +0 -2
  389. package/lib/esm/scope/display/junit.js +0 -17
  390. package/lib/esm/scope/execute.d.ts +0 -12
  391. package/lib/esm/scope/execute.js +0 -85
  392. package/lib/esm/scope/expect.d.ts +0 -23
  393. package/lib/esm/scope/expect.js +0 -104
  394. package/lib/esm/scope/fix.d.ts +0 -4
  395. package/lib/esm/scope/fix.js +0 -22
  396. package/lib/esm/scope/index.d.ts +0 -3
  397. package/lib/esm/scope/index.js +0 -3
  398. package/lib/esm/scope/scope.d.ts +0 -17
  399. package/lib/esm/scope/scope.js +0 -1
  400. package/lib/esm/scope/state.d.ts +0 -2
  401. package/lib/esm/scope/state.js +0 -8
  402. package/lib/esm/server/http/apps.d.ts +0 -5
  403. package/lib/esm/server/http/apps.js +0 -23
  404. package/lib/esm/server/http/css.d.ts +0 -5
  405. package/lib/esm/server/http/css.js +0 -50
  406. package/lib/esm/server/http/index.d.ts +0 -21
  407. package/lib/esm/server/http/index.js +0 -73
  408. package/lib/esm/server/http/response.d.ts +0 -4
  409. package/lib/esm/server/http/response.js +0 -40
  410. package/lib/esm/server/http/sitemap.d.ts +0 -2
  411. package/lib/esm/server/http/sitemap.js +0 -42
  412. package/lib/esm/server/http/static.d.ts +0 -2
  413. package/lib/esm/server/http/static.js +0 -21
  414. package/lib/esm/server/http/typescript.d.ts +0 -5
  415. package/lib/esm/server/http/typescript.js +0 -40
  416. package/lib/esm/server/main.d.ts +0 -2
  417. package/lib/esm/server/main.js +0 -12
  418. package/lib/esm/test.d.mts +0 -2
  419. package/lib/esm/test.mjs +0 -26
  420. package/lib/esm/test_all.d.ts +0 -9
  421. package/lib/esm/test_all.js +0 -28
  422. package/lib/esm/transpile.d.mts +0 -3
  423. package/lib/esm/transpile.mjs +0 -18
  424. package/lib/esm/tsconfig.tsbuildinfo +0 -1
  425. package/src/components/test.js +0 -3
  426. package/src/loader-register.mjs +0 -3
  427. package/src/loader.mjs +0 -46
@@ -1,12 +1,13 @@
1
- import { takeWhile } from "./generator.js";
2
- import { describe, it, expect } from "./scope/index.js";
1
+ import { takeWhile } from "./generator.ts";
2
+ import { describe, expect, it } from "./scope/index.ts";
3
3
 
4
4
  describe("Generator", () => {
5
5
  it("takes from a generator until a predicate", () => {
6
6
  const generator = function* () {
7
7
  let i = 1;
8
8
  while (true) {
9
- yield (i = i * 2);
9
+ i = i * 2;
10
+ yield i;
10
11
  }
11
12
  };
12
13
  const filter = () => {
package/src/generator.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export function* takeWhile<T>(
2
2
  predicate: (t: T) => boolean,
3
- iterator: Iterable<T>
3
+ iterator: Iterable<T>,
4
4
  ) {
5
5
  for (const x of iterator) {
6
6
  if (predicate(x)) {
package/src/hooks/_notes CHANGED
@@ -1,3 +1,6 @@
1
1
  useEffect
2
2
  useState
3
- useContext
3
+ useContext
4
+
5
+
6
+ signal(n) => n, setN
package/src/index.html CHANGED
@@ -23,10 +23,10 @@
23
23
  import("./components/test.js"),
24
24
  ]);
25
25
 
26
- import { execute } from "./scope/execute.js";
27
- import { displayStatistics } from "./scope/display/dom.js";
28
- import { onConsole } from "./scope/display/console.js";
29
- import { asXML } from "./scope/display/junit.js";
26
+ import { onConsole } from "./scope/display/console.ts";
27
+ import { displayStatistics } from "./scope/display/dom.ts";
28
+ import { asXML } from "./scope/display/junit.ts";
29
+ import { execute } from "./scope/execute.ts";
30
30
 
31
31
  function write(id, value) {
32
32
  const start = `--- START_${id.toUpperCase()} ---`;
@@ -46,8 +46,8 @@
46
46
  })();
47
47
  </script>
48
48
  <script type="module">
49
- import { nav, ul, li, strong } from "./dom/html.js";
50
- import { link } from "./dom/router/link.js";
49
+ import { li, nav, strong, ul } from "./dom/html.ts";
50
+ import { link } from "./dom/router/link.ts";
51
51
 
52
52
  const getUrls = async () => {
53
53
  const sitemap = await fetch("/sitemap.json");
@@ -65,7 +65,7 @@
65
65
  const urls = (await getUrls()).map((url) => ({
66
66
  href: url.replace("index.html", ""),
67
67
  link:
68
- url.match(/\/(?<link>[^\/]+)(\/index\.html)?$/)?.groups["link"] ??
68
+ url.match(/\/(?<link>[^/]+)(\/index\.html)?$/)?.groups.link ??
69
69
  url.replace("index.html", ""),
70
70
  }));
71
71
 
package/src/lock.test.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { describe, it, expect } from "./scope/index.js";
2
- import { lock } from "./lock.js";
1
+ import { lock } from "./lock.ts";
2
+ import { describe, expect, it } from "./scope/index.ts";
3
3
 
4
4
  describe("Lock", () => {
5
- it("prevents reentry", function () {
5
+ it("prevents reentry", () => {
6
6
  let count = 0;
7
- const inc = lock(function () {
7
+ const inc = lock(() => {
8
8
  if (count > 4) {
9
9
  return;
10
10
  }
package/src/lock.ts CHANGED
@@ -1,13 +1,13 @@
1
- const locks = new WeakSet<Function>();
1
+ const locks = new WeakSet<CallableFunction>();
2
2
 
3
- export function lock(fn: Function): Function {
4
- return function (...args: unknown[]) {
5
- let ret = null;
3
+ export function lock<CF extends (...args: unknown[]) => unknown>(fn: CF): CF {
4
+ const lockingFn = (...args: unknown[]): ReturnType<CF> => {
5
+ let ret: ReturnType<CF>;
6
6
  let ex = null;
7
7
  if (!locks.has(fn)) {
8
8
  locks.add(fn);
9
9
  try {
10
- ret = fn(...args);
10
+ ret = fn(...args) as ReturnType<CF>;
11
11
  } catch (e) {
12
12
  ex = e;
13
13
  }
@@ -15,8 +15,9 @@ export function lock(fn: Function): Function {
15
15
  locks.delete(fn);
16
16
  if (ex !== null) {
17
17
  throw ex;
18
- } else {
19
- return ret;
20
18
  }
19
+ // @ts-expect-error 2454 can't track ret's assignment
20
+ return ret;
21
21
  };
22
+ return lockingFn as CF;
22
23
  }
package/src/log.ts CHANGED
@@ -1,8 +1,6 @@
1
- import { display, Display } from "./display.js";
1
+ import { type Display, display } from "./display.ts";
2
2
 
3
- export interface Log {
4
- (message: Display, data?: {}): void;
5
- }
3
+ export type Log = (message: Display, data?: object) => void;
6
4
 
7
5
  export interface Logger {
8
6
  logAt: (level: number, prefix: string, fn?: (logLine: string) => void) => Log;
@@ -14,9 +12,9 @@ export interface Logger {
14
12
  level: number;
15
13
  message: string;
16
14
  source: string;
17
- }
15
+ },
18
16
  >(
19
- data: D
17
+ data: D,
20
18
  ) => string;
21
19
  console: Console;
22
20
  default: (logLine: string) => void;
@@ -48,7 +46,8 @@ export const LEVELS: Record<string, number> = {
48
46
 
49
47
  export function getLogLevel(level = ""): number {
50
48
  return (
51
- LEVELS[level.toLowerCase()] ?? (!isNaN(+level) ? Number(level) : LEVEL.INFO)
49
+ LEVELS[level.toLowerCase()] ??
50
+ (!Number.isNaN(+level) ? Number(level) : LEVEL.INFO)
52
51
  );
53
52
  }
54
53
 
@@ -80,9 +79,9 @@ type LoggerFormatFn = <
80
79
  level: number;
81
80
  message: string;
82
81
  source: string;
83
- }
82
+ },
84
83
  >(
85
- data: D
84
+ data: D,
86
85
  ) => string;
87
86
 
88
87
  export function getLogger(
@@ -90,7 +89,7 @@ export function getLogger(
90
89
  args: LoggerFormatFn | { format?: LoggerFormatFn; console?: Console } = {
91
90
  format: JSON.stringify,
92
91
  console,
93
- }
92
+ },
94
93
  ): Logger {
95
94
  if (args instanceof Function) {
96
95
  args = { format: args };
@@ -102,19 +101,19 @@ export function getLogger(
102
101
  (
103
102
  level: number,
104
103
  prefix: string,
105
- fn: (logLine: string) => void = defaultLog
104
+ fn: (logLine: string) => void = defaultLog,
106
105
  ): Log =>
107
- (message: Display, data?: {}) =>
106
+ (message: Display, data?: object) =>
108
107
  level >= (logger.level ?? LEVEL.SILENT)
109
108
  ? fn(
110
- logger.format!({
109
+ logger.format?.({
111
110
  name,
112
111
  prefix,
113
112
  level,
114
113
  message: display(message),
115
114
  ...data,
116
115
  source: findSource(),
117
- })
116
+ }),
118
117
  )
119
118
  : undefined;
120
119
 
@@ -135,22 +134,22 @@ export function getLogger(
135
134
 
136
135
  export const DEFAULT_LOGGER = getLogger("default");
137
136
 
138
- export function debug(message: Display, data?: {}) {
137
+ export function debug(message: Display, data?: object) {
139
138
  if (data) DEFAULT_LOGGER.debug(message, data);
140
139
  else DEFAULT_LOGGER.debug(message);
141
140
  }
142
141
 
143
- export function info(message: Display, data?: {}) {
142
+ export function info(message: Display, data?: object) {
144
143
  if (data) DEFAULT_LOGGER.info(message, data);
145
144
  else DEFAULT_LOGGER.info(message);
146
145
  }
147
146
 
148
- export function warn(message: Display, data?: {}) {
147
+ export function warn(message: Display, data?: object) {
149
148
  if (data) DEFAULT_LOGGER.warn(message, data);
150
149
  else DEFAULT_LOGGER.warn(message);
151
150
  }
152
151
 
153
- export function error(message: Display, data?: {}) {
152
+ export function error(message: Display, data?: object) {
154
153
  if (data) DEFAULT_LOGGER.error(message, data);
155
154
  else DEFAULT_LOGGER.error(message);
156
155
  }
@@ -1,5 +1,5 @@
1
- import { display } from "../display.js"
2
- import { Observable } from "./observable.js"
1
+ import { display } from "../display.ts";
2
+ import type { Observable } from "./observable.ts";
3
3
 
4
4
  export interface Next<T> {
5
5
  value: T;
@@ -47,7 +47,7 @@ export const isNext = <T>(event: Event<T, unknown>): event is Next<T> =>
47
47
  export const isError = <E>(event: Event<unknown, E>): event is Error<E> =>
48
48
  event.failed && !event.completed;
49
49
  export const isCompleted = (
50
- event: Event<unknown, unknown>
50
+ event: Event<unknown, unknown>,
51
51
  ): event is Completed => event.completed && !event.failed;
52
52
  export const isFailed = (event: Event<unknown, unknown>): event is Failed =>
53
53
  event.completed && event.failed;
@@ -64,10 +64,10 @@ const marble = <T, E>(event: Event<T, E>): string =>
64
64
  isError(event)
65
65
  ? "X"
66
66
  : isFailed(event)
67
- ? "!"
68
- : isCompleted(event)
69
- ? "|"
70
- : `(${display(event.value)})`;
67
+ ? "!"
68
+ : isCompleted(event)
69
+ ? "|"
70
+ : `(${display(event.value)})`;
71
71
 
72
72
  export const marbles = <T, E>(events: Event<T, E>[]): string =>
73
73
  `:${events.map(marble).join("-")}`;
@@ -1,5 +1,5 @@
1
- import { describe, expect, it } from "../scope/index.js"
2
- import { Observable, Subject, filter, map } from "./observable.js"
1
+ import { describe, expect, it } from "../scope/index.ts";
2
+ import { filter, map, Observable, Subject } from "./observable.ts";
3
3
 
4
4
  describe("Observables", () => {
5
5
  describe("basics", () => {
@@ -23,7 +23,7 @@ describe("Observables", () => {
23
23
  describe("creation", () => {
24
24
  it("builds an observable of items", async () => {
25
25
  const stream = Observable.of(2, 4, 8, 16);
26
- let values: number[] = [];
26
+ const values: number[] = [];
27
27
  await new Promise<void>((resolve) => {
28
28
  stream.subscribe({
29
29
  next: (n) => {
@@ -1,16 +1,18 @@
1
- import { DEFAULT_LOGGER, Logger } from "../log.js"
1
+ import { assertExists } from "../assert.ts";
2
+ import type { Display } from "../display.ts";
3
+ import { DEFAULT_LOGGER, type Logger } from "../log.ts";
2
4
 
3
5
  export interface FullSubscriber<T, E> {
4
6
  // (t: T): void | Promise<undefined>;
5
- next?: (t: T) => void | Promise<undefined>;
6
- error?: (e: E) => void | Promise<undefined>;
7
- complete?: () => void | Promise<undefined>;
7
+ next?: (t: T) => void | Promise<void>;
8
+ error?: (e: E) => void | Promise<void>;
9
+ complete?: () => void | Promise<void>;
8
10
  }
9
11
 
10
12
  export type Subscriber<T, E> =
11
13
  | FullSubscriber<T, E>
12
14
  // | EventSubscriber<T, E>
13
- | ((t: T) => void | Promise<undefined>);
15
+ | ((t: T) => void | Promise<void>);
14
16
 
15
17
  export interface Subscription {
16
18
  // (): void;
@@ -23,7 +25,7 @@ export interface Observable<T, E = unknown> {
23
25
  pipe<T1>(o1: Subscriber<T, E> & Observable<T1, E>): Observable<T1, E>;
24
26
  pipe<T1, T2>(
25
27
  o1: Subscriber<T, E> & Observable<T1, E>,
26
- o2: Subscriber<T1, E> & Observable<T2, E>
28
+ o2: Subscriber<T1, E> & Observable<T2, E>,
27
29
  ): Observable<T2, E>;
28
30
  filter(fn: (t: T) => boolean): Observable<T, E>;
29
31
  distinct(fn?: (t1: T, t2: T) => boolean): Observable<T, E>;
@@ -45,7 +47,7 @@ export const Observable = {
45
47
  subject.complete();
46
48
  return;
47
49
  }
48
- const t = ts.shift()!;
50
+ const t = assertExists(ts.shift());
49
51
  await subject.next(t);
50
52
  next();
51
53
  })();
@@ -53,9 +55,9 @@ export const Observable = {
53
55
  },
54
56
  combineLatest<T1, T2, E>(
55
57
  o1: Observable<T1, E>,
56
- o2: Observable<T2, E>
58
+ o2: Observable<T2, E>,
57
59
  ): Observable<[T1, T2], E> {
58
- let latestSubject = new Subject<[T1, T2], E>();
60
+ const latestSubject = new Subject<[T1, T2], E>();
59
61
  let o1LatestSet = false;
60
62
  let o1Latest: T1;
61
63
  let o2LatestSet = false;
@@ -77,7 +79,7 @@ export const Observable = {
77
79
  o2sub.unsubscribe();
78
80
  }
79
81
 
80
- let o1sub = o1.subscribe({
82
+ const o1sub = o1.subscribe({
81
83
  next(t: T1) {
82
84
  o1Latest = t;
83
85
  o1LatestSet = true;
@@ -87,7 +89,7 @@ export const Observable = {
87
89
  complete,
88
90
  });
89
91
 
90
- let o2sub = o2.subscribe({
92
+ const o2sub = o2.subscribe({
91
93
  next(t: T2) {
92
94
  o2Latest = t;
93
95
  o2LatestSet = true;
@@ -102,25 +104,31 @@ export const Observable = {
102
104
  };
103
105
 
104
106
  interface Scheduler {
105
- execute(fn: () => (void | Promise<undefined>)[]): void | Promise<undefined>;
107
+ execute(fn: () => (void | Promise<void>)[]): void | Promise<void>;
106
108
  }
107
109
 
108
110
  export const AsyncScheduler: Scheduler = {
109
- execute(fn: () => Promise<undefined>[]): Promise<undefined> {
111
+ execute(fn: () => Promise<void>[]): Promise<void> {
110
112
  return Promise.all(fn()).then(() => undefined);
111
113
  },
112
114
  };
113
115
 
114
116
  export const SyncScheduler: Scheduler = {
115
- execute(fn: () => void[]): void {
117
+ execute(fn: () => undefined[]): void {
116
118
  fn();
117
119
  },
118
120
  };
119
121
 
122
+ let DefaultScheduler = SyncScheduler;
123
+ export function setDefaultScheduler(scheduler: Scheduler) {
124
+ DefaultScheduler = scheduler;
125
+ }
126
+
120
127
  export class Subject<T, E = unknown, T2 = T>
121
128
  implements FullSubscriber<T, E>, Observable<T, E>
122
129
  {
123
- #coldWaiters = new Set<Function>();
130
+ private readonly scheduler: Scheduler;
131
+ #coldWaiters = new Set<CallableFunction>();
124
132
  #subscribers = new Set<FullSubscriber<T, E>>();
125
133
  #complete = false;
126
134
 
@@ -136,34 +144,36 @@ export class Subject<T, E = unknown, T2 = T>
136
144
  return !this.hot;
137
145
  }
138
146
 
139
- constructor(private readonly scheduler: Scheduler = AsyncScheduler) {}
147
+ constructor(scheduler: Scheduler = DefaultScheduler) {
148
+ this.scheduler = scheduler;
149
+ }
140
150
 
141
- onWarm(fn: Function) {
151
+ onWarm(fn: CallableFunction) {
142
152
  if (this.cold) this.#coldWaiters.add(fn);
143
153
  }
144
154
 
145
- next(t: T | T2): void | Promise<undefined> {
155
+ next(t: T | T2): void | Promise<void> {
146
156
  if (this.#complete)
147
157
  throw new Error("Cannot call next on a completed subject");
148
158
  return this.scheduler.execute(() =>
149
- [...this.#subscribers].map((s) => s.next?.(t as T))
159
+ [...this.#subscribers].map((s) => s.next?.(t as T)),
150
160
  );
151
161
  }
152
162
 
153
- error(e: E): void | Promise<undefined> {
163
+ error(e: E): void | Promise<void> {
154
164
  if (this.#complete)
155
165
  throw new Error("Cannot call error on a completed subject");
156
166
  return this.scheduler.execute(() =>
157
- [...this.#subscribers].map((s) => s.error?.(e))
167
+ [...this.#subscribers].map((s) => s.error?.(e)),
158
168
  );
159
169
  }
160
170
 
161
- complete(): void | Promise<undefined> {
171
+ complete(): void | Promise<void> {
162
172
  if (this.#complete)
163
173
  throw new Error("Cannot call complete on a completed subject");
164
174
  this.#complete = true;
165
175
  const finished = this.scheduler.execute(() =>
166
- [...this.#subscribers].map((s) => s.complete?.())
176
+ [...this.#subscribers].map((s) => s.complete?.()),
167
177
  );
168
178
  this.#subscribers.clear(); // Free subscribers for garbage collection
169
179
  return finished;
@@ -179,7 +189,7 @@ export class Subject<T, E = unknown, T2 = T>
179
189
 
180
190
  this.#subscribers.add(subscriber);
181
191
 
182
- [...this.#coldWaiters].forEach((w) => w());
192
+ for (const w of this.#coldWaiters) w();
183
193
  this.#coldWaiters.clear();
184
194
 
185
195
  return {
@@ -191,7 +201,7 @@ export class Subject<T, E = unknown, T2 = T>
191
201
  pipe<T1>(o1: Subscriber<T, E> & Observable<T1, E>): Observable<T1, E>;
192
202
  pipe<T1, T2>(
193
203
  o1: Subscriber<T, E> & Observable<T1, E>,
194
- o2: Subscriber<T1, E> & Observable<T2, E>
204
+ o2: Subscriber<T1, E> & Observable<T2, E>,
195
205
  ): Observable<T2, E>;
196
206
  pipe(
197
207
  ...os: (Subscriber<unknown, unknown> & Observable<unknown, unknown>)[]
@@ -232,7 +242,7 @@ export class BehaviorSubject<T, E = unknown, T2 = T> extends Subject<T, E, T2> {
232
242
  #current: T;
233
243
 
234
244
  constructor(t: T, scheduler?: Scheduler) {
235
- super(scheduler);
245
+ super(scheduler ?? AsyncScheduler);
236
246
  this.#current = t;
237
247
  }
238
248
 
@@ -255,10 +265,12 @@ export class BehaviorSubject<T, E = unknown, T2 = T> extends Subject<T, E, T2> {
255
265
  }
256
266
 
257
267
  export class ReplaySubject<T, E = unknown> extends Subject<T, E> {
268
+ readonly n: number;
258
269
  #history: T[] = [];
259
270
 
260
- constructor(private readonly n: number, scheduler?: Scheduler) {
261
- super(scheduler);
271
+ constructor(n: number, scheduler?: Scheduler) {
272
+ super(scheduler ?? SyncScheduler);
273
+ this.n = n;
262
274
  }
263
275
 
264
276
  next(t: T) {
@@ -275,8 +287,8 @@ export class ReplaySubject<T, E = unknown> extends Subject<T, E> {
275
287
  }
276
288
  const history = [...this.#history];
277
289
  (function send() {
278
- if (history.length == 0) return;
279
- const t = history.shift()!;
290
+ if (history.length === 0) return;
291
+ const t = assertExists(history.shift());
280
292
  subscriber.next?.(t);
281
293
  new Promise(send);
282
294
  })();
@@ -295,27 +307,30 @@ export function eventListener<E extends Event>() {
295
307
  }
296
308
 
297
309
  export class EventHandler<E extends Event> extends Subject<E> {
298
- constructor(private readonly eventFn: (e: E) => void | Promise<undefined>) {
299
- super();
310
+ eventFn: (e: E) => void | Promise<void>;
311
+
312
+ constructor(eventFn: (e: E) => void | Promise<void>) {
313
+ super(AsyncScheduler);
314
+ this.eventFn = eventFn;
300
315
  }
301
316
 
302
- next(e: E) {
317
+ async next(e: E): Promise<undefined> {
303
318
  e.preventDefault();
304
319
  super.next(e);
305
320
  }
306
321
  }
307
322
 
308
323
  export const watch =
309
- <T, E>(logger: Logger = DEFAULT_LOGGER) =>
324
+ <T extends Display, E extends Display>(logger: Logger = DEFAULT_LOGGER) =>
310
325
  (observable: Observable<T, E>) => {
311
326
  observable.tap({
312
- next(t: T) {
327
+ async next(t: T) {
313
328
  logger.info(t);
314
329
  },
315
- complete() {
330
+ async complete() {
316
331
  logger.info("Observable completed");
317
332
  },
318
- error(e: E) {
333
+ async error(e: E) {
319
334
  logger.warn(e);
320
335
  },
321
336
  });
@@ -325,11 +340,13 @@ class MapOperator<T, U, E>
325
340
  extends Subject<U, E, T>
326
341
  implements FullSubscriber<T, E>, Observable<U, E>
327
342
  {
328
- constructor(private readonly mapFn: (t: T) => U) {
329
- super();
343
+ private readonly mapFn: (t: T) => U;
344
+ constructor(mapFn: (t: T) => U) {
345
+ super(SyncScheduler);
346
+ this.mapFn = mapFn;
330
347
  }
331
348
 
332
- next(t: T): void | Promise<undefined> {
349
+ next(t: T): void | Promise<void> {
333
350
  return super.next(this.mapFn(t));
334
351
  }
335
352
  }
@@ -338,11 +355,13 @@ class FilterOperator<T, E>
338
355
  extends Subject<T, E>
339
356
  implements FullSubscriber<T, E>, Observable<T, E>
340
357
  {
341
- constructor(private readonly filterFn: (t: T) => boolean) {
342
- super();
358
+ private readonly filterFn: (t: T) => boolean;
359
+ constructor(filterFn: (t: T) => boolean) {
360
+ super(SyncScheduler);
361
+ this.filterFn = filterFn;
343
362
  }
344
363
 
345
- next(t: T): void | Promise<undefined> {
364
+ next(t: T): void | Promise<void> {
346
365
  return this.filterFn(t) ? super.next(t) : undefined;
347
366
  }
348
367
  }
@@ -352,19 +371,19 @@ class DistinctOperator<T, E>
352
371
  implements FullSubscriber<T, E>, Observable<T, E>
353
372
  {
354
373
  #prior: T | undefined = undefined;
374
+ private readonly distinctFn: (t1: T, t2: T) => boolean;
355
375
 
356
- constructor(
357
- private readonly distinctFn: (t1: T, t2: T) => boolean = Object.is
358
- ) {
359
- super();
376
+ constructor(distinctFn: (t1: T, t2: T) => boolean = Object.is) {
377
+ super(SyncScheduler);
378
+ this.distinctFn = distinctFn;
360
379
  }
361
380
 
362
- next(t: T): void | Promise<undefined> {
381
+ next(t: T): void | Promise<void> {
363
382
  if (this.#prior === undefined) {
364
383
  this.#prior = t;
365
384
  return super.next(t);
366
385
  }
367
- const same = this.distinctFn(this.#prior!, t);
386
+ const same = this.distinctFn(assertExists(this.#prior), t);
368
387
  if (!same) {
369
388
  this.#prior = t;
370
389
  return super.next(t);
@@ -374,8 +393,10 @@ class DistinctOperator<T, E>
374
393
  }
375
394
 
376
395
  class ReduceOperator<A, T, E> extends BehaviorSubject<A, E, T> {
377
- constructor(private readonly fn: (acc: A, t: T) => A, init: A) {
396
+ private readonly fn: (acc: A, t: T) => A;
397
+ constructor(fn: (acc: A, t: T) => A, init: A) {
378
398
  super(init);
399
+ this.fn = fn;
379
400
  }
380
401
 
381
402
  next(t: T) {
@@ -413,7 +434,7 @@ export class TapOperator<T, E> extends Subject<T, E> {
413
434
  }
414
435
 
415
436
  class FirstOperator<T, E> extends Subject<T, E> {
416
- next(t: T): void | Promise<undefined> {
437
+ next(t: T): void | Promise<void> {
417
438
  const next = super.next(t);
418
439
  this.complete();
419
440
  return next;
@@ -427,7 +448,7 @@ class LastOperator<T, E = Error> extends Subject<T, E> {
427
448
  this.#latest = t;
428
449
  }
429
450
 
430
- complete(): void | Promise<undefined> {
451
+ complete(): void | Promise<void> {
431
452
  if (this.#latest !== undefined) {
432
453
  super.next(this.#latest);
433
454
  }
@@ -2,14 +2,14 @@ import {
2
2
  Err,
3
3
  None,
4
4
  Ok,
5
- Result,
5
+ type Result,
6
6
  Some,
7
7
  unwrap,
8
8
  unwrapOr,
9
9
  unwrapOrElse,
10
- } from "./result.js";
11
- import { describe, it } from "./scope/describe.js";
12
- import { expect } from "./scope/expect.js";
10
+ } from "./result.ts";
11
+ import { describe, it } from "./scope/describe.ts";
12
+ import { expect } from "./scope/expect.ts";
13
13
 
14
14
  describe("Result", () => {
15
15
  it("converts Nones", () => {
@@ -40,7 +40,7 @@ describe("Result", () => {
40
40
  expect(b).toMatchObject({ message: "a error" });
41
41
 
42
42
  // Assign Err to Result
43
- const c: Result<string> = a;
43
+ const _c: Result<string> = a;
44
44
  });
45
45
 
46
46
  it("converts Oks", () => {
@@ -49,7 +49,7 @@ describe("Result", () => {
49
49
  expect(b).toBe("a ok");
50
50
 
51
51
  // Assign ok to Result
52
- const c: Result<string> = a;
52
+ const _c: Result<string> = a;
53
53
  });
54
54
 
55
55
  it("unwraps", () => {
@@ -95,10 +95,7 @@ describe("Result", () => {
95
95
  });
96
96
 
97
97
  it("allows Result<void> with Ok()", () => {
98
- let a: Result<void>;
99
- a = Ok();
98
+ const a: Result<void> = Ok();
100
99
  expect(unwrap(a)).toBe(undefined);
101
100
  });
102
101
  });
103
-
104
- export {};