functionalscript 0.13.1 → 0.14.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 (357) hide show
  1. package/{types → fs}/asn.1/module.f.d.ts +1 -1
  2. package/{types → fs}/asn.1/module.f.js +3 -3
  3. package/{types → fs}/asn.1/test.f.js +2 -2
  4. package/{types → fs}/base128/module.f.d.ts +1 -1
  5. package/{types → fs}/base128/module.f.js +1 -1
  6. package/{types → fs}/base128/test.f.js +2 -2
  7. package/{bnf → fs/bnf}/data/module.f.d.ts +1 -1
  8. package/{cas → fs/cas}/module.f.d.ts +4 -4
  9. package/{cas → fs/cas}/module.f.js +1 -1
  10. package/{types → fs}/cbase32/module.f.d.ts +2 -2
  11. package/{types → fs}/cbase32/module.f.js +1 -1
  12. package/{types → fs}/cbase32/test.f.js +1 -1
  13. package/fs/ci/bun/module.f.d.ts +2 -0
  14. package/fs/ci/bun/module.f.js +20 -0
  15. package/fs/ci/common/module.f.d.ts +43 -0
  16. package/fs/ci/common/module.f.js +32 -0
  17. package/fs/ci/config/module.f.d.ts +25 -0
  18. package/fs/ci/config/module.f.js +34 -0
  19. package/fs/ci/deno/module.f.d.ts +2 -0
  20. package/fs/ci/deno/module.f.js +13 -0
  21. package/fs/ci/module.f.js +40 -0
  22. package/fs/ci/node/module.f.d.ts +6 -0
  23. package/fs/ci/node/module.f.js +36 -0
  24. package/fs/ci/playwright/module.f.d.ts +2 -0
  25. package/fs/ci/playwright/module.f.js +23 -0
  26. package/fs/ci/rust/module.f.d.ts +2 -0
  27. package/fs/ci/rust/module.f.js +49 -0
  28. package/{crypto → fs/crypto}/secp/module.f.d.ts +1 -2
  29. package/{dev → fs/dev}/module.f.d.ts +2 -0
  30. package/{dev → fs/dev}/module.f.js +5 -0
  31. package/{dev → fs/dev}/tf/all.test.js +7 -5
  32. package/{dev → fs/dev}/tf/module.f.d.ts +1 -1
  33. package/{dev → fs/dev}/tf/module.f.js +12 -9
  34. package/fs/dev/tf/test.f.d.ts +16 -0
  35. package/fs/dev/tf/test.f.js +22 -0
  36. package/fs/dev/version/module.f.d.ts +3 -0
  37. package/{djs → fs/djs}/tokenizer/module.f.js +3 -3
  38. package/{djs/parser-new → fs/djs/tokenizer-new}/test.f.d.ts +2 -1
  39. package/fs/djs/tokenizer-new/test.f.js +894 -0
  40. package/{js → fs/js}/tokenizer/module.f.js +34 -34
  41. package/{json → fs/json}/tokenizer/module.f.js +1 -1
  42. package/{path → fs/path}/module.f.d.ts +1 -1
  43. package/fs/sul/id/module.f.d.ts +33 -0
  44. package/fs/sul/id/module.f.js +94 -0
  45. package/fs/sul/id/test.f.d.ts +21 -0
  46. package/fs/sul/id/test.f.js +75 -0
  47. package/fs/sul/level/hash/module.f.d.ts +38 -0
  48. package/fs/sul/level/hash/module.f.js +43 -0
  49. package/fs/sul/level/hash/test.f.d.ts +14 -0
  50. package/fs/sul/level/hash/test.f.js +112 -0
  51. package/fs/sul/level/literal/module.f.d.ts +64 -0
  52. package/fs/sul/level/literal/module.f.js +88 -0
  53. package/fs/sul/level/literal/test.f.d.ts +12 -0
  54. package/fs/sul/level/literal/test.f.js +722 -0
  55. package/fs/sul/module.f.d.ts +23 -0
  56. package/fs/sul/module.f.js +46 -0
  57. package/fs/sul/test.f.d.ts +10 -0
  58. package/fs/sul/test.f.js +47 -0
  59. package/{text → fs/text}/module.f.d.ts +1 -1
  60. package/{text → fs/text}/utf16/module.f.js +8 -8
  61. package/{text → fs/text}/utf8/module.f.js +2 -2
  62. package/{types → fs/types}/bit_vec/module.f.d.ts +13 -1
  63. package/{types → fs/types}/bit_vec/module.f.js +33 -15
  64. package/{types → fs/types}/effects/module.f.d.ts +1 -0
  65. package/{types → fs/types}/effects/node/virtual/module.f.d.ts +3 -3
  66. package/{types → fs/types}/function/operator/module.f.d.ts +1 -1
  67. package/{types → fs/types}/function/operator/module.f.js +1 -1
  68. package/{types → fs/types}/list/module.f.js +1 -1
  69. package/fs/types/patricia_trie/module.f.d.ts +25 -0
  70. package/fs/types/patricia_trie/module.f.js +35 -0
  71. package/fs/types/patricia_trie/test.f.d.ts +8 -0
  72. package/fs/types/patricia_trie/test.f.js +121 -0
  73. package/fs/types/rtti/parse/module.f.d.ts +32 -0
  74. package/fs/types/rtti/parse/module.f.js +113 -0
  75. package/fs/types/rtti/parse/test.f.d.ts +104 -0
  76. package/fs/types/rtti/parse/test.f.js +316 -0
  77. package/fs/types/rtti/validate/module.f.d.ts +74 -0
  78. package/{types → fs/types}/rtti/validate/module.f.js +26 -24
  79. package/{types → fs/types}/rtti/validate/test.f.d.ts +11 -0
  80. package/{types → fs/types}/rtti/validate/test.f.js +38 -0
  81. package/{types → fs/types}/uint8array/module.f.d.ts +2 -2
  82. package/package.json +8 -8
  83. package/ci/module.f.js +0 -183
  84. package/dev/tf/test.f.d.ts +0 -4
  85. package/dev/tf/test.f.js +0 -5
  86. package/dev/version/module.f.d.ts +0 -3
  87. package/djs/parser-new/test.f.js +0 -202
  88. package/types/rtti/validate/module.f.d.ts +0 -50
  89. /package/{types → fs}/asn.1/test.f.d.ts +0 -0
  90. /package/{cas → fs/base128}/test.f.d.ts +0 -0
  91. /package/{bnf → fs/bnf}/data/module.f.js +0 -0
  92. /package/{bnf → fs/bnf}/data/test.f.d.ts +0 -0
  93. /package/{bnf → fs/bnf}/data/test.f.js +0 -0
  94. /package/{bnf → fs/bnf}/module.f.d.ts +0 -0
  95. /package/{bnf → fs/bnf}/module.f.js +0 -0
  96. /package/{bnf → fs/bnf}/test.f.d.ts +0 -0
  97. /package/{bnf → fs/bnf}/test.f.js +0 -0
  98. /package/{bnf → fs/bnf}/testlib.f.d.ts +0 -0
  99. /package/{bnf → fs/bnf}/testlib.f.js +0 -0
  100. /package/{types/base128 → fs/cas}/test.f.d.ts +0 -0
  101. /package/{cas → fs/cas}/test.f.js +0 -0
  102. /package/{types → fs}/cbase32/test.f.d.ts +0 -0
  103. /package/{ci → fs/ci}/module.f.d.ts +0 -0
  104. /package/{crypto → fs/crypto}/hmac/module.f.d.ts +0 -0
  105. /package/{crypto → fs/crypto}/hmac/module.f.js +0 -0
  106. /package/{crypto → fs/crypto}/hmac/test.f.d.ts +0 -0
  107. /package/{crypto → fs/crypto}/hmac/test.f.js +0 -0
  108. /package/{crypto → fs/crypto}/secp/module.f.js +0 -0
  109. /package/{crypto → fs/crypto}/secp/test.f.d.ts +0 -0
  110. /package/{crypto → fs/crypto}/secp/test.f.js +0 -0
  111. /package/{crypto → fs/crypto}/sha2/module.f.d.ts +0 -0
  112. /package/{crypto → fs/crypto}/sha2/module.f.js +0 -0
  113. /package/{crypto → fs/crypto}/sha2/test.f.d.ts +0 -0
  114. /package/{crypto → fs/crypto}/sha2/test.f.js +0 -0
  115. /package/{crypto → fs/crypto}/sign/module.f.d.ts +0 -0
  116. /package/{crypto → fs/crypto}/sign/module.f.js +0 -0
  117. /package/{crypto → fs/crypto}/sign/test.f.d.ts +0 -0
  118. /package/{crypto → fs/crypto}/sign/test.f.js +0 -0
  119. /package/{dev → fs/dev}/index/module.f.d.ts +0 -0
  120. /package/{dev → fs/dev}/index/module.f.js +0 -0
  121. /package/{dev → fs/dev}/test.f.d.ts +0 -0
  122. /package/{dev → fs/dev}/test.f.js +0 -0
  123. /package/{dev → fs/dev}/tf/all.test.d.ts +0 -0
  124. /package/{dev → fs/dev}/version/module.f.js +0 -0
  125. /package/{dev → fs/dev}/version/test.f.d.ts +0 -0
  126. /package/{dev → fs/dev}/version/test.f.js +0 -0
  127. /package/{djs → fs/djs}/ast/module.f.d.ts +0 -0
  128. /package/{djs → fs/djs}/ast/module.f.js +0 -0
  129. /package/{djs → fs/djs}/ast/test.f.d.ts +0 -0
  130. /package/{djs → fs/djs}/ast/test.f.js +0 -0
  131. /package/{djs → fs/djs}/examples/input.f.d.ts +0 -0
  132. /package/{djs → fs/djs}/examples/input.f.js +0 -0
  133. /package/{djs → fs/djs}/examples/m.f.d.ts +0 -0
  134. /package/{djs → fs/djs}/examples/m.f.js +0 -0
  135. /package/{djs → fs/djs}/module.f.d.ts +0 -0
  136. /package/{djs → fs/djs}/module.f.js +0 -0
  137. /package/{djs → fs/djs}/parser/module.f.d.ts +0 -0
  138. /package/{djs → fs/djs}/parser/module.f.js +0 -0
  139. /package/{djs → fs/djs}/parser/test.f.d.ts +0 -0
  140. /package/{djs → fs/djs}/parser/test.f.js +0 -0
  141. /package/{djs → fs/djs}/serializer/module.f.d.ts +0 -0
  142. /package/{djs → fs/djs}/serializer/module.f.js +0 -0
  143. /package/{djs → fs/djs}/serializer/test.f.d.ts +0 -0
  144. /package/{djs → fs/djs}/serializer/test.f.js +0 -0
  145. /package/{djs → fs/djs}/tokenizer/module.f.d.ts +0 -0
  146. /package/{djs → fs/djs}/tokenizer/test.f.d.ts +0 -0
  147. /package/{djs → fs/djs}/tokenizer/test.f.js +0 -0
  148. /package/{djs/parser-new → fs/djs/tokenizer-new}/module.f.d.ts +0 -0
  149. /package/{djs/parser-new → fs/djs/tokenizer-new}/module.f.js +0 -0
  150. /package/{djs → fs/djs}/transpiler/module.f.d.ts +0 -0
  151. /package/{djs → fs/djs}/transpiler/module.f.js +0 -0
  152. /package/{djs → fs/djs}/transpiler/test.f.d.ts +0 -0
  153. /package/{djs → fs/djs}/transpiler/test.f.js +0 -0
  154. /package/{fjs → fs/fjs}/module.d.ts +0 -0
  155. /package/{fjs → fs/fjs}/module.f.d.ts +0 -0
  156. /package/{fjs → fs/fjs}/module.f.js +0 -0
  157. /package/{fjs → fs/fjs}/module.js +0 -0
  158. /package/{fsc → fs/fsc}/bnf.f.d.ts +0 -0
  159. /package/{fsc → fs/fsc}/bnf.f.js +0 -0
  160. /package/{fsc → fs/fsc}/json.f.d.ts +0 -0
  161. /package/{fsc → fs/fsc}/json.f.js +0 -0
  162. /package/{fsc → fs/fsc}/module.f.d.ts +0 -0
  163. /package/{fsc → fs/fsc}/module.f.js +0 -0
  164. /package/{fsc → fs/fsc}/test.f.d.ts +0 -0
  165. /package/{fsc → fs/fsc}/test.f.js +0 -0
  166. /package/{fsm → fs/fsm}/module.f.d.ts +0 -0
  167. /package/{fsm → fs/fsm}/module.f.js +0 -0
  168. /package/{fsm → fs/fsm}/test.f.d.ts +0 -0
  169. /package/{fsm → fs/fsm}/test.f.js +0 -0
  170. /package/{html → fs/html}/module.f.d.ts +0 -0
  171. /package/{html → fs/html}/module.f.js +0 -0
  172. /package/{html → fs/html}/test.f.d.ts +0 -0
  173. /package/{html → fs/html}/test.f.js +0 -0
  174. /package/{io → fs/io}/module.d.ts +0 -0
  175. /package/{io → fs/io}/module.f.d.ts +0 -0
  176. /package/{io → fs/io}/module.f.js +0 -0
  177. /package/{io → fs/io}/module.js +0 -0
  178. /package/{io → fs/io}/virtual/module.f.d.ts +0 -0
  179. /package/{io → fs/io}/virtual/module.f.js +0 -0
  180. /package/{js → fs/js}/tokenizer/module.f.d.ts +0 -0
  181. /package/{js → fs/js}/tokenizer/test.f.d.ts +0 -0
  182. /package/{js → fs/js}/tokenizer/test.f.js +0 -0
  183. /package/{json → fs/json}/module.f.d.ts +0 -0
  184. /package/{json → fs/json}/module.f.js +0 -0
  185. /package/{json → fs/json}/parser/module.f.d.ts +0 -0
  186. /package/{json → fs/json}/parser/module.f.js +0 -0
  187. /package/{json → fs/json}/parser/test.f.d.ts +0 -0
  188. /package/{json → fs/json}/parser/test.f.js +0 -0
  189. /package/{json → fs/json}/serializer/module.f.d.ts +0 -0
  190. /package/{json → fs/json}/serializer/module.f.js +0 -0
  191. /package/{json → fs/json}/serializer/test.f.d.ts +0 -0
  192. /package/{json → fs/json}/serializer/test.f.js +0 -0
  193. /package/{json → fs/json}/test.f.d.ts +0 -0
  194. /package/{json → fs/json}/test.f.js +0 -0
  195. /package/{json → fs/json}/tokenizer/module.f.d.ts +0 -0
  196. /package/{json → fs/json}/tokenizer/test.f.d.ts +0 -0
  197. /package/{json → fs/json}/tokenizer/test.f.js +0 -0
  198. /package/{path → fs/path}/module.f.js +0 -0
  199. /package/{path → fs/path}/test.f.d.ts +0 -0
  200. /package/{path → fs/path}/test.f.js +0 -0
  201. /package/{text → fs/text}/ascii/module.f.d.ts +0 -0
  202. /package/{text → fs/text}/ascii/module.f.js +0 -0
  203. /package/{text → fs/text}/ascii/test.f.d.ts +0 -0
  204. /package/{text → fs/text}/ascii/test.f.js +0 -0
  205. /package/{text → fs/text}/module.f.js +0 -0
  206. /package/{text → fs/text}/sgr/module.f.d.ts +0 -0
  207. /package/{text → fs/text}/sgr/module.f.js +0 -0
  208. /package/{text → fs/text}/sgr/test.f.d.ts +0 -0
  209. /package/{text → fs/text}/sgr/test.f.js +0 -0
  210. /package/{text → fs/text}/test.f.d.ts +0 -0
  211. /package/{text → fs/text}/test.f.js +0 -0
  212. /package/{text → fs/text}/utf16/module.f.d.ts +0 -0
  213. /package/{text → fs/text}/utf16/test.f.d.ts +0 -0
  214. /package/{text → fs/text}/utf16/test.f.js +0 -0
  215. /package/{text → fs/text}/utf8/module.f.d.ts +0 -0
  216. /package/{text → fs/text}/utf8/test.f.d.ts +0 -0
  217. /package/{text → fs/text}/utf8/test.f.js +0 -0
  218. /package/{types → fs/types}/array/module.f.d.ts +0 -0
  219. /package/{types → fs/types}/array/module.f.js +0 -0
  220. /package/{types → fs/types}/array/test.f.d.ts +0 -0
  221. /package/{types → fs/types}/array/test.f.js +0 -0
  222. /package/{types → fs/types}/bigfloat/module.f.d.ts +0 -0
  223. /package/{types → fs/types}/bigfloat/module.f.js +0 -0
  224. /package/{types → fs/types}/bigfloat/test.f.d.ts +0 -0
  225. /package/{types → fs/types}/bigfloat/test.f.js +0 -0
  226. /package/{types → fs/types}/bigint/module.f.d.ts +0 -0
  227. /package/{types → fs/types}/bigint/module.f.js +0 -0
  228. /package/{types → fs/types}/bigint/test.f.d.ts +0 -0
  229. /package/{types → fs/types}/bigint/test.f.js +0 -0
  230. /package/{types → fs/types}/bit_vec/test.f.d.ts +0 -0
  231. /package/{types → fs/types}/bit_vec/test.f.js +0 -0
  232. /package/{types → fs/types}/btree/find/module.f.d.ts +0 -0
  233. /package/{types → fs/types}/btree/find/module.f.js +0 -0
  234. /package/{types → fs/types}/btree/find/test.f.d.ts +0 -0
  235. /package/{types → fs/types}/btree/find/test.f.js +0 -0
  236. /package/{types → fs/types}/btree/module.f.d.ts +0 -0
  237. /package/{types → fs/types}/btree/module.f.js +0 -0
  238. /package/{types → fs/types}/btree/remove/module.f.d.ts +0 -0
  239. /package/{types → fs/types}/btree/remove/module.f.js +0 -0
  240. /package/{types → fs/types}/btree/remove/test.f.d.ts +0 -0
  241. /package/{types → fs/types}/btree/remove/test.f.js +0 -0
  242. /package/{types → fs/types}/btree/set/module.f.d.ts +0 -0
  243. /package/{types → fs/types}/btree/set/module.f.js +0 -0
  244. /package/{types → fs/types}/btree/set/test.f.d.ts +0 -0
  245. /package/{types → fs/types}/btree/set/test.f.js +0 -0
  246. /package/{types → fs/types}/btree/test.f.d.ts +0 -0
  247. /package/{types → fs/types}/btree/test.f.js +0 -0
  248. /package/{types → fs/types}/btree/types/module.f.d.ts +0 -0
  249. /package/{types → fs/types}/btree/types/module.f.js +0 -0
  250. /package/{types → fs/types}/byte_set/module.f.d.ts +0 -0
  251. /package/{types → fs/types}/byte_set/module.f.js +0 -0
  252. /package/{types → fs/types}/byte_set/test.f.d.ts +0 -0
  253. /package/{types → fs/types}/byte_set/test.f.js +0 -0
  254. /package/{types → fs/types}/effects/mock/module.f.d.ts +0 -0
  255. /package/{types → fs/types}/effects/mock/module.f.js +0 -0
  256. /package/{types → fs/types}/effects/module.d.ts +0 -0
  257. /package/{types → fs/types}/effects/module.f.js +0 -0
  258. /package/{types → fs/types}/effects/module.js +0 -0
  259. /package/{types → fs/types}/effects/node/module.f.d.ts +0 -0
  260. /package/{types → fs/types}/effects/node/module.f.js +0 -0
  261. /package/{types → fs/types}/effects/node/test.f.d.ts +0 -0
  262. /package/{types → fs/types}/effects/node/test.f.js +0 -0
  263. /package/{types → fs/types}/effects/node/virtual/module.f.js +0 -0
  264. /package/{types → fs/types}/function/compare/module.f.d.ts +0 -0
  265. /package/{types → fs/types}/function/compare/module.f.js +0 -0
  266. /package/{types → fs/types}/function/compare/test.f.d.ts +0 -0
  267. /package/{types → fs/types}/function/compare/test.f.js +0 -0
  268. /package/{types → fs/types}/function/module.f.d.ts +0 -0
  269. /package/{types → fs/types}/function/module.f.js +0 -0
  270. /package/{types → fs/types}/function/test.f.d.ts +0 -0
  271. /package/{types → fs/types}/function/test.f.js +0 -0
  272. /package/{types → fs/types}/list/module.f.d.ts +0 -0
  273. /package/{types → fs/types}/list/test.f.d.ts +0 -0
  274. /package/{types → fs/types}/list/test.f.js +0 -0
  275. /package/{types → fs/types}/map/module.f.d.ts +0 -0
  276. /package/{types → fs/types}/map/module.f.js +0 -0
  277. /package/{types → fs/types}/map/test.f.d.ts +0 -0
  278. /package/{types → fs/types}/map/test.f.js +0 -0
  279. /package/{types → fs/types}/monoid/module.f.d.ts +0 -0
  280. /package/{types → fs/types}/monoid/module.f.js +0 -0
  281. /package/{types → fs/types}/monoid/test.f.d.ts +0 -0
  282. /package/{types → fs/types}/monoid/test.f.js +0 -0
  283. /package/{types → fs/types}/nibble_set/module.f.d.ts +0 -0
  284. /package/{types → fs/types}/nibble_set/module.f.js +0 -0
  285. /package/{types → fs/types}/nibble_set/test.f.d.ts +0 -0
  286. /package/{types → fs/types}/nibble_set/test.f.js +0 -0
  287. /package/{types → fs/types}/nominal/module.f.d.ts +0 -0
  288. /package/{types → fs/types}/nominal/module.f.js +0 -0
  289. /package/{types → fs/types}/nominal/test.f.d.ts +0 -0
  290. /package/{types → fs/types}/nominal/test.f.js +0 -0
  291. /package/{types → fs/types}/nullable/module.f.d.ts +0 -0
  292. /package/{types → fs/types}/nullable/module.f.js +0 -0
  293. /package/{types → fs/types}/nullable/test.f.d.ts +0 -0
  294. /package/{types → fs/types}/nullable/test.f.js +0 -0
  295. /package/{types → fs/types}/number/module.f.d.ts +0 -0
  296. /package/{types → fs/types}/number/module.f.js +0 -0
  297. /package/{types → fs/types}/number/test.f.d.ts +0 -0
  298. /package/{types → fs/types}/number/test.f.js +0 -0
  299. /package/{types → fs/types}/object/module.f.d.ts +0 -0
  300. /package/{types → fs/types}/object/module.f.js +0 -0
  301. /package/{types → fs/types}/object/test.f.d.ts +0 -0
  302. /package/{types → fs/types}/object/test.f.js +0 -0
  303. /package/{types → fs/types}/option/module.f.d.ts +0 -0
  304. /package/{types → fs/types}/option/module.f.js +0 -0
  305. /package/{types → fs/types}/ordered_map/module.f.d.ts +0 -0
  306. /package/{types → fs/types}/ordered_map/module.f.js +0 -0
  307. /package/{types → fs/types}/ordered_map/test.f.d.ts +0 -0
  308. /package/{types → fs/types}/ordered_map/test.f.js +0 -0
  309. /package/{types → fs/types}/prime_field/module.f.d.ts +0 -0
  310. /package/{types → fs/types}/prime_field/module.f.js +0 -0
  311. /package/{types → fs/types}/prime_field/test.f.d.ts +0 -0
  312. /package/{types → fs/types}/prime_field/test.f.js +0 -0
  313. /package/{types → fs/types}/range/module.f.d.ts +0 -0
  314. /package/{types → fs/types}/range/module.f.js +0 -0
  315. /package/{types → fs/types}/range/test.f.d.ts +0 -0
  316. /package/{types → fs/types}/range/test.f.js +0 -0
  317. /package/{types → fs/types}/range_map/module.f.d.ts +0 -0
  318. /package/{types → fs/types}/range_map/module.f.js +0 -0
  319. /package/{types → fs/types}/range_map/test.f.d.ts +0 -0
  320. /package/{types → fs/types}/range_map/test.f.js +0 -0
  321. /package/{types → fs/types}/result/module.d.ts +0 -0
  322. /package/{types → fs/types}/result/module.f.d.ts +0 -0
  323. /package/{types → fs/types}/result/module.f.js +0 -0
  324. /package/{types → fs/types}/result/module.js +0 -0
  325. /package/{types → fs/types}/result/test.f.d.ts +0 -0
  326. /package/{types → fs/types}/result/test.f.js +0 -0
  327. /package/{types → fs/types}/rtti/module.f.d.ts +0 -0
  328. /package/{types → fs/types}/rtti/module.f.js +0 -0
  329. /package/{types → fs/types}/rtti/test.f.d.ts +0 -0
  330. /package/{types → fs/types}/rtti/test.f.js +0 -0
  331. /package/{types → fs/types}/rtti/ts/module.f.d.ts +0 -0
  332. /package/{types → fs/types}/rtti/ts/module.f.js +0 -0
  333. /package/{types → fs/types}/rtti/ts/test.f.d.ts +0 -0
  334. /package/{types → fs/types}/rtti/ts/test.f.js +0 -0
  335. /package/{types → fs/types}/sorted_list/module.f.d.ts +0 -0
  336. /package/{types → fs/types}/sorted_list/module.f.js +0 -0
  337. /package/{types → fs/types}/sorted_list/test.f.d.ts +0 -0
  338. /package/{types → fs/types}/sorted_list/test.f.js +0 -0
  339. /package/{types → fs/types}/sorted_set/module.f.d.ts +0 -0
  340. /package/{types → fs/types}/sorted_set/module.f.js +0 -0
  341. /package/{types → fs/types}/sorted_set/test.f.d.ts +0 -0
  342. /package/{types → fs/types}/sorted_set/test.f.js +0 -0
  343. /package/{types → fs/types}/string/module.f.d.ts +0 -0
  344. /package/{types → fs/types}/string/module.f.js +0 -0
  345. /package/{types → fs/types}/string/test.f.d.ts +0 -0
  346. /package/{types → fs/types}/string/test.f.js +0 -0
  347. /package/{types → fs/types}/string_set/module.f.d.ts +0 -0
  348. /package/{types → fs/types}/string_set/module.f.js +0 -0
  349. /package/{types → fs/types}/string_set/test.f.d.ts +0 -0
  350. /package/{types → fs/types}/string_set/test.f.js +0 -0
  351. /package/{types → fs/types}/ts/module.f.d.ts +0 -0
  352. /package/{types → fs/types}/ts/module.f.js +0 -0
  353. /package/{types → fs/types}/uint8array/module.f.js +0 -0
  354. /package/{types → fs/types}/uint8array/test.f.d.ts +0 -0
  355. /package/{types → fs/types}/uint8array/test.f.js +0 -0
  356. /package/{website → fs/website}/module.f.d.ts +0 -0
  357. /package/{website → fs/website}/module.f.js +0 -0
@@ -1,4 +1,4 @@
1
- import { type Vec } from "../bit_vec/module.f.ts";
1
+ import { type Vec } from "../types/bit_vec/module.f.ts";
2
2
  /** ASN.1 tag number. */
3
3
  type Tag = bigint;
4
4
  /** ASN.1 universal BOOLEAN tag. */
@@ -1,6 +1,6 @@
1
- import { bitLength, max } from "../bigint/module.f.js";
2
- import { empty, isVec, length, listToVec, msb, uint, unpack, vec, vec8 } from "../bit_vec/module.f.js";
3
- import { identity } from "../function/module.f.js";
1
+ import { bitLength, max } from "../types/bigint/module.f.js";
2
+ import { empty, isVec, length, listToVec, msb, uint, unpack, vec, vec8 } from "../types/bit_vec/module.f.js";
3
+ import { identity } from "../types/function/module.f.js";
4
4
  import { encode as b128encode, decode as b128decode } from "../base128/module.f.js";
5
5
  const pop = msb.popFront;
6
6
  const pop8 = pop(8n);
@@ -1,5 +1,5 @@
1
- import { empty, length, listToVec, msb, uint, unpack, vec, vec8 } from "../bit_vec/module.f.js";
2
- import { asBase } from "../nominal/module.f.js";
1
+ import { empty, length, listToVec, msb, uint, unpack, vec, vec8 } from "../types/bit_vec/module.f.js";
2
+ import { asBase } from "../types/nominal/module.f.js";
3
3
  import { decodeRaw, decodeInteger, encodeRaw, encodeInteger, integer, encode, decode, constructedSequence, octetString, boolean, constructedSet } from "./module.f.js";
4
4
  const { concat, popFront: pop } = msb;
5
5
  const cat = listToVec(msb);
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { type Vec } from '../bit_vec/module.f.ts';
6
+ import { type Vec } from '../types/bit_vec/module.f.ts';
7
7
  /**
8
8
  * Encodes a bigint into an MSB Base128 vector.
9
9
  *
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { vec8, msb, empty } from "../bit_vec/module.f.js";
6
+ import { vec8, msb, empty } from "../types/bit_vec/module.f.js";
7
7
  const { concat, popFront } = msb;
8
8
  const pop8 = popFront(8n);
9
9
  /**
@@ -1,5 +1,5 @@
1
- import { empty, vec, vec8 } from "../bit_vec/module.f.js";
2
- import { asBase } from "../nominal/module.f.js";
1
+ import { empty, vec, vec8 } from "../types/bit_vec/module.f.js";
2
+ import { asBase } from "../types/nominal/module.f.js";
3
3
  import { encode, decode } from "./module.f.js";
4
4
  const test = (a, b) => {
5
5
  const encoded = encode(a);
@@ -82,7 +82,7 @@ export type AstRuleMeta<T> = {
82
82
  * Represents a parsed Abstract Syntax Tree (AST) sequence.
83
83
  */
84
84
  export type AstSequence = readonly (AstRule | CodePoint)[];
85
- type AstTag = string | true | undefined;
85
+ export type AstTag = string | true | undefined;
86
86
  /**
87
87
  * Represents a parsed AST rule, consisting of a rule name and its parsed sequence.
88
88
  */
@@ -3,10 +3,10 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { type Sha2 } from "../crypto/sha2/module.f.ts";
7
- import type { Vec } from "../types/bit_vec/module.f.ts";
8
- import { type Effect, type Operation } from "../types/effects/module.f.ts";
9
- import { type Fs, type NodeOp } from "../types/effects/node/module.f.ts";
6
+ import { type Sha2 } from '../crypto/sha2/module.f.ts';
7
+ import type { Vec } from '../types/bit_vec/module.f.ts';
8
+ import { type Effect, type Operation } from '../types/effects/module.f.ts';
9
+ import { type Fs, type NodeOp } from '../types/effects/node/module.f.ts';
10
10
  export type KvStore<O extends Operation> = {
11
11
  /** Reads a value by key; returns `undefined` when the key does not exist. */
12
12
  readonly read: (key: Vec) => Effect<O, Vec | undefined>;
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { computeSync, sha256 } from "../crypto/sha2/module.f.js";
7
7
  import { parse } from "../path/module.f.js";
8
- import { cBase32ToVec, vecToCBase32 } from "../types/cbase32/module.f.js";
8
+ import { cBase32ToVec, vecToCBase32 } from "../cbase32/module.f.js";
9
9
  import { begin, pure } from "../types/effects/module.f.js";
10
10
  import { error, log, mkdir, readdir, readFile, writeFile } from "../types/effects/node/module.f.js";
11
11
  import { toOption } from "../types/nullable/module.f.js";
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { type Vec } from "../bit_vec/module.f.ts";
7
- import type { Nullable } from "../nullable/module.f.ts";
6
+ import { type Vec } from "../types/bit_vec/module.f.ts";
7
+ import type { Nullable } from "../types/nullable/module.f.ts";
8
8
  export declare const vec5xToCBase32: (v: Vec) => string;
9
9
  export declare const vecToCBase32: (v: Vec) => string;
10
10
  export declare const cBase32ToVec5x: (s: string) => Nullable<Vec>;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { msb, lsb, length, vec, empty } from "../bit_vec/module.f.js";
6
+ import { msb, lsb, length, vec, empty } from "../types/bit_vec/module.f.js";
7
7
  // 0123456789abcdef
8
8
  const m = '0123456789abcdefghjkmnpqrstvwxyz';
9
9
  const { popFront, concat } = msb;
@@ -1,4 +1,4 @@
1
- import { empty, vec } from "../bit_vec/module.f.js";
1
+ import { empty, vec } from "../types/bit_vec/module.f.js";
2
2
  import { cBase32ToVec, cBase32ToVec5x, vec5xToCBase32, vecToCBase32 } from "./module.f.js";
3
3
  const check5x = (s, v) => {
4
4
  const sr = vec5xToCBase32(v);
@@ -0,0 +1,2 @@
1
+ import { type Architecture, type MetaStep, type Os } from '../common/module.f.ts';
2
+ export declare const bunSteps: (v: Os, a: Architecture) => readonly MetaStep[];
@@ -0,0 +1,20 @@
1
+ import { bun } from "../config/module.f.js";
2
+ import { clean, install, test } from "../common/module.f.js";
3
+ const installOnWindowsArm = ({ def, name, path }) => (v) => (a) => install(v === 'windows' && a === 'arm'
4
+ ? { run: `irm ${path}/install.ps1 | iex; "$env:USERPROFILE\\.${name}\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append` }
5
+ : def);
6
+ const installBun = installOnWindowsArm({
7
+ def: {
8
+ uses: 'oven-sh/setup-bun@v2',
9
+ with: {
10
+ 'bun-version': bun
11
+ },
12
+ },
13
+ name: 'bun',
14
+ path: 'bun.sh',
15
+ });
16
+ export const bunSteps = (v, a) => clean([
17
+ installBun(v)(a),
18
+ test({ run: 'bun test --timeout 20000' }),
19
+ test({ run: 'bun ./fs/fjs/module.ts t' }),
20
+ ]);
@@ -0,0 +1,43 @@
1
+ import { images } from '../config/module.f.ts';
2
+ export declare const os: readonly ["ubuntu", "macos", "windows"];
3
+ export type Os = typeof os[number];
4
+ export declare const architecture: readonly ["intel", "arm"];
5
+ export type Architecture = typeof architecture[number];
6
+ export type Image = typeof images[Os][Architecture];
7
+ export type Step = {
8
+ readonly run?: string;
9
+ readonly uses?: string;
10
+ readonly with?: {
11
+ readonly [k: string]: string;
12
+ };
13
+ };
14
+ export type Job = {
15
+ readonly 'runs-on': Image;
16
+ readonly steps: readonly Step[];
17
+ };
18
+ export type Jobs = {
19
+ readonly [jobs: string]: Job;
20
+ };
21
+ export type GitHubAction = {
22
+ readonly name: string;
23
+ readonly on: {
24
+ readonly pull_request?: {};
25
+ };
26
+ readonly jobs: Jobs;
27
+ };
28
+ export type StepType = 'install' | 'test';
29
+ export type MetaStep = {
30
+ readonly type: StepType;
31
+ readonly step: Step;
32
+ } | {
33
+ readonly type: 'rust';
34
+ readonly target?: string;
35
+ } | {
36
+ readonly type: 'apt-get';
37
+ readonly package: string;
38
+ };
39
+ export declare const install: (step: Step) => MetaStep;
40
+ export declare const test: (step: Step) => MetaStep;
41
+ export declare const clean: (steps: readonly MetaStep[]) => readonly MetaStep[];
42
+ export declare const toSteps: (m: readonly MetaStep[]) => readonly Step[];
43
+ export declare const ubuntu: (ms: readonly MetaStep[]) => Job;
@@ -0,0 +1,32 @@
1
+ import { images, rust } from "../config/module.f.js";
2
+ export const os = ['ubuntu', 'macos', 'windows'];
3
+ export const architecture = ['intel', 'arm'];
4
+ export const install = (step) => ({ type: 'install', step });
5
+ export const test = (step) => ({ type: 'test', step });
6
+ export const clean = (steps) => [
7
+ ...steps,
8
+ test({ run: 'git reset --hard HEAD && git clean -fdx' })
9
+ ];
10
+ export const toSteps = (m) => {
11
+ const filter = (st) => m.flatMap((mt) => mt.type === st ? [mt.step] : []);
12
+ const aptGet = m.flatMap(v => v.type === 'apt-get' ? [v.package] : []).join(' ');
13
+ const needRust = m.find(v => v.type === 'rust') !== undefined;
14
+ const targets = m.flatMap(v => v.type === 'rust' && v.target !== undefined ? [v.target] : []).join(',');
15
+ return [
16
+ ...(aptGet !== '' ? [{ run: `sudo apt-get update && sudo apt-get install -y ${aptGet}` }] : []),
17
+ ...(needRust ? [{
18
+ uses: `dtolnay/rust-toolchain@${rust}`,
19
+ with: {
20
+ components: 'rustfmt,clippy',
21
+ targets
22
+ }
23
+ }] : []),
24
+ ...filter('install'),
25
+ { uses: 'actions/checkout@v5' },
26
+ ...filter('test'),
27
+ ];
28
+ };
29
+ export const ubuntu = (ms) => ({
30
+ 'runs-on': images.ubuntu.intel,
31
+ steps: toSteps(ms)
32
+ });
@@ -0,0 +1,25 @@
1
+ export declare const images: {
2
+ readonly ubuntu: {
3
+ readonly intel: "ubuntu-24.04";
4
+ readonly arm: "ubuntu-24.04-arm";
5
+ };
6
+ readonly macos: {
7
+ readonly intel: "macos-26-intel";
8
+ readonly arm: "macos-26";
9
+ };
10
+ readonly windows: {
11
+ readonly intel: "windows-2025";
12
+ readonly arm: "windows-11-arm";
13
+ };
14
+ };
15
+ export declare const bun = "1.3.13";
16
+ export declare const deno = "2.7.14";
17
+ export declare const playwright = "1.59.1";
18
+ export declare const rust = "1.95.0";
19
+ export declare const node: {
20
+ readonly default: "26.1.0";
21
+ readonly others: readonly ["20.20.2", "22.22.2", "24.15.0"];
22
+ };
23
+ export declare const wasmtime = "44.0.1";
24
+ export declare const wasmer = "7.1.0";
25
+ export declare const tsgo = "7.0.0-dev.20260508.1";
@@ -0,0 +1,34 @@
1
+ // https://docs.github.com/en/actions/reference/runners/github-hosted-runners#standard-github-hosted-runners-for-public-repositories
2
+ export const images = {
3
+ ubuntu: {
4
+ intel: 'ubuntu-24.04',
5
+ arm: 'ubuntu-24.04-arm'
6
+ },
7
+ macos: {
8
+ intel: 'macos-26-intel',
9
+ arm: 'macos-26'
10
+ },
11
+ windows: {
12
+ intel: 'windows-2025',
13
+ arm: 'windows-11-arm',
14
+ }
15
+ };
16
+ // https://bun.sh/
17
+ export const bun = '1.3.13';
18
+ // https://deno.com/
19
+ export const deno = '2.7.14';
20
+ // https://www.npmjs.com/package/playwright
21
+ export const playwright = '1.59.1';
22
+ // https://rust-lang.org/
23
+ export const rust = '1.95.0';
24
+ // https://nodejs.org/en/download
25
+ export const node = {
26
+ default: '26.1.0',
27
+ others: ['20.20.2', '22.22.2', '24.15.0'],
28
+ };
29
+ // https://github.com/bytecodealliance/wasmtime/releases
30
+ export const wasmtime = '44.0.1';
31
+ // https://github.com/wasmerio/wasmer/releases
32
+ export const wasmer = '7.1.0';
33
+ // https://www.npmjs.com/package/@typescript/native-preview?activeTab=versions
34
+ export const tsgo = '7.0.0-dev.20260508.1';
@@ -0,0 +1,2 @@
1
+ import { type MetaStep } from '../common/module.f.ts';
2
+ export declare const denoSteps: readonly MetaStep[];
@@ -0,0 +1,13 @@
1
+ import { deno } from "../config/module.f.js";
2
+ import { clean, install, test } from "../common/module.f.js";
3
+ export const denoSteps = clean([
4
+ install({
5
+ uses: 'denoland/setup-deno@v2',
6
+ with: { 'deno-version': deno },
7
+ }),
8
+ test({ run: 'deno install' }),
9
+ test({ run: 'deno task test' }),
10
+ test({ run: 'deno task fjs compile issues/demo/data/tree.json _tree.f.js' }),
11
+ test({ run: 'deno task fjs t' }),
12
+ test({ run: 'deno publish --dry-run' }),
13
+ ]);
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Continuous integration helper commands for repository automation tasks.
3
+ *
4
+ * @module
5
+ */
6
+ import { utf8 } from "../text/module.f.js";
7
+ import { begin, pure } from "../types/effects/module.f.js";
8
+ import { writeFile } from "../types/effects/node/module.f.js";
9
+ import { images } from "./config/module.f.js";
10
+ import { architecture, os, toSteps } from "./common/module.f.js";
11
+ import { rustSteps } from "./rust/module.f.js";
12
+ import { nodeMainSteps, nodeVersions } from "./node/module.f.js";
13
+ import { playwrightJob } from "./playwright/module.f.js";
14
+ import { bunSteps } from "./bun/module.f.js";
15
+ import { denoSteps } from "./deno/module.f.js";
16
+ const job = (v) => (a) => {
17
+ const id = `${v}-${a}`;
18
+ const image = images[v][a];
19
+ const result = [
20
+ ...rustSteps(a, v),
21
+ ...nodeMainSteps(v),
22
+ ...denoSteps,
23
+ ...bunSteps(v, a),
24
+ ];
25
+ return [id, { 'runs-on': image, steps: toSteps(result) }];
26
+ };
27
+ const jobs = {
28
+ ...Object.fromEntries(os.flatMap(v => architecture.map(job(v)))),
29
+ ...nodeVersions,
30
+ playwright: playwrightJob,
31
+ };
32
+ const gha = {
33
+ name: 'CI',
34
+ on: { pull_request: {} },
35
+ jobs,
36
+ };
37
+ export const effect = begin
38
+ .step(() => writeFile('.github/workflows/ci.yml', utf8(JSON.stringify(gha, null, ' '))))
39
+ .step(() => pure(0));
40
+ export default () => effect;
@@ -0,0 +1,6 @@
1
+ import { type Jobs, type MetaStep, type Os } from '../common/module.f.ts';
2
+ export declare const major: (v: string) => string;
3
+ export declare const basicNode: (version: string) => (extra: readonly MetaStep[]) => readonly MetaStep[];
4
+ export declare const nodeTests: (version: string) => (extra: readonly MetaStep[]) => readonly MetaStep[];
5
+ export declare const nodeVersions: Jobs;
6
+ export declare const nodeMainSteps: (v: Os) => readonly MetaStep[];
@@ -0,0 +1,36 @@
1
+ import { node, tsgo } from "../config/module.f.js";
2
+ import { clean, install, test, ubuntu } from "../common/module.f.js";
3
+ export const major = (v) => v.split('.')[0];
4
+ const installNode = (version) => ({ uses: 'actions/setup-node@v6', with: { 'node-version': version } });
5
+ export const basicNode = (version) => (extra) => clean([
6
+ install(installNode(version)),
7
+ test({ run: 'npm ci' }),
8
+ ...extra,
9
+ ]);
10
+ export const nodeTests = (version) => (extra) => basicNode(version)([
11
+ test({ run: 'npm test' }),
12
+ test({ run: 'npm run fst' }),
13
+ ...extra,
14
+ ]);
15
+ const findTgz = (v) => v === 'windows' ? '(Get-ChildItem *.tgz).FullName' : './*.tgz';
16
+ const nodeTest = (v) => major(v) === '20' ? 'run test20' : 'test';
17
+ const nodeSteps = (v) => [
18
+ install(installNode(v)),
19
+ test({ run: 'npm ci' }),
20
+ test({ run: `npm ${nodeTest(v)}` }),
21
+ ];
22
+ export const nodeVersions = Object.fromEntries(node.others.map(v => [
23
+ `node${major(v)}`,
24
+ ubuntu(nodeSteps(v))
25
+ ]));
26
+ export const nodeMainSteps = (v) => nodeTests(node.default)([
27
+ // TypeScript Preview
28
+ install({ run: `npm install -g @typescript/native-preview@${tsgo}` }),
29
+ test({ run: 'tsgo' }),
30
+ // publishing
31
+ test({ run: 'npm pack' }),
32
+ test({ run: `npm install -g ${findTgz(v)}` }),
33
+ test({ run: 'fjs compile issues/demo/data/tree.json _tree.f.js' }),
34
+ test({ run: 'fjs t' }),
35
+ test({ run: 'npm uninstall functionalscript -g' }),
36
+ ]);
@@ -0,0 +1,2 @@
1
+ import { type Job } from '../common/module.f.ts';
2
+ export declare const playwrightJob: Job;
@@ -0,0 +1,23 @@
1
+ import { images, node, playwright } from "../config/module.f.js";
2
+ import { install, test, toSteps } from "../common/module.f.js";
3
+ import { basicNode } from "../node/module.f.js";
4
+ const playwrightImage = images.ubuntu.intel;
5
+ // Playwright installation is stuck on Node 26 (May 7 2026) so we use Node 24.
6
+ export const playwrightJob = {
7
+ 'runs-on': playwrightImage,
8
+ steps: toSteps(basicNode(node.others.at(-1))([
9
+ install({
10
+ uses: 'actions/cache@v4',
11
+ with: {
12
+ path: '~/.cache/ms-playwright',
13
+ key: `${playwrightImage}-playwright-${playwright}`,
14
+ },
15
+ }),
16
+ install({ run: `npm install -g playwright@${playwright}` }),
17
+ install({ run: 'playwright install-deps' }),
18
+ install({ run: 'playwright install' }),
19
+ // we have to use `npx` to make sure that we respect `@playwright/test` version from
20
+ // the `package.json`.
21
+ ...['chromium', 'firefox', 'webkit'].map(browser => test({ run: `npx playwright test --browser=${browser}` })),
22
+ ]))
23
+ };
@@ -0,0 +1,2 @@
1
+ import { type Architecture, type MetaStep, type Os } from '../common/module.f.ts';
2
+ export declare const rustSteps: (a: Architecture, v: Os) => readonly MetaStep[];
@@ -0,0 +1,49 @@
1
+ import { wasmer, wasmtime } from "../config/module.f.js";
2
+ import { install, test } from "../common/module.f.js";
3
+ const cargoTest = (target, config) => {
4
+ const to = target ? ` --target ${target}` : '';
5
+ const co = config ? ` --config ${config}` : '';
6
+ const main = `cargo test${to}${co}`;
7
+ return [
8
+ test({ run: main }),
9
+ test({ run: `${main} --release` })
10
+ ];
11
+ };
12
+ const customTarget = (target) => [
13
+ { type: 'rust', target },
14
+ ...cargoTest(target)
15
+ ];
16
+ const wasmTarget = (target) => [
17
+ ...customTarget(target),
18
+ ...cargoTest(target, '.cargo/config.wasmer.toml')
19
+ ];
20
+ const i686 = (a, v) => {
21
+ if (a === 'intel') {
22
+ switch (v) {
23
+ case 'windows': return customTarget('i686-pc-windows-msvc');
24
+ case 'ubuntu': return [
25
+ { type: 'apt-get', package: 'libc6-dev-i386' },
26
+ ...customTarget('i686-unknown-linux-gnu'),
27
+ ];
28
+ }
29
+ }
30
+ return [];
31
+ };
32
+ export const rustSteps = (a, v) => [
33
+ test({ run: 'cargo fmt -- --check' }),
34
+ test({ run: 'cargo clippy -- -D warnings' }),
35
+ ...cargoTest(),
36
+ install({
37
+ uses: 'bytecodealliance/actions/wasmtime/setup@v1',
38
+ with: { version: wasmtime }
39
+ }),
40
+ install({
41
+ uses: 'wasmerio/setup-wasmer@v3.1',
42
+ with: { version: `v${wasmer}` },
43
+ }),
44
+ ...wasmTarget('wasm32-wasip1'),
45
+ ...wasmTarget('wasm32-wasip2'),
46
+ ...wasmTarget('wasm32-unknown-unknown'),
47
+ ...wasmTarget('wasm32-wasip1-threads'),
48
+ ...i686(a, v),
49
+ ];
@@ -3,7 +3,7 @@ import { type PrimeField } from '../../types/prime_field/module.f.ts';
3
3
  /**
4
4
  * A 2D point represented as a pair of `bigint` values `[x, y]`.
5
5
  */
6
- type Point2D = readonly [bigint, bigint];
6
+ export type Point2D = readonly [bigint, bigint];
7
7
  /**
8
8
  * A 2D point on an elliptic curve, represented as a pair of `bigint` values.
9
9
  * `null` represents the point at infinity (`O`).
@@ -76,4 +76,3 @@ export declare const secp384r1: Curve;
76
76
  * https://neuromancer.sk/std/secg/secp521r1
77
77
  */
78
78
  export declare const secp521r1: Curve;
79
- export {};
@@ -7,6 +7,8 @@ import { type Io } from '../io/module.f.ts';
7
7
  import { type All, type NodeProgram, type Readdir } from '../types/effects/node/module.f.ts';
8
8
  import { type Effect } from '../types/effects/module.f.ts';
9
9
  export declare const todo: () => never;
10
+ export declare const assert: (v: boolean, msg?: unknown) => asserts v;
11
+ export declare const assertEq: <T>(a: T, b: T) => void;
10
12
  export type Module = {
11
13
  readonly default?: unknown;
12
14
  };
@@ -10,6 +10,11 @@ import { utf8, utf8ToString } from "../text/module.f.js";
10
10
  import { unwrap } from "../types/result/module.f.js";
11
11
  import { begin, pure } from "../types/effects/module.f.js";
12
12
  export const todo = () => { throw 'not implemented'; };
13
+ export const assert = (v, msg = 'assertion failed') => {
14
+ if (!v)
15
+ throw msg;
16
+ };
17
+ export const assertEq = (a, b) => assert(a === b, [a, b]);
13
18
  const cmp = ([a], [b]) => a < b ? -1 : a > b ? 1 : 0;
14
19
  export const env = ({ process: { env } }) => a => {
15
20
  const r = Object.getOwnPropertyDescriptor(env, a);
@@ -24,18 +24,20 @@ const scanModule = (x) => async (subTestRunner) => {
24
24
  }
25
25
  subTests = rest;
26
26
  //
27
- const [name, value] = first;
28
- const set = parse(value);
27
+ const [name, value, throws] = first;
28
+ const set = parse(throws)(value);
29
29
  if (typeof set === 'function') {
30
30
  await subTestRunner(name, () => {
31
31
  const r = set();
32
- subTests = [...subTests, [`${name}()`, r]];
32
+ // The result of a function is walked as a fresh sub-tree;
33
+ // the parent's `throws` flag does not propagate into it.
34
+ subTests = [...subTests, [`${name}()`, r, false]];
33
35
  });
34
36
  }
35
37
  else {
36
38
  for (const [j, y] of set) {
37
39
  const pr = `${name}/${j}`;
38
- subTests = [...subTests, [pr, y]];
40
+ subTests = [...subTests, [pr, y, throws || j === 'throw']];
39
41
  }
40
42
  }
41
43
  }
@@ -44,7 +46,7 @@ const run = async () => {
44
46
  const x = await loadModuleMap(io);
45
47
  for (const [i, v] of Object.entries(x)) {
46
48
  if (isTest(i)) {
47
- framework(i, scanModule(['', v.default]));
49
+ framework(i, scanModule(['', v.default, false]));
48
50
  }
49
51
  }
50
52
  };
@@ -16,7 +16,7 @@ type Input<T> = {
16
16
  export declare const isTest: (s: string) => boolean;
17
17
  export type Test = () => unknown;
18
18
  export type TestSet = Test | readonly (readonly [string, unknown])[];
19
- export declare const parseTestSet: (t: TryCatch) => (x: unknown) => TestSet;
19
+ export declare const parseTestSet: (t: TryCatch) => (throws: boolean) => (x: unknown) => TestSet;
20
20
  export declare const test: <T>(input: Input<T>) => readonly [number, T];
21
21
  export declare const anyLog: (f: (s: string) => void) => (s: string) => <T>(state: T) => T;
22
22
  export declare const measure: (p: Performance) => <R>(f: () => R) => <T>(state: T) => readonly [R, number, T];
@@ -18,16 +18,17 @@ const timeFormat = (a) => {
18
18
  const e = x.substring(s);
19
19
  return `${b}.${e} ms`;
20
20
  };
21
- export const parseTestSet = (t) => (x) => {
21
+ export const parseTestSet = (t) => (throws) => (x) => {
22
22
  switch (typeof x) {
23
23
  case 'function': {
24
24
  if (x.length === 0) {
25
25
  const xt = x;
26
- if (xt.name !== 'throw') {
26
+ if (!throws && xt.name !== 'throw') {
27
27
  return xt;
28
28
  }
29
- // Usual tests throw on error, but if the function name is 'throw',
30
- // then the test passes if it throws.
29
+ // Pass-on-throw: the test passes if it throws. Triggered when the
30
+ // enclosing tree node is named 'throw' (so any function reference
31
+ // works, not only inline ones whose inferred name is 'throw').
31
32
  return () => {
32
33
  const [tag, value] = t(xt);
33
34
  if (tag === 'ok') {
@@ -52,9 +53,9 @@ export const test = (input) => {
52
53
  const isGitHub = env('GITHUB_ACTION') !== undefined;
53
54
  const parse = parseTestSet(tryCatch);
54
55
  const f = ([k, v]) => {
55
- const test = i => v => ([ts, state]) => {
56
+ const test = i => throws => v => ([ts, state]) => {
56
57
  const next = test(`${i}| `);
57
- const set = parse(v);
58
+ const set = parse(throws)(v);
58
59
  if (typeof set === 'function') {
59
60
  const [[s, r], delta, state0] = measure(() => tryCatch(set))(state);
60
61
  state = state0;
@@ -73,13 +74,15 @@ export const test = (input) => {
73
74
  else {
74
75
  ts = addPass(delta)(ts);
75
76
  log(`${i}() ${fgGreen}ok${reset}, ${timeFormat(delta)}`);
76
- [ts, state] = next(r)([ts, state]);
77
+ // The result of a function is walked as a fresh sub-tree;
78
+ // the parent's `throws` flag does not propagate into it.
79
+ [ts, state] = next(false)(r)([ts, state]);
77
80
  }
78
81
  }
79
82
  else {
80
83
  const f = ([k, v]) => ([time, state]) => {
81
84
  log(`${i}${k}:`);
82
- [time, state] = next(v)([time, state]);
85
+ [time, state] = next(throws || k === 'throw')(v)([time, state]);
83
86
  return [time, state];
84
87
  };
85
88
  [ts, state] = fold(f)([ts, state])(set);
@@ -89,7 +92,7 @@ export const test = (input) => {
89
92
  return ([ts, state]) => {
90
93
  if (isTest(k)) {
91
94
  log(`testing ${k}`);
92
- [ts, state] = test('| ')(v.default)([ts, state]);
95
+ [ts, state] = test('| ')(false)(v.default)([ts, state]);
93
96
  }
94
97
  return [ts, state];
95
98
  };
@@ -0,0 +1,16 @@
1
+ declare const _default: {
2
+ throw: () => never;
3
+ throwReference: {
4
+ throw: () => unknown;
5
+ };
6
+ throwGroup: {
7
+ throw: {
8
+ inline: () => never;
9
+ reference: () => unknown;
10
+ nested: {
11
+ deep: () => never;
12
+ };
13
+ };
14
+ };
15
+ };
16
+ export default _default;