@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
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2022 David Souther
1
+ Copyright 2022-2026 David Souther
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
package/package.json CHANGED
@@ -1,41 +1,38 @@
1
1
  {
2
2
  "name": "@davidsouther/jiffies",
3
- "version": "2.2.5",
3
+ "version": "2026.4.0",
4
4
  "private": false,
5
5
  "displayName": "JEFRi Jiffies",
6
6
  "type": "module",
7
- "main": "./lib/cjs/",
8
- "module": "./lib/esm/",
9
- "types": "./lib/esm/index.d.ts",
10
- "directories": {
11
- "lib": "./lib/cjs"
7
+ "exports": {
8
+ "./*.ts": "./src/*.ts"
12
9
  },
10
+ "files": [
11
+ "src",
12
+ "LICENSE",
13
+ "package.json",
14
+ "README.md",
15
+ "tsconfig.json"
16
+ ],
13
17
  "engines": {
14
- "node": ">=20.0.9"
18
+ "node": ">=22.18.0"
15
19
  },
16
20
  "scripts": {
17
- "node": "node --import ./src/loader-register.mjs",
18
- "start": "npm run node ./src/server/main.js",
19
- "test": "npm run node ./src/test.mjs",
21
+ "start": "node ./src/server/main.ts",
22
+ "test": "node ./src/test.mjs",
20
23
  "ci": "npm run node ./src/test.mjs --mode=junit",
21
- "lint": "prettier . --check",
22
- "check": "tsc --noEmit",
23
- "format": "prettier . --write",
24
- "build": "npm run build:esm & npm run build:cjs & npm run build:css",
25
- "postbuild": "npm run fixup",
26
- "build:esm": "tsc",
27
- "build:cjs": "tsc --module commonjs --outDir lib/cjs",
28
- "fixup:cjs": "echo '{\"module\":\"commonjs\"}' > lib/cjs/package.json",
29
- "fixup": "npm run fixup:cjs",
30
- "build:css": "sass ./src/pico/pico.scss ./build/pico.css",
31
- "watch": "npx tsc --watch",
32
- "all": "npm run lint && npm run test && npm run build"
24
+ "format": "biome format --write",
25
+ "fix": "biome check --write --unsafe",
26
+ "check:format": "biome format",
27
+ "check:lint": "biome check",
28
+ "all": "npm run check:lint && npm run test"
33
29
  },
34
30
  "devDependencies": {
31
+ "@biomejs/biome": "^2.3.11",
35
32
  "@types/node": "^20.8.9"
36
33
  },
37
34
  "dependencies": {
38
- "sass": "^1.49.9",
39
- "typescript": "^4.7.1"
35
+ "ts-blank-space": "^0.7.0",
36
+ "typescript": "^5.9.3"
40
37
  }
41
- }
38
+ }
package/src/assert.ts CHANGED
@@ -11,8 +11,8 @@ export class AssertionError extends Error {
11
11
  */
12
12
  export function assert<_T extends true>(
13
13
  condition: boolean,
14
- message?: AssertMessage
15
- ): void | never {
14
+ message?: AssertMessage,
15
+ ): undefined | never {
16
16
  if (!condition) {
17
17
  throw new AssertionError(message instanceof Function ? message() : message);
18
18
  }
@@ -27,7 +27,7 @@ export function assert<_T extends true>(
27
27
  */
28
28
  export function assertExists<T>(
29
29
  t: T,
30
- message: AssertMessage = "Assertion failed: value does not exist"
30
+ message: AssertMessage = "Assertion failed: value does not exist",
31
31
  ): NonNullable<T> {
32
32
  assert(t != null, message);
33
33
  return t as NonNullable<T>;
@@ -39,7 +39,7 @@ export function assertExists<T>(
39
39
  */
40
40
  export function assertString(
41
41
  n: unknown,
42
- message: AssertMessage = () => `Assertion failed: ${n} is not a string`
42
+ message: AssertMessage = () => `Assertion failed: ${n} is not a string`,
43
43
  ): string {
44
44
  assert(typeof n === "string", message);
45
45
  return n as string;
@@ -50,7 +50,7 @@ export function assertString(
50
50
  */
51
51
  export function checkExhaustive(
52
52
  value: never,
53
- message: AssertMessage = `Unexpected value ${value}`
53
+ message: AssertMessage = `Unexpected value ${value}`,
54
54
  ): never {
55
55
  throw new Error(message instanceof Function ? message() : message);
56
56
  }
@@ -1,44 +1,42 @@
1
- import { display } from "../display.js";
2
- import { FC } from "../dom/fc.js";
3
- import { fieldset, input, label } from "../dom/html.js";
1
+ import { display } from "../display.ts";
2
+ import { FC } from "../dom/fc.ts";
3
+ import { fieldset, input, label } from "../dom/html.ts";
4
4
 
5
5
  let buttonBarId = 1;
6
- let nextId = () => buttonBarId++;
6
+ const nextId = () => buttonBarId++;
7
7
 
8
8
  const ButtonBar = FC<{
9
9
  // T extends Display
10
- // @ts-ignore TODO(TFC)
10
+ // @ts-expect-error TODO(TFC)
11
11
  value: T;
12
- // @ts-ignore TODO(TFC)
12
+ // @ts-expect-error TODO(TFC)
13
13
  values: T[];
14
- // @ts-ignore TODO(TFC)
14
+ // @ts-expect-error TODO(TFC)
15
15
  events: { onSelect: (current: T) => void };
16
- }>("button-bar", (el, { value, values, events }) => {
16
+ }>("button-bar", (_el, { value, values, events }) => {
17
17
  const name = `button-bar-${nextId()}`;
18
18
  return fieldset(
19
19
  { class: "input-group" },
20
- ...values
21
- .map((option) => {
22
- const opt = `${option}`.replace(/\s+/g, "_").toLowerCase();
23
- const id = `${name}-${opt}`;
24
- return [
25
- label(
26
- { role: "button", htmlFor: id },
27
- input({
28
- type: "radio",
29
- id,
30
- name,
31
- value: option,
32
- checked: option === value,
33
- events: {
34
- change: () => events.onSelect(option),
35
- },
36
- }),
37
- display(option)
38
- ),
39
- ];
40
- })
41
- .flat()
20
+ ...values.flatMap((option) => {
21
+ const opt = `${option}`.replace(/\s+/g, "_").toLowerCase();
22
+ const id = `${name}-${opt}`;
23
+ return [
24
+ label(
25
+ { role: "button", htmlFor: id },
26
+ input({
27
+ type: "radio",
28
+ id,
29
+ name,
30
+ value: option,
31
+ checked: option === value,
32
+ events: {
33
+ change: () => events.onSelect(option),
34
+ },
35
+ }),
36
+ display(option),
37
+ ),
38
+ ];
39
+ }),
42
40
  );
43
41
  });
44
42
  export default ButtonBar;
@@ -1,6 +1,6 @@
1
- import { width } from "../dom/css/sizing.js";
2
- import { FC, State } from "../dom/fc.js";
3
- import { input, span } from "../dom/html.js";
1
+ import { width } from "../dom/css/sizing.ts";
2
+ import { FC, State } from "../dom/fc.ts";
3
+ import { input, span } from "../dom/html.ts";
4
4
 
5
5
  const Mode = { VIEW: 0, EDIT: 1 };
6
6
 
@@ -19,7 +19,8 @@ export const InlineEdit = FC<
19
19
  },
20
20
  InlineEditState
21
21
  >("inline-edit", (el, { mode = Mode.VIEW, value, events }) => {
22
- const state = (el[State] ??= { mode, value });
22
+ el[State] ??= { mode, value };
23
+ const state = el[State];
23
24
 
24
25
  const render = () => {
25
26
  switch (state.mode) {
@@ -43,7 +44,7 @@ export const InlineEdit = FC<
43
44
  },
44
45
  },
45
46
  },
46
- state.value ?? ""
47
+ state.value ?? "",
47
48
  );
48
49
 
49
50
  const edit = () => {
@@ -61,9 +62,9 @@ export const InlineEdit = FC<
61
62
  events.change((target as HTMLInputElement)?.value ?? ""),
62
63
  },
63
64
  type: "text",
64
- value: state.value,
65
+ value: state.value ?? "",
65
66
  }),
66
- "\u00a0" // Hack to get the span to take up space
67
+ "\u00a0", // Hack to get the span to take up space
67
68
  );
68
69
  setTimeout(() => {
69
70
  edit.dispatchEvent(new Event("focus"));
@@ -1,18 +1,18 @@
1
- import { display, Display } from "../display.js";
2
- import { div, span, ul, li, pre, code } from "../dom/html.js";
3
- import { LEVEL, Logger } from "../log.js";
1
+ import { type Display, display } from "../display.ts";
2
+ import { code, div, li, pre, span, ul } from "../dom/html.ts";
3
+ import { LEVEL, type Logger } from "../log.ts";
4
4
 
5
5
  export interface HTMLLogger extends Logger {
6
6
  root: Element;
7
7
  }
8
8
 
9
9
  export function isHTMLLogger(logger: Logger): logger is HTMLLogger {
10
- return (logger as HTMLLogger).root != undefined;
10
+ return (logger as HTMLLogger).root !== undefined;
11
11
  }
12
12
 
13
13
  export function makeHTMLLogger(name: string): HTMLLogger {
14
- let log: Element;
15
- const root = div(div(span(name)), (log = ul()));
14
+ const log = ul();
15
+ const root = div(div(span(name)), log);
16
16
  const logger: Partial<HTMLLogger> = { level: LEVEL.INFO, root };
17
17
 
18
18
  function append(message: string): void {
@@ -1,6 +1,6 @@
1
- import { EventHandler } from "../dom/dom.js";
2
- import { FC } from "../dom/fc.js";
3
- import { option, select } from "../dom/html.js";
1
+ import type { EventHandler } from "../dom/dom.ts";
2
+ import { FC } from "../dom/fc.ts";
3
+ import { option, select } from "../dom/html.ts";
4
4
 
5
5
  export const Select = FC<{
6
6
  name: string;
@@ -12,11 +12,11 @@ export const Select = FC<{
12
12
  options: [string, string][];
13
13
  }>(
14
14
  "jiffies-select",
15
- (el, { name, events: { change }, disabled, value, options }) =>
15
+ (_el, { name, events: { change }, disabled, value, options }) =>
16
16
  select(
17
17
  { name, events: { change }, disabled },
18
18
  ...options.map(([v, name]) =>
19
- option({ value: v, selected: value === v }, `${name}`)
20
- )
21
- )
19
+ option({ value: v, selected: value === v }, `${name}`),
20
+ ),
21
+ ),
22
22
  );
@@ -0,0 +1,5 @@
1
+ import { IsBrowser } from "../is_browser.js";
2
+
3
+ export async function loadTests() {
4
+ if (IsBrowser) await import("./virtual_scroll.test.ts");
5
+ }
@@ -1,10 +1,10 @@
1
- import { State } from "../dom/fc.js";
2
- import { div } from "../dom/html.js";
3
- import { describe, it, expect } from "../scope/index.js";
1
+ import { State } from "../dom/fc.ts";
2
+ import { div } from "../dom/html.ts";
3
+ import { describe, expect, it } from "../scope/index.ts";
4
4
  import VirtualScroll, {
5
5
  arrayAdapter,
6
- VirtualScrollProps,
7
- } from "./virtual_scroll.js";
6
+ type VirtualScrollProps,
7
+ } from "./virtual_scroll.ts";
8
8
 
9
9
  describe("VirtualScroll", () => {
10
10
  it("tracks scroll position", () => {
@@ -16,7 +16,10 @@ describe("VirtualScroll", () => {
16
16
  row: (i) => div(`${i}`),
17
17
  };
18
18
 
19
- const scroll = VirtualScroll(props);
19
+ const scroll = VirtualScroll(
20
+ // @ts-expect-error
21
+ props,
22
+ );
20
23
 
21
24
  expect(scroll[State]?.bufferedItems).toBe(9);
22
25
  expect(scroll[State]?.data).toEqual([0, 1, 2, 3, 4]);
@@ -1,6 +1,6 @@
1
- import { debounce } from "../debounce.js";
2
- import { FC, State } from "../dom/fc.js";
3
- import { div } from "../dom/html.js";
1
+ import { debounce } from "../debounce.ts";
2
+ import { FC, State } from "../dom/fc.ts";
3
+ import { div } from "../dom/html.ts";
4
4
 
5
5
  export interface VirtualScrollSettings {
6
6
  minIndex: number;
@@ -11,9 +11,10 @@ export interface VirtualScrollSettings {
11
11
  tolerance: number;
12
12
  }
13
13
 
14
- export interface VirtualScrollDataAdapter<T> {
15
- (offset: number, limit: number): Iterable<T>;
16
- }
14
+ export type VirtualScrollDataAdapter<T> = (
15
+ offset: number,
16
+ limit: number,
17
+ ) => Iterable<T>;
17
18
 
18
19
  export function arrayAdapter<T>(data: T[]): VirtualScrollDataAdapter<T> {
19
20
  return (offset, limit) => data.slice(offset, offset + limit);
@@ -26,7 +27,7 @@ export interface VirtualScrollProps<T, U extends HTMLElement> {
26
27
  }
27
28
 
28
29
  export function fillVirtualScrollSettings(
29
- settings: Partial<VirtualScrollSettings>
30
+ settings: Partial<VirtualScrollSettings>,
30
31
  ): VirtualScrollSettings {
31
32
  const {
32
33
  minIndex = 0,
@@ -41,7 +42,7 @@ export function fillVirtualScrollSettings(
41
42
  }
42
43
 
43
44
  export function initialState<T>(
44
- settings: VirtualScrollSettings
45
+ settings: VirtualScrollSettings,
45
46
  ): VirtualScrollState<T> {
46
47
  // From Denis Hilt, https://blog.logrocket.com/virtual-scrolling-core-principles-and-basic-implementation-in-react/
47
48
  const { minIndex, maxIndex, startIndex, itemHeight, count, tolerance } =
@@ -75,7 +76,7 @@ export function getData<T>(
75
76
  maxIndex: number,
76
77
  offset: number,
77
78
  limit: number,
78
- get: VirtualScrollDataAdapter<T>
79
+ get: VirtualScrollDataAdapter<T>,
79
80
  ): T[] {
80
81
  const start = Math.max(0, minIndex, offset);
81
82
  const end = Math.min(maxIndex, offset + limit - 1);
@@ -86,7 +87,7 @@ export function getData<T>(
86
87
  export function doScroll<T>(
87
88
  scrollTop: number,
88
89
  state: VirtualScrollState<T>,
89
- get: VirtualScrollDataAdapter<T>
90
+ get: VirtualScrollDataAdapter<T>,
90
91
  ): {
91
92
  scrollTop: number;
92
93
  topPaddingHeight: number;
@@ -105,7 +106,7 @@ export function doScroll<T>(
105
106
  const topPaddingHeight = Math.max((index - minIndex) * itemHeight, 0);
106
107
  const bottomPaddingHeight = Math.max(
107
108
  totalHeight - (topPaddingHeight + data.length * itemHeight),
108
- 0
109
+ 0,
109
110
  );
110
111
 
111
112
  return { scrollTop, topPaddingHeight, bottomPaddingHeight, data };
@@ -124,23 +125,24 @@ interface VirtualScrollState<T, U extends HTMLElement = HTMLElement> {
124
125
  rows: U[];
125
126
  }
126
127
 
127
- // export interface VirtualScroll<T, U extends HTMLElement> {
128
- // state: VirtualScrollState<T>;
129
- // rows: UHTMLElement<U>[];
130
- // }
128
+ export interface VirtualScroll<T, U extends HTMLElement> {
129
+ state: VirtualScrollState<T>;
130
+ rows: U[];
131
+ }
131
132
 
132
133
  export const VirtualScroll = FC<
133
- VirtualScrollProps<any, HTMLElement>,
134
- VirtualScrollState<any, HTMLElement>
134
+ VirtualScrollProps<unknown, HTMLElement>,
135
+ VirtualScrollState<unknown, HTMLElement>
135
136
  >("virtual-scroll", (element, props) => {
136
137
  const settings = fillVirtualScrollSettings(props.settings);
137
- const state = (element[State] = {
138
+ const state = {
138
139
  ...initialState(settings),
139
140
  ...element[State],
140
- });
141
+ };
142
+ element[State] = state;
141
143
 
142
144
  const scrollTo = (
143
- { target }: { target?: { scrollTop: number } } = { target: state }
145
+ { target }: { target?: { scrollTop: number } } = { target: state },
144
146
  ) => {
145
147
  const scrollTop = target?.scrollTop ?? state.topPaddingHeight;
146
148
  const updatedSate = {
@@ -152,7 +154,10 @@ export const VirtualScroll = FC<
152
154
 
153
155
  const viewportElement = div({
154
156
  style: { height: `${state.viewportHeight}px`, overflowY: "scroll" },
155
- events: { scroll: debounce(scrollTo, 0) },
157
+ events: {
158
+ // @ts-expect-error
159
+ scroll: debounce(scrollTo, 0),
160
+ },
156
161
  });
157
162
  setTimeout(() => {
158
163
  viewportElement.scroll({ top: state.scrollTop });
@@ -176,13 +181,13 @@ export const VirtualScroll = FC<
176
181
  class: `VirtualScroll__item_${i}`,
177
182
  style: { height: `${settings.itemHeight}px` },
178
183
  },
179
- row
180
- )
184
+ row,
185
+ ),
181
186
  ),
182
187
  div({
183
188
  class: "VirtualScroll__bottomPadding",
184
189
  style: { height: `${state.bottomPaddingHeight}px` },
185
- })
190
+ }),
186
191
  );
187
192
  };
188
193
 
@@ -1,7 +1,7 @@
1
- import { Context, Enter, Exit, using } from "./context.js";
2
- import { Err, isErr, isOk, Ok, unwrap } from "./result.js";
3
- import { describe, it } from "./scope/describe.js";
4
- import { expect } from "./scope/expect.js";
1
+ import { type Context, Enter, Exit, using } from "./context.ts";
2
+ import { Err, isErr, isOk, Ok, unwrap } from "./result.ts";
3
+ import { describe, it } from "./scope/describe.ts";
4
+ import { expect } from "./scope/expect.ts";
5
5
 
6
6
  describe("Context", () => {
7
7
  it("performs an operation using a context", () => {
package/src/context.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Ok, Err, isResult, Result } from "./result.js";
1
+ import { Err, isResult, Ok, type Result } from "./result.ts";
2
2
 
3
3
  export const Enter = Symbol("Context Enter");
4
4
  export const Exit = Symbol("Context Exit");
@@ -8,18 +8,20 @@ export interface Context {
8
8
  [Exit]: () => void;
9
9
  }
10
10
 
11
- export interface Operation<T, E extends Error, C extends Context> {
12
- (c: C): T | Result<T, E>;
13
- }
11
+ export type Operation<T, E extends Error, C extends Context> = (
12
+ c: C,
13
+ ) => T | Result<T, E>;
14
14
 
15
- export interface AsyncOperation<T, E extends Error, C extends Context> {
16
- (c: C): Promise<T | Result<T, E>>;
17
- }
15
+ export type AsyncOperation<T, E extends Error, C extends Context> = (
16
+ c: C,
17
+ ) => Promise<T | Result<T, E>>;
18
18
 
19
19
  export function using<T, E extends Error, C extends Context>(
20
20
  context: C | (() => C) | Operation<T, E, C>,
21
21
  operation?: Operation<T, E, C>,
22
- normalizeError: (e: Error | unknown | any) => Err<E> = (e) => Err(e)
22
+ normalizeError: (e: Error | unknown) => Err<E> = (e) =>
23
+ // @ts-expect-error
24
+ Err(e),
23
25
  ): Result<T, E> {
24
26
  if (typeof context === "function") {
25
27
  if (context.length === 1) {
@@ -32,7 +34,7 @@ export function using<T, E extends Error, C extends Context>(
32
34
  let result: Result<T, E>;
33
35
  try {
34
36
  context[Enter]();
35
- const op = operation!(context);
37
+ const op = operation?.(context);
36
38
  result = isResult(op as Result<T, E>) ? (op as Result<T, E>) : Ok(op as T);
37
39
  } catch (e) {
38
40
  result = normalizeError(e);
@@ -45,7 +47,7 @@ export function using<T, E extends Error, C extends Context>(
45
47
  export async function asyncUsing<T, E extends Error, C extends Context>(
46
48
  context: C | (() => Promise<C>),
47
49
  operation: AsyncOperation<T, E, C>,
48
- normalizeError: (e: Error | unknown | any) => Err<E> = (e: E) => Err(e)
50
+ normalizeError: (e: E) => Err<E> = (e: E) => Err(e),
49
51
  ): Promise<Result<T, E>> {
50
52
  context = typeof context === "function" ? await context() : context;
51
53
  let result: Result<T, E>;
@@ -54,7 +56,10 @@ export async function asyncUsing<T, E extends Error, C extends Context>(
54
56
  const op = await operation(context);
55
57
  result = isResult(op as Result<T, E>) ? (op as Result<T, E>) : Ok(op as T);
56
58
  } catch (e) {
57
- result = normalizeError(e);
59
+ result = normalizeError(
60
+ // @ts-expect-error
61
+ e,
62
+ );
58
63
  } finally {
59
64
  context[Exit]();
60
65
  }
package/src/debounce.ts CHANGED
@@ -1,8 +1,14 @@
1
- export function debounce(fn: (...args: any[]) => any, ms = 32) {
1
+ export function debounce<T extends unknown[]>(
2
+ fn: (...args: T) => void,
3
+ ms = 32,
4
+ ): (...args: T) => void {
2
5
  let timer: ReturnType<typeof setTimeout>;
3
- return (...args: Parameters<typeof fn>) => {
6
+ return (...args: T) => {
4
7
  clearTimeout(timer);
5
- timer = setTimeout(() => (clearTimeout(timer), fn(...args)), ms);
8
+ timer = setTimeout(() => {
9
+ clearTimeout(timer);
10
+ return fn(...args);
11
+ }, ms);
6
12
  return timer;
7
13
  };
8
14
  }
package/src/diff.test.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { diff } from "./diff.js";
2
- import { describe, it } from "./scope/describe.js";
3
- import { expect } from "./scope/expect.js";
1
+ import { diff } from "./diff.ts";
2
+ import { describe, it } from "./scope/describe.ts";
3
+ import { expect } from "./scope/expect.ts";
4
4
 
5
5
  describe("diff", () => {
6
6
  it("diffs primitives", () => {
@@ -36,7 +36,7 @@ describe("diff", () => {
36
36
  it("diffs objects in an array", () => {
37
37
  const diffed = diff(
38
38
  [{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }],
39
- [{ a: { b: 1 } }, { a: { b: 4 } }, { a: { b: 3 } }]
39
+ [{ a: { b: 1 } }, { a: { b: 4 } }, { a: { b: 3 } }],
40
40
  );
41
41
  expect(diffed).toEqual([
42
42
  {
package/src/diff.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { range } from "./range.js";
2
- import { isSome, None, Option, Some } from "./result.js";
1
+ import { range } from "./range.ts";
2
+ import { isSome, None, type Option, Some } from "./result.ts";
3
3
 
4
4
  export const DiffA = Symbol("A");
5
5
  export const DiffB = Symbol("B");
@@ -20,29 +20,27 @@ interface DiffList {
20
20
 
21
21
  function doDiff<T>(va: T, vb: T, k: DiffIndex): Option<DiffList | DiffEntry> {
22
22
  if (Array.isArray(va)) {
23
- // @ts-ignore
23
+ // @ts-expect-error
24
24
  return diffArray(va, vb, k);
25
25
  }
26
26
  if (typeof va === "object") {
27
- const d = diffObject(va, vb, k);
27
+ const d = diffObject(va ?? {}, vb ?? {}, k);
28
28
  if (d.children.length === 0) {
29
29
  return None();
30
- } else {
31
- return Some(d);
32
30
  }
31
+ return Some(d);
33
32
  }
34
33
  if (Object.is(va, vb)) {
35
34
  return None();
36
- } else {
37
- // @ts-ignore
38
- return { key: k, left: va, right: vb };
39
35
  }
36
+ // @ts-expect-error
37
+ return { key: k, left: va, right: vb };
40
38
  }
41
39
 
42
40
  function diffArray<T>(
43
41
  a: Partial<T>[],
44
42
  b: Partial<T>[],
45
- key: DiffIndex
43
+ key: DiffIndex,
46
44
  ): Option<DiffList> {
47
45
  const indexes = Math.max(a.length, b.length);
48
46
  const children = range(0, indexes)
@@ -54,11 +52,11 @@ function diffArray<T>(
54
52
  function diffObject<T>(
55
53
  a: Partial<T>,
56
54
  b: Partial<T>,
57
- key: DiffIndex = ""
55
+ key: DiffIndex = "",
58
56
  ): DiffList {
59
57
  const keys = new Set([...Object.keys(a), ...Object.keys(b)]);
60
58
  const children = [...keys]
61
- // @ts-ignore
59
+ // @ts-expect-error
62
60
  .map((k) => doDiff(a[k], b[k], k))
63
61
  .filter(isSome);
64
62
  return {
@@ -69,16 +67,16 @@ function diffObject<T>(
69
67
 
70
68
  export function diff<T>(
71
69
  a: Partial<T>,
72
- b: Partial<T>
70
+ b: Partial<T>,
73
71
  ): (DiffEntry | DiffList)[] {
74
- if (typeof a != "object" && !Object.is(a, b)) {
75
- // @ts-ignore
72
+ if (typeof a !== "object" && !Object.is(a, b)) {
73
+ // @ts-expect-error
76
74
  return [{ key: "", left: a, right: b }];
77
75
  }
78
76
  return (
79
77
  Array.isArray(a)
80
78
  ? // @ts-ignore
81
- diffArray(a, b, "") ?? { children: [] }
79
+ (diffArray(a, b, "") ?? { children: [] })
82
80
  : diffObject(a, b, "")
83
81
  ).children;
84
82
  }