functionalscript 0.1.609 → 0.2.1

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 (393) hide show
  1. package/com/cpp/module.f.mjs +20 -25
  2. package/com/cpp/testlib.f.mjs +3 -4
  3. package/com/cs/module.f.mjs +18 -23
  4. package/com/cs/testlib.f.mjs +3 -5
  5. package/com/rust/module.f.mjs +25 -30
  6. package/com/rust/testlib.f.mjs +3 -5
  7. package/com/test/build.f.mjs +2 -2
  8. package/com/test/build.mjs +4 -4
  9. package/com/types/module.f.mjs +5 -12
  10. package/commonjs/build/module.f.mjs +23 -28
  11. package/commonjs/build/test.f.mjs +4 -4
  12. package/commonjs/module/function/module.f.mjs +0 -2
  13. package/commonjs/module/module.f.mjs +2 -9
  14. package/commonjs/module.f.mjs +0 -2
  15. package/commonjs/module.mjs +2 -7
  16. package/commonjs/package/dependencies/module.f.mjs +5 -10
  17. package/commonjs/package/dependencies/test.f.mjs +1 -1
  18. package/commonjs/package/module.f.mjs +6 -13
  19. package/commonjs/package/test.f.mjs +1 -1
  20. package/commonjs/path/module.f.mjs +12 -23
  21. package/commonjs/path/test.f.mjs +11 -11
  22. package/commonjs/test.mjs +1 -1
  23. package/dev/module.f.mjs +1 -4
  24. package/dev/module.mjs +1 -1
  25. package/dev/test/module.f.mjs +4 -6
  26. package/djs/module.f.mjs +12 -19
  27. package/djs/parser/module.f.mjs +18 -24
  28. package/djs/parser/test.f.mjs +9 -9
  29. package/djs/test.f.mjs +4 -4
  30. package/djs/tokenizer/module.f.mjs +18 -23
  31. package/djs/tokenizer/test.f.mjs +6 -6
  32. package/fsc/module.f.mjs +17 -24
  33. package/fsc/test.f.mjs +3 -3
  34. package/fsm/module.f.mjs +27 -38
  35. package/fsm/test.f.mjs +8 -8
  36. package/html/module.f.mjs +14 -23
  37. package/html/test.f.mjs +4 -4
  38. package/js/tokenizer/module.f.mjs +55 -62
  39. package/js/tokenizer/test.f.mjs +6 -6
  40. package/json/module.f.mjs +18 -31
  41. package/json/parser/module.f.mjs +9 -14
  42. package/json/parser/test.f.mjs +7 -7
  43. package/json/serializer/module.f.mjs +14 -29
  44. package/json/serializer/test.f.mjs +2 -2
  45. package/json/test.f.mjs +3 -3
  46. package/json/tokenizer/module.f.mjs +14 -19
  47. package/json/tokenizer/test.f.mjs +6 -6
  48. package/jsr.json +59 -59
  49. package/nodejs/version/main.mjs +1 -1
  50. package/nodejs/version/module.f.mjs +2 -7
  51. package/nodejs/version/test.f.mjs +3 -3
  52. package/out/com/cpp/module.f.d.mts +4 -0
  53. package/out/com/cpp/module.f.mjs +123 -0
  54. package/out/com/cpp/test.f.mjs +40 -0
  55. package/out/com/cpp/testlib.f.mjs +7 -0
  56. package/out/com/cs/module.f.d.mts +4 -0
  57. package/out/com/cs/module.f.mjs +95 -0
  58. package/out/com/cs/test.f.mjs +43 -0
  59. package/out/com/cs/testlib.f.mjs +7 -0
  60. package/{com → out/com}/rust/module.f.d.mts +3 -7
  61. package/out/com/rust/module.f.mjs +213 -0
  62. package/out/com/rust/test.f.mjs +123 -0
  63. package/out/com/rust/testlib.f.mjs +7 -0
  64. package/{com → out/com}/test/build.f.d.mts +2 -2
  65. package/out/com/test/build.f.mjs +98 -0
  66. package/out/com/test/build.mjs +40 -0
  67. package/{com → out/com}/types/module.f.d.mts +5 -10
  68. package/out/com/types/module.f.mjs +51 -0
  69. package/out/com/types/testlib.f.mjs +30 -0
  70. package/out/commonjs/build/module.f.d.mts +20 -0
  71. package/out/commonjs/build/module.f.mjs +107 -0
  72. package/out/commonjs/build/test.f.mjs +102 -0
  73. package/{commonjs → out/commonjs}/module/function/module.f.d.mts +0 -2
  74. package/out/commonjs/module/function/module.f.mjs +15 -0
  75. package/{commonjs → out/commonjs}/module/module.f.d.mts +16 -21
  76. package/out/commonjs/module/module.f.mjs +48 -0
  77. package/out/commonjs/module.d.mts +3 -0
  78. package/{commonjs → out/commonjs}/module.f.d.mts +0 -2
  79. package/out/commonjs/module.f.mjs +10 -0
  80. package/out/commonjs/module.mjs +26 -0
  81. package/out/commonjs/package/dependencies/module.f.d.mts +6 -0
  82. package/out/commonjs/package/dependencies/module.f.mjs +21 -0
  83. package/out/commonjs/package/dependencies/test.f.mjs +15 -0
  84. package/out/commonjs/package/module.f.d.mts +21 -0
  85. package/out/commonjs/package/module.f.mjs +40 -0
  86. package/out/commonjs/package/test.f.mjs +27 -0
  87. package/{commonjs → out/commonjs}/path/module.f.d.mts +25 -32
  88. package/out/commonjs/path/module.f.mjs +171 -0
  89. package/out/commonjs/path/test.f.mjs +231 -0
  90. package/out/commonjs/test.mjs +87 -0
  91. package/out/dev/index.mjs +2 -0
  92. package/out/dev/module.f.d.mts +1 -0
  93. package/out/dev/module.f.mjs +2 -0
  94. package/out/dev/module.mjs +167 -0
  95. package/{dev → out/dev}/test/module.f.d.mts +2 -3
  96. package/out/dev/test/module.f.mjs +134 -0
  97. package/out/dev/test.f.mjs +58 -0
  98. package/out/dev/test.mjs +52 -0
  99. package/{djs → out/djs}/module.f.d.mts +13 -18
  100. package/out/djs/module.f.mjs +75 -0
  101. package/{djs → out/djs}/parser/module.f.d.mts +11 -15
  102. package/out/djs/parser/module.f.mjs +432 -0
  103. package/out/djs/parser/test.f.mjs +535 -0
  104. package/out/djs/test.f.mjs +84 -0
  105. package/out/djs/tokenizer/module.f.d.mts +13 -0
  106. package/out/djs/tokenizer/module.f.mjs +87 -0
  107. package/out/djs/tokenizer/test.f.mjs +480 -0
  108. package/out/fsc/module.f.d.mts +7 -0
  109. package/out/fsc/module.f.mjs +105 -0
  110. package/out/fsc/test.f.mjs +19 -0
  111. package/out/fsm/module.f.d.mts +14 -0
  112. package/out/fsm/module.f.mjs +80 -0
  113. package/out/fsm/test.f.mjs +138 -0
  114. package/out/html/module.f.d.mts +15 -0
  115. package/out/html/module.f.mjs +94 -0
  116. package/out/html/test.f.mjs +45 -0
  117. package/out/issues/test.f.mjs +66 -0
  118. package/{js → out/js}/tokenizer/module.f.d.mts +10 -15
  119. package/out/js/tokenizer/module.f.mjs +686 -0
  120. package/out/js/tokenizer/test.f.mjs +844 -0
  121. package/out/json/module.f.d.mts +33 -0
  122. package/out/json/module.f.mjs +89 -0
  123. package/{json → out/json}/parser/module.f.d.mts +9 -13
  124. package/out/json/parser/module.f.mjs +224 -0
  125. package/out/json/parser/test.f.mjs +321 -0
  126. package/out/json/serializer/module.f.d.mts +36 -0
  127. package/out/json/serializer/module.f.mjs +67 -0
  128. package/out/json/serializer/test.f.mjs +87 -0
  129. package/out/json/test.f.mjs +61 -0
  130. package/out/json/tokenizer/module.f.d.mts +13 -0
  131. package/out/json/tokenizer/module.f.mjs +78 -0
  132. package/out/json/tokenizer/test.f.mjs +420 -0
  133. package/out/nanvm-lib/tests/test.f.mjs +87 -0
  134. package/out/nodejs/version/main.mjs +3 -0
  135. package/{nodejs → out/nodejs}/version/module.f.d.mts +4 -9
  136. package/out/nodejs/version/module.f.mjs +34 -0
  137. package/out/nodejs/version/test.f.mjs +97 -0
  138. package/{prime_field → out/prime_field}/module.f.d.mts +20 -23
  139. package/out/prime_field/module.f.mjs +87 -0
  140. package/out/prime_field/test.f.mjs +145 -0
  141. package/{secp → out/secp}/module.f.d.mts +27 -28
  142. package/out/secp/module.f.mjs +113 -0
  143. package/out/secp/test.f.mjs +63 -0
  144. package/out/sha2/module.f.d.mts +15 -0
  145. package/out/sha2/module.f.mjs +172 -0
  146. package/out/sha2/test.f.mjs +86 -0
  147. package/out/text/ascii/module.f.d.mts +70 -0
  148. package/out/text/ascii/module.f.mjs +154 -0
  149. package/out/text/ascii/test.f.mjs +14 -0
  150. package/out/text/module.f.d.mts +13 -0
  151. package/out/text/module.f.mjs +19 -0
  152. package/out/text/sgr/module.f.d.mts +12 -0
  153. package/out/text/sgr/module.f.mjs +17 -0
  154. package/out/text/test.f.mjs +19 -0
  155. package/out/text/utf16/module.f.d.mts +12 -0
  156. package/out/text/utf16/module.f.mjs +86 -0
  157. package/out/text/utf16/test.f.mjs +145 -0
  158. package/out/text/utf8/module.f.d.mts +10 -0
  159. package/out/text/utf8/module.f.mjs +126 -0
  160. package/out/text/utf8/test.f.mjs +175 -0
  161. package/{types → out/types}/array/module.f.d.mts +14 -24
  162. package/out/types/array/module.f.mjs +95 -0
  163. package/out/types/array/test.f.mjs +116 -0
  164. package/out/types/bigfloat/module.f.d.mts +6 -0
  165. package/out/types/bigfloat/module.f.mjs +77 -0
  166. package/out/types/bigfloat/test.f.mjs +349 -0
  167. package/out/types/bigint/module.f.d.mts +29 -0
  168. package/{types/bigint/module.f.d.mts → out/types/bigint/module.f.mjs} +64 -27
  169. package/out/types/bigint/test.f.mjs +192 -0
  170. package/{types → out/types}/btree/find/module.f.d.mts +20 -26
  171. package/out/types/btree/find/module.f.mjs +137 -0
  172. package/out/types/btree/find/test.f.mjs +156 -0
  173. package/out/types/btree/module.f.d.mts +5 -0
  174. package/out/types/btree/module.f.mjs +34 -0
  175. package/{types → out/types}/btree/remove/module.f.d.mts +7 -12
  176. package/out/types/btree/remove/module.f.mjs +209 -0
  177. package/out/types/btree/remove/test.f.mjs +638 -0
  178. package/{types → out/types}/btree/set/module.f.d.mts +3 -7
  179. package/out/types/btree/set/module.f.mjs +114 -0
  180. package/out/types/btree/set/test.f.mjs +390 -0
  181. package/out/types/btree/test.f.mjs +83 -0
  182. package/{types → out/types}/btree/types/module.f.d.mts +0 -2
  183. package/out/types/btree/types/module.f.mjs +50 -0
  184. package/out/types/byte_set/module.f.d.mts +25 -0
  185. package/out/types/byte_set/module.f.mjs +42 -0
  186. package/out/types/byte_set/test.f.mjs +123 -0
  187. package/{types → out/types}/function/compare/module.f.d.mts +9 -15
  188. package/out/types/function/compare/module.f.mjs +22 -0
  189. package/out/types/function/compare/test.f.mjs +8 -0
  190. package/{types → out/types}/function/module.f.d.mts +20 -27
  191. package/out/types/function/module.f.mjs +44 -0
  192. package/{types → out/types}/function/operator/module.f.d.mts +28 -43
  193. package/out/types/function/operator/module.f.mjs +60 -0
  194. package/out/types/function/test.f.mjs +15 -0
  195. package/out/types/list/module.f.d.mts +82 -0
  196. package/out/types/list/module.f.mjs +269 -0
  197. package/out/types/list/test.f.mjs +401 -0
  198. package/out/types/map/module.f.d.mts +21 -0
  199. package/out/types/map/module.f.mjs +54 -0
  200. package/out/types/map/test.f.mjs +115 -0
  201. package/out/types/nibble_set/module.f.d.mts +16 -0
  202. package/out/types/nibble_set/module.f.mjs +19 -0
  203. package/out/types/nibble_set/test.f.mjs +90 -0
  204. package/out/types/nullable/module.f.d.mts +9 -0
  205. package/out/types/nullable/module.f.mjs +9 -0
  206. package/out/types/nullable/test.f.mjs +12 -0
  207. package/out/types/number/module.f.d.mts +7 -0
  208. package/out/types/number/module.f.mjs +12 -0
  209. package/out/types/number/test.f.mjs +126 -0
  210. package/out/types/object/module.f.d.mts +22 -0
  211. package/out/types/object/module.f.mjs +27 -0
  212. package/out/types/object/test.f.mjs +17 -0
  213. package/out/types/range/module.f.d.mts +6 -0
  214. package/out/types/range/module.f.mjs +6 -0
  215. package/out/types/range/test.f.mjs +18 -0
  216. package/{types → out/types}/range_map/module.f.d.mts +9 -15
  217. package/out/types/range_map/module.f.mjs +84 -0
  218. package/out/types/range_map/test.f.mjs +201 -0
  219. package/out/types/result/module.d.mts +7 -0
  220. package/{types → out/types}/result/module.f.d.mts +6 -12
  221. package/out/types/result/module.f.mjs +25 -0
  222. package/out/types/result/module.mjs +16 -0
  223. package/{types → out/types}/sorted_list/module.f.d.mts +22 -28
  224. package/out/types/sorted_list/module.f.mjs +102 -0
  225. package/out/types/sorted_list/test.f.mjs +66 -0
  226. package/{types → out/types}/sorted_set/module.f.d.mts +6 -12
  227. package/out/types/sorted_set/module.f.mjs +29 -0
  228. package/out/types/sorted_set/test.f.mjs +80 -0
  229. package/out/types/string/module.f.d.mts +9 -0
  230. package/out/types/string/module.f.mjs +17 -0
  231. package/out/types/string/test.f.mjs +58 -0
  232. package/out/types/string_set/module.f.d.mts +13 -0
  233. package/out/types/string_set/module.f.mjs +29 -0
  234. package/out/types/string_set/test.f.mjs +65 -0
  235. package/package.json +5 -4
  236. package/prime_field/module.f.mjs +9 -12
  237. package/prime_field/test.f.mjs +1 -1
  238. package/secp/module.f.mjs +38 -39
  239. package/secp/test.f.mjs +4 -4
  240. package/sha2/module.f.mjs +7 -20
  241. package/sha2/test.f.mjs +4 -4
  242. package/text/ascii/module.f.mjs +5 -10
  243. package/text/ascii/test.f.mjs +3 -3
  244. package/text/module.f.mjs +7 -14
  245. package/text/sgr/module.f.mjs +2 -4
  246. package/text/test.f.mjs +3 -3
  247. package/text/utf16/module.f.mjs +17 -28
  248. package/text/utf16/test.f.mjs +5 -5
  249. package/text/utf8/module.f.mjs +9 -16
  250. package/text/utf8/test.f.mjs +4 -4
  251. package/tsconfig.json +2 -2
  252. package/types/array/module.f.mjs +8 -25
  253. package/types/array/test.f.mjs +3 -3
  254. package/types/bigfloat/module.f.mjs +3 -10
  255. package/types/bigfloat/test.f.mjs +1 -1
  256. package/types/bigint/module.f.mjs +11 -30
  257. package/types/bigint/test.f.mjs +1 -1
  258. package/types/btree/find/module.f.mjs +8 -17
  259. package/types/btree/find/test.f.mjs +7 -7
  260. package/types/btree/module.f.mjs +6 -11
  261. package/types/btree/remove/module.f.mjs +10 -17
  262. package/types/btree/remove/test.f.mjs +5 -5
  263. package/types/btree/set/module.f.mjs +4 -9
  264. package/types/btree/set/test.f.mjs +4 -4
  265. package/types/btree/test.f.mjs +9 -9
  266. package/types/btree/types/module.f.mjs +0 -2
  267. package/types/byte_set/module.f.mjs +14 -39
  268. package/types/byte_set/test.f.mjs +5 -5
  269. package/types/function/compare/module.f.mjs +3 -12
  270. package/types/function/compare/test.f.mjs +1 -1
  271. package/types/function/module.f.mjs +4 -15
  272. package/types/function/operator/module.f.mjs +14 -41
  273. package/types/function/test.f.mjs +1 -1
  274. package/types/list/module.f.mjs +45 -114
  275. package/types/list/test.f.mjs +10 -10
  276. package/types/map/module.f.mjs +15 -30
  277. package/types/map/test.f.mjs +2 -2
  278. package/types/nibble_set/module.f.mjs +7 -24
  279. package/types/nibble_set/test.f.mjs +2 -2
  280. package/types/nullable/module.f.mjs +2 -9
  281. package/types/nullable/test.f.mjs +1 -1
  282. package/types/number/module.f.mjs +8 -19
  283. package/types/number/test.f.mjs +1 -1
  284. package/types/object/module.f.mjs +9 -20
  285. package/types/object/test.f.mjs +1 -1
  286. package/types/range/module.f.mjs +2 -9
  287. package/types/range/test.f.mjs +1 -1
  288. package/types/range_map/module.f.mjs +9 -18
  289. package/types/range_map/test.f.mjs +32 -32
  290. package/types/result/module.f.mjs +3 -12
  291. package/types/result/module.mjs +2 -2
  292. package/types/sorted_list/module.f.mjs +10 -19
  293. package/types/sorted_list/test.f.mjs +7 -7
  294. package/types/sorted_set/module.f.mjs +7 -16
  295. package/types/sorted_set/test.f.mjs +7 -7
  296. package/types/string/module.f.mjs +10 -21
  297. package/types/string/test.f.mjs +2 -2
  298. package/types/string_set/module.f.mjs +12 -27
  299. package/types/string_set/test.f.mjs +1 -1
  300. package/com/cpp/module.f.d.mts +0 -8
  301. package/com/cs/module.f.d.mts +0 -8
  302. package/commonjs/build/module.f.d.mts +0 -24
  303. package/commonjs/module.d.mts +0 -7
  304. package/commonjs/package/dependencies/module.f.d.mts +0 -10
  305. package/commonjs/package/module.f.d.mts +0 -27
  306. package/dev/module.f.d.mts +0 -4
  307. package/djs/tokenizer/module.f.d.mts +0 -17
  308. package/fsc/module.f.d.mts +0 -12
  309. package/fsm/module.f.d.mts +0 -21
  310. package/html/module.f.d.mts +0 -20
  311. package/json/module.f.d.mts +0 -41
  312. package/json/serializer/module.f.d.mts +0 -45
  313. package/json/tokenizer/module.f.d.mts +0 -17
  314. package/sha2/module.f.d.mts +0 -23
  315. package/text/ascii/module.f.d.mts +0 -73
  316. package/text/module.f.d.mts +0 -18
  317. package/text/sgr/module.f.d.mts +0 -14
  318. package/text/utf16/module.f.d.mts +0 -19
  319. package/text/utf8/module.f.d.mts +0 -15
  320. package/types/bigfloat/module.f.d.mts +0 -11
  321. package/types/btree/module.f.d.mts +0 -9
  322. package/types/byte_set/module.f.d.mts +0 -38
  323. package/types/list/module.f.d.mts +0 -117
  324. package/types/map/module.f.d.mts +0 -30
  325. package/types/nibble_set/module.f.d.mts +0 -26
  326. package/types/nullable/module.f.d.mts +0 -14
  327. package/types/number/module.f.d.mts +0 -13
  328. package/types/object/module.f.d.mts +0 -29
  329. package/types/range/module.f.d.mts +0 -11
  330. package/types/result/module.d.mts +0 -7
  331. package/types/string/module.f.d.mts +0 -15
  332. package/types/string_set/module.f.d.mts +0 -21
  333. /package/{com → out/com}/cpp/test.f.d.mts +0 -0
  334. /package/{com → out/com}/cpp/testlib.f.d.mts +0 -0
  335. /package/{com → out/com}/cs/test.f.d.mts +0 -0
  336. /package/{com → out/com}/cs/testlib.f.d.mts +0 -0
  337. /package/{com → out/com}/rust/test.f.d.mts +0 -0
  338. /package/{com → out/com}/rust/testlib.f.d.mts +0 -0
  339. /package/{com → out/com}/test/build.d.mts +0 -0
  340. /package/{com → out/com}/types/testlib.f.d.mts +0 -0
  341. /package/{commonjs → out/commonjs}/build/test.f.d.mts +0 -0
  342. /package/{commonjs → out/commonjs}/package/dependencies/test.f.d.mts +0 -0
  343. /package/{commonjs → out/commonjs}/package/test.f.d.mts +0 -0
  344. /package/{commonjs → out/commonjs}/path/test.f.d.mts +0 -0
  345. /package/{commonjs → out/commonjs}/test.d.mts +0 -0
  346. /package/{dev → out/dev}/index.d.mts +0 -0
  347. /package/{dev → out/dev}/module.d.mts +0 -0
  348. /package/{dev → out/dev}/test.d.mts +0 -0
  349. /package/{dev → out/dev}/test.f.d.mts +0 -0
  350. /package/{djs → out/djs}/parser/test.f.d.mts +0 -0
  351. /package/{djs → out/djs}/test.f.d.mts +0 -0
  352. /package/{djs → out/djs}/tokenizer/test.f.d.mts +0 -0
  353. /package/{fsc → out/fsc}/test.f.d.mts +0 -0
  354. /package/{fsm → out/fsm}/test.f.d.mts +0 -0
  355. /package/{html → out/html}/test.f.d.mts +0 -0
  356. /package/{issues → out/issues}/test.f.d.mts +0 -0
  357. /package/{js → out/js}/tokenizer/test.f.d.mts +0 -0
  358. /package/{json → out/json}/parser/test.f.d.mts +0 -0
  359. /package/{json → out/json}/serializer/test.f.d.mts +0 -0
  360. /package/{json → out/json}/test.f.d.mts +0 -0
  361. /package/{json → out/json}/tokenizer/test.f.d.mts +0 -0
  362. /package/{nanvm-lib → out/nanvm-lib}/tests/test.f.d.mts +0 -0
  363. /package/{nodejs → out/nodejs}/version/main.d.mts +0 -0
  364. /package/{nodejs → out/nodejs}/version/test.f.d.mts +0 -0
  365. /package/{prime_field → out/prime_field}/test.f.d.mts +0 -0
  366. /package/{secp → out/secp}/test.f.d.mts +0 -0
  367. /package/{sha2 → out/sha2}/test.f.d.mts +0 -0
  368. /package/{text → out/text}/ascii/test.f.d.mts +0 -0
  369. /package/{text → out/text}/test.f.d.mts +0 -0
  370. /package/{text → out/text}/utf16/test.f.d.mts +0 -0
  371. /package/{text → out/text}/utf8/test.f.d.mts +0 -0
  372. /package/{types → out/types}/array/test.f.d.mts +0 -0
  373. /package/{types → out/types}/bigfloat/test.f.d.mts +0 -0
  374. /package/{types → out/types}/bigint/test.f.d.mts +0 -0
  375. /package/{types → out/types}/btree/find/test.f.d.mts +0 -0
  376. /package/{types → out/types}/btree/remove/test.f.d.mts +0 -0
  377. /package/{types → out/types}/btree/set/test.f.d.mts +0 -0
  378. /package/{types → out/types}/btree/test.f.d.mts +0 -0
  379. /package/{types → out/types}/byte_set/test.f.d.mts +0 -0
  380. /package/{types → out/types}/function/compare/test.f.d.mts +0 -0
  381. /package/{types → out/types}/function/test.f.d.mts +0 -0
  382. /package/{types → out/types}/list/test.f.d.mts +0 -0
  383. /package/{types → out/types}/map/test.f.d.mts +0 -0
  384. /package/{types → out/types}/nibble_set/test.f.d.mts +0 -0
  385. /package/{types → out/types}/nullable/test.f.d.mts +0 -0
  386. /package/{types → out/types}/number/test.f.d.mts +0 -0
  387. /package/{types → out/types}/object/test.f.d.mts +0 -0
  388. /package/{types → out/types}/range/test.f.d.mts +0 -0
  389. /package/{types → out/types}/range_map/test.f.d.mts +0 -0
  390. /package/{types → out/types}/sorted_list/test.f.d.mts +0 -0
  391. /package/{types → out/types}/sorted_set/test.f.d.mts +0 -0
  392. /package/{types → out/types}/string/test.f.d.mts +0 -0
  393. /package/{types → out/types}/string_set/test.f.d.mts +0 -0
@@ -0,0 +1,54 @@
1
+ // @ts-self-types="./module.f.d.mts"
2
+ import * as BtreeTypes from '../btree/types/module.f.mjs';
3
+ import * as btf from '../btree/find/module.f.mjs';
4
+ const { value, find } = btf;
5
+ import * as bts from '../btree/set/module.f.mjs';
6
+ const { set } = bts;
7
+ import * as btr from '../btree/remove/module.f.mjs';
8
+ const { remove: btreeRemove } = btr;
9
+ import * as bt from '../btree/module.f.mjs';
10
+ const { values } = bt;
11
+ import * as Compare from '../function/compare/module.f.mjs';
12
+ import * as s from '../string/module.f.mjs';
13
+ const { cmp } = s;
14
+ import * as list from '../list/module.f.mjs';
15
+ const { fold } = list;
16
+ import * as Operator from '../function/operator/module.f.mjs';
17
+ /** @typedef {Compare.Sign} Sign */
18
+ /**
19
+ * @template T
20
+ * @typedef {Compare.Compare<T>} Cmp
21
+ */
22
+ /**
23
+ * @template T
24
+ * @typedef {readonly[string, T]} Entry
25
+ */
26
+ /**
27
+ * @template T
28
+ * @typedef {BtreeTypes.Tree<Entry<T>>} Map
29
+ */
30
+ /** @type {(a: string) => <T>(b: Entry<T>) => Sign} */
31
+ const keyCmp = a => ([b]) => cmp(a)(b);
32
+ /** @type {(name: string) => <T>(map: Map<T>) => T|null} */
33
+ export const at = name => map => {
34
+ if (map === null) {
35
+ return null;
36
+ }
37
+ const result = value(find(keyCmp(name))(map).first);
38
+ return result === null ? null : result[1];
39
+ };
40
+ /** @type {<T>(reduce: Operator.Reduce<T>) => (entry: Entry<T>) => (map: Map<T>) => Map<T>} */
41
+ const setReduceEntry = reduce => entry => set(keyCmp(entry[0]))(old => old === null ? entry : [old[0], reduce(old[1])(entry[1])]);
42
+ /** @type {<T>(reduce: Operator.Reduce<T>) => (name: string) => (value: T) => (map: Map<T>) => Map<T>} */
43
+ export const setReduce = reduce => name => value => setReduceEntry(reduce)([name, value]);
44
+ /** @type {<T>(a: T) => (b: T) => T} */
45
+ const replace = () => b => b;
46
+ /** @type {(name: string) => <T>(value: T) => (map: Map<T>) => Map<T>} */
47
+ export const setReplace = name => value => setReduceEntry(replace)([name, value]);
48
+ /** @type {<T>(map: Map<T>) => list.List<Entry<T>>} */
49
+ export const entries = values;
50
+ /** @type {<T>(entries: list.List<Entry<T>>) => Map<T>} */
51
+ export const fromEntries = fold(setReduceEntry(replace))(null);
52
+ /** @type {(name: string) => <T>(map: Map<T>) => Map<T>} */
53
+ export const remove = name => btreeRemove(keyCmp(name));
54
+ export const empty = null;
@@ -0,0 +1,115 @@
1
+ import * as _ from './module.f.mjs';
2
+ const { at, setReplace, setReduce, empty, entries, remove } = _;
3
+ import * as seq from '../list/module.f.mjs';
4
+ export default {
5
+ main: [
6
+ () => {
7
+ let m = setReplace('a')(1)(null);
8
+ if (at('a')(m) !== 1) {
9
+ throw 'error';
10
+ }
11
+ if (at('b')(m) !== null) {
12
+ throw 'error';
13
+ }
14
+ m = setReplace('b')(2)(m);
15
+ if (at('a')(m) !== 1) {
16
+ throw 'error';
17
+ }
18
+ if (at('b')(m) !== 2) {
19
+ throw 'error';
20
+ }
21
+ if (at('c')(m) !== null) {
22
+ throw 'error';
23
+ }
24
+ m = setReplace('z')(3)(m);
25
+ if (at('a')(m) !== 1) {
26
+ throw 'error';
27
+ }
28
+ if (at('b')(m) !== 2) {
29
+ throw 'error';
30
+ }
31
+ if (at('z')(m) !== 3) {
32
+ throw 'error';
33
+ }
34
+ if (at('')(m) !== null) {
35
+ throw 'error';
36
+ }
37
+ m = setReplace('')(4)(m);
38
+ if (at('a')(m) !== 1) {
39
+ throw 'error';
40
+ }
41
+ if (at('b')(m) !== 2) {
42
+ throw 'error';
43
+ }
44
+ if (at('z')(m) !== 3) {
45
+ throw 'error';
46
+ }
47
+ if (at('')(m) !== 4) {
48
+ throw 'error';
49
+ }
50
+ if (at('Hello world!')(m) !== null) {
51
+ throw 'error';
52
+ }
53
+ m = setReplace('Hello world!')(42)(m);
54
+ if (at('a')(m) !== 1) {
55
+ throw 'error';
56
+ }
57
+ if (at('b')(m) !== 2) {
58
+ throw 'error';
59
+ }
60
+ if (at('z')(m) !== 3) {
61
+ throw 'error';
62
+ }
63
+ if (at('')(m) !== 4) {
64
+ throw 'error';
65
+ }
66
+ if (at('Hello world!')(m) !== 42) {
67
+ throw 'error';
68
+ }
69
+ if (at('x')(m) !== null) {
70
+ throw 'error';
71
+ }
72
+ // console.log(Array.from(m.entries()))
73
+ m = remove('Hello world!')(m);
74
+ if (at('Hello world!')(m) !== null) {
75
+ throw m;
76
+ }
77
+ m = setReduce(a => b => a + b)('a')(43)(m);
78
+ if (at('a')(m) !== 44) {
79
+ throw 'error';
80
+ }
81
+ },
82
+ () => {
83
+ let m = setReplace('x')(12)(null);
84
+ m = setReplace('y')(44)(m);
85
+ if (at('x')(m) !== 12) {
86
+ throw 'error';
87
+ }
88
+ if (at('y')(m) !== 44) {
89
+ throw 'error';
90
+ }
91
+ if (at('a')(m) !== null) {
92
+ throw 'error';
93
+ }
94
+ const e = seq.toArray(entries(m));
95
+ if (e.length !== 2) {
96
+ throw 'error';
97
+ }
98
+ },
99
+ ],
100
+ stress: () => {
101
+ /** @type {import('./module.f.mjs').Map<number>} */
102
+ let m = empty;
103
+ for (let i = 0; i < 100_000; ++i) {
104
+ m = setReplace((i * i).toString())(i)(m);
105
+ /*
106
+ console.log()
107
+ console.log(`# ${i}`)
108
+ console.log()
109
+ for (const e of m.struct()) {
110
+ console.log(e)
111
+ }
112
+ */
113
+ }
114
+ }
115
+ };
@@ -0,0 +1,16 @@
1
+ /** @typedef {number} NibbleSet */
2
+ /** @typedef {number} Nibble */
3
+ export const empty: 0;
4
+ export const universe: 65535;
5
+ /** @type {(n: Nibble) => (s: NibbleSet) => boolean} */
6
+ export const has: (n: Nibble) => (s: NibbleSet) => boolean;
7
+ /** @type {(n: Nibble) => (s: NibbleSet) => NibbleSet} */
8
+ export const set: (n: Nibble) => (s: NibbleSet) => NibbleSet;
9
+ /** @type {(n: NibbleSet) => NibbleSet} */
10
+ export const complement: (n: NibbleSet) => NibbleSet;
11
+ /** @type {(n: Nibble) => (s: NibbleSet) => NibbleSet} */
12
+ export const unset: (n: Nibble) => (s: NibbleSet) => NibbleSet;
13
+ /** @type {(r: readonly[number, number]) => (s: NibbleSet) => NibbleSet} */
14
+ export const setRange: (r: readonly [number, number]) => (s: NibbleSet) => NibbleSet;
15
+ export type NibbleSet = number;
16
+ export type Nibble = number;
@@ -0,0 +1,19 @@
1
+ // @ts-self-types="./module.f.d.mts"
2
+ /** @typedef {number} NibbleSet */
3
+ /** @typedef {number} Nibble */
4
+ export const empty = 0;
5
+ export const universe = 0xFFFF;
6
+ /** @type {(n: Nibble) => NibbleSet} */
7
+ const one = n => 1 << n;
8
+ /** @type {(n: Nibble) => (s: NibbleSet) => boolean} */
9
+ export const has = n => s => ((s >> n) & 1) === 1;
10
+ /** @type {(n: Nibble) => (s: NibbleSet) => NibbleSet} */
11
+ export const set = n => s => s | one(n);
12
+ /** @type {(n: NibbleSet) => NibbleSet} */
13
+ export const complement = s => universe ^ s;
14
+ /** @type {(n: Nibble) => (s: NibbleSet) => NibbleSet} */
15
+ export const unset = n => s => s & complement(one(n));
16
+ /** @type {(r: readonly[number, number]) => NibbleSet} */
17
+ const range = ([a, b]) => one(b - a + 1) - 1 << a;
18
+ /** @type {(r: readonly[number, number]) => (s: NibbleSet) => NibbleSet} */
19
+ export const setRange = r => s => s | range(r);
@@ -0,0 +1,90 @@
1
+ import * as list from '../list/module.f.mjs';
2
+ const { every, map, countdown } = list;
3
+ import * as _ from './module.f.mjs';
4
+ export default {
5
+ has: () => {
6
+ if (_.has(0)(_.empty)) {
7
+ throw _.empty;
8
+ }
9
+ if (_.has(1)(_.empty)) {
10
+ throw _.empty;
11
+ }
12
+ if (_.has(15)(_.empty)) {
13
+ throw _.empty;
14
+ }
15
+ },
16
+ set: [
17
+ () => {
18
+ const s = _.set(0)(_.empty);
19
+ if (s !== 1) {
20
+ throw s;
21
+ }
22
+ if (!_.has(0)(s)) {
23
+ throw s;
24
+ }
25
+ if (_.has(1)(s)) {
26
+ throw s;
27
+ }
28
+ if (_.has(15)(s)) {
29
+ throw s;
30
+ }
31
+ },
32
+ () => {
33
+ const s = _.set(15)(_.empty);
34
+ if (s !== 0x8000) {
35
+ throw s;
36
+ }
37
+ if (_.has(0)(s)) {
38
+ throw s;
39
+ }
40
+ if (_.has(1)(s)) {
41
+ throw s;
42
+ }
43
+ if (!_.has(15)(s)) {
44
+ throw s;
45
+ }
46
+ }
47
+ ],
48
+ unset: () => [
49
+ () => {
50
+ const a = _.set(0)(_.empty);
51
+ const result = _.unset(0)(a);
52
+ if (result !== 0) {
53
+ throw result;
54
+ }
55
+ },
56
+ () => {
57
+ const a = _.set(15)(_.empty);
58
+ const result = _.unset(15)(a);
59
+ if (result !== 0) {
60
+ throw result;
61
+ }
62
+ }
63
+ ],
64
+ setRange: () => {
65
+ const result = _.setRange([2, 5])(_.empty);
66
+ if (result !== 60) {
67
+ throw result;
68
+ }
69
+ },
70
+ universe: () => {
71
+ const x = every(map(v => _.has(v)(_.universe))(countdown(16)));
72
+ if (!x) {
73
+ throw x;
74
+ }
75
+ },
76
+ compliment: {
77
+ empty: () => {
78
+ const r = _.complement(_.empty);
79
+ if (r !== _.universe) {
80
+ throw r;
81
+ }
82
+ },
83
+ universe: () => {
84
+ const r = _.complement(_.universe);
85
+ if (r !== _.empty) {
86
+ throw r;
87
+ }
88
+ },
89
+ }
90
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @template T
3
+ * @typedef {T|null} Nullable
4
+ */
5
+ /** @type {<T, R>(f: (value: T) => R) => (value: Nullable<T>) => Nullable<R>} */
6
+ export const map: <T, R>(f: (value: T) => R) => (value: Nullable<T>) => Nullable<R>;
7
+ /** @type {<T, R>(f: (_: T) => R) => (none: () => R) => (_: Nullable<T>) => Nullable<R>} */
8
+ export const match: <T, R>(f: (_: T) => R) => (none: () => R) => (_: Nullable<T>) => Nullable<R>;
9
+ export type Nullable<T> = T | null;
@@ -0,0 +1,9 @@
1
+ // @ts-self-types="./module.f.d.mts"
2
+ /**
3
+ * @template T
4
+ * @typedef {T|null} Nullable
5
+ */
6
+ /** @type {<T, R>(f: (value: T) => R) => (value: Nullable<T>) => Nullable<R>} */
7
+ export const map = f => value => value === null ? null : f(value);
8
+ /** @type {<T, R>(f: (_: T) => R) => (none: () => R) => (_: Nullable<T>) => Nullable<R>} */
9
+ export const match = f => none => value => value === null ? none() : f(value);
@@ -0,0 +1,12 @@
1
+ import * as _ from './module.f.mjs';
2
+ export default () => {
3
+ const optionSq = _.map(v => v * v);
4
+ const sq3 = optionSq(3);
5
+ if (sq3 !== 9) {
6
+ throw sq3;
7
+ }
8
+ const sqNull = optionSq(null);
9
+ if (sqNull !== null) {
10
+ throw sqNull;
11
+ }
12
+ };
@@ -0,0 +1,7 @@
1
+ export const sum: (input: list.List<number>) => number;
2
+ export const min: (input: list.List<number>) => number | null;
3
+ export const max: (input: list.List<number>) => number | null;
4
+ /** @type {(a: number) => (b: number) => compare.Sign} */
5
+ export const cmp: (a: number) => (b: number) => compare.Sign;
6
+ import * as list from '../list/module.f.mjs';
7
+ import * as compare from '../function/compare/module.f.mjs';
@@ -0,0 +1,12 @@
1
+ // @ts-self-types="./module.f.d.mts"
2
+ import * as list from '../list/module.f.mjs';
3
+ const { reduce } = list;
4
+ import * as operator from '../function/operator/module.f.mjs';
5
+ const { addition, min: minOp, max: maxOp } = operator;
6
+ import * as compare from '../function/compare/module.f.mjs';
7
+ const { unsafeCmp } = compare;
8
+ export const sum = reduce(addition)(0);
9
+ export const min = reduce(minOp)(null);
10
+ export const max = reduce(maxOp)(null);
11
+ /** @type {(a: number) => (b: number) => compare.Sign} */
12
+ export const cmp = unsafeCmp;
@@ -0,0 +1,126 @@
1
+ import * as _ from './module.f.mjs';
2
+ const { sum, min, max, cmp } = _;
3
+ export default {
4
+ sum: () => {
5
+ const result = sum([2, 3, 4, 5]);
6
+ if (result !== 14) {
7
+ throw result;
8
+ }
9
+ },
10
+ min: {
11
+ empty: () => {
12
+ const result = min([]);
13
+ if (result !== null) {
14
+ throw result;
15
+ }
16
+ },
17
+ multi: () => {
18
+ const result = min([1, 2, 12, -4, 8]);
19
+ if (result !== -4) {
20
+ throw result;
21
+ }
22
+ }
23
+ },
24
+ max: () => {
25
+ const result = max([1, 2, 12, -4, 8]);
26
+ if (result !== 12) {
27
+ throw result;
28
+ }
29
+ },
30
+ cmp: () => {
31
+ const result = cmp(4)(5);
32
+ if (result !== -1) {
33
+ throw result;
34
+ }
35
+ },
36
+ standard: () => {
37
+ /** @type {(a: bigint) => (a: bigint) => void} */
38
+ const check = a => b => {
39
+ if (BigInt(Number(a)) != b) {
40
+ throw [a, b];
41
+ }
42
+ };
43
+ /** @type {(v: bigint) => void} */
44
+ const eq = v => check(v)(v);
45
+ // 53, 0x35 bits.
46
+ // 3 2 1 0
47
+ // 4_3210_FEDC_BA98_7654_3210_FEDC_BA98_7654_3210_FEDC_BA98_7654_3210
48
+ eq(4503599627370496n);
49
+ eq(4503599627370497n);
50
+ eq(4503599627370498n);
51
+ eq(4503599627370499n);
52
+ eq(4503599627370500n);
53
+ //
54
+ eq(8205552883602248n);
55
+ eq(6023495077481713n);
56
+ eq(7655550916643882n);
57
+ eq(7408615831253283n);
58
+ eq(5372046171422892n);
59
+ //
60
+ eq(9007199254740991n);
61
+ eq(9007199254740990n);
62
+ eq(9007199254740989n);
63
+ eq(9007199254740988n);
64
+ eq(9007199254740987n);
65
+ eq(9007199254740986n);
66
+ eq(9007199254740985n);
67
+ eq(9007199254740984n);
68
+ // 54, 0x35+1 bits.
69
+ // 3 2 1 0
70
+ // 4_3210_FEDC_BA98_7654_3210_FEDC_BA98_7654_3210_FEDC_BA98_7654_3210_1
71
+ check(9007199254740992n)(9007199254740992n);
72
+ check(16585805050637558n)(16585805050637558n);
73
+ check(18014398509481982n)(18014398509481982n);
74
+ // round down
75
+ check(9007199254740993n)(9007199254740992n);
76
+ check(9007199254740997n)(9007199254740996n);
77
+ check(11727370849309157n)(11727370849309156n);
78
+ check(18014398509481981n)(18014398509481980n);
79
+ // round up
80
+ check(9007199254740995n)(9007199254740996n);
81
+ check(15679542343753527n)(15679542343753528n);
82
+ check(18014398509481983n)(18014398509481984n);
83
+ // 55, 0x35+2 bits.
84
+ // 3 2 1 0
85
+ // 4_3210_FEDC_BA98_7654_3210_FEDC_BA98_7654_3210_FEDC_BA98_7654_3210_12
86
+ // 0_xx: down, down, up
87
+ // 0_00
88
+ check(18014398509481984n)(18014398509481984n);
89
+ check(31009640954244032n)(31009640954244032n);
90
+ check(36028797018963960n)(36028797018963960n);
91
+ // 0_01 round down
92
+ check(18014398509481985n)(18014398509481984n);
93
+ check(35865859090492321n)(35865859090492320n);
94
+ check(36028797018963961n)(36028797018963960n);
95
+ // 0_10 round down
96
+ check(18014398509481986n)(18014398509481984n);
97
+ check(20537830900813786n)(20537830900813784n);
98
+ check(36028797018963962n)(36028797018963960n);
99
+ // 0_11 round up
100
+ check(18014398509481987n)(18014398509481988n);
101
+ check(20762549594556867n)(20762549594556868n);
102
+ check(36028797018963963n)(36028797018963964n);
103
+ // 1_xx: down, up, up
104
+ // 1_00
105
+ check(18014398509481988n)(18014398509481988n);
106
+ check(27158415062912468n)(27158415062912468n);
107
+ check(36028797018963963n)(36028797018963964n);
108
+ // 1_01 round down
109
+ check(18014398509481989n)(18014398509481988n);
110
+ check(23136524663958789n)(23136524663958788n);
111
+ check(36028797018963965n)(36028797018963964n);
112
+ // 1_10 round up
113
+ check(18014398509481990n)(18014398509481992n);
114
+ check(35732739218314830n)(35732739218314832n);
115
+ check(36028797018963966n)(36028797018963968n);
116
+ // 1_11 round up
117
+ check(18014398509481991n)(18014398509481992n);
118
+ check(35015291789494295n)(35015291789494296n);
119
+ check(36028797018963967n)(36028797018963968n);
120
+ // 57, 0x35+4 bits.
121
+ // 3 2 1 0
122
+ // 4_3210_FEDC_BA98_7654_3210_FEDC_BA98_7654_3210_FEDC_BA98_7654_3210_1234
123
+ check(104002482718319358n)(104002482718319360n);
124
+ check(142693895881191444n)(142693895881191440n);
125
+ }
126
+ };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @template T
3
+ * @typedef {{
4
+ * readonly [k in string]: T
5
+ * }} Map
6
+ */
7
+ /**
8
+ * @template T
9
+ * @typedef {readonly[string, T]} Entry
10
+ */
11
+ /** @type {(name: string) => <T>(object: Map<T>) => T|null} */
12
+ export const at: (name: string) => <T>(object: Map<T>) => T | null;
13
+ /** @type {<T>(e: list.List<Entry<T>>) => list.List<Entry<T>>} */
14
+ export const sort: <T>(e: list.List<Entry<T>>) => list.List<Entry<T>>;
15
+ /** @type {<T>(e: list.List<Entry<T>>) => Map<T>} */
16
+ export const fromEntries: <T>(e: list.List<Entry<T>>) => Map<T>;
17
+ /** @type {<T>(m: btMap.Map<T>) => Map<T>} */
18
+ export const fromMap: <T>(m: btMap.Map<T>) => Map<T>;
19
+ export type Map<T> = { readonly [k in string]: T; };
20
+ export type Entry<T> = readonly [string, T];
21
+ import * as list from '../list/module.f.mjs';
22
+ import * as btMap from '../map/module.f.mjs';
@@ -0,0 +1,27 @@
1
+ // @ts-self-types="./module.f.d.mts"
2
+ import * as list from '../list/module.f.mjs';
3
+ const { iterable } = list;
4
+ import * as btMap from '../map/module.f.mjs';
5
+ const { entries: mapEntries, fromEntries: mapFromEntries } = btMap;
6
+ const { getOwnPropertyDescriptor, fromEntries: objectFromEntries } = Object;
7
+ /**
8
+ * @template T
9
+ * @typedef {{
10
+ * readonly [k in string]: T
11
+ * }} Map
12
+ */
13
+ /**
14
+ * @template T
15
+ * @typedef {readonly[string, T]} Entry
16
+ */
17
+ /** @type {(name: string) => <T>(object: Map<T>) => T|null} */
18
+ export const at = name => object => {
19
+ const r = getOwnPropertyDescriptor(object, name);
20
+ return r === void 0 ? null : r.value;
21
+ };
22
+ /** @type {<T>(e: list.List<Entry<T>>) => list.List<Entry<T>>} */
23
+ export const sort = e => mapEntries(mapFromEntries(e));
24
+ /** @type {<T>(e: list.List<Entry<T>>) => Map<T>} */
25
+ export const fromEntries = e => objectFromEntries(iterable(e));
26
+ /** @type {<T>(m: btMap.Map<T>) => Map<T>} */
27
+ export const fromMap = m => fromEntries(mapEntries(m));
@@ -0,0 +1,17 @@
1
+ import * as _ from './module.f.mjs';
2
+ export default {
3
+ ctor: () => {
4
+ const a = {};
5
+ const value = _.at('constructor')(a);
6
+ if (value !== null) {
7
+ throw value;
8
+ }
9
+ },
10
+ property: () => {
11
+ const a = { constructor: 42 };
12
+ const value = _.at('constructor')(a);
13
+ if (value !== 42) {
14
+ throw value;
15
+ }
16
+ }
17
+ };
@@ -0,0 +1,6 @@
1
+ /** @typedef {readonly[number,number]} Range */
2
+ /** @type {(range: Range) => (i: number) => boolean} */
3
+ export const contains: (range: Range) => (i: number) => boolean;
4
+ /** @type {(i: number) => Range} */
5
+ export const one: (i: number) => Range;
6
+ export type Range = readonly [number, number];
@@ -0,0 +1,6 @@
1
+ // @ts-self-types="./module.f.d.mts"
2
+ /** @typedef {readonly[number,number]} Range */
3
+ /** @type {(range: Range) => (i: number) => boolean} */
4
+ export const contains = ([b, e]) => i => b <= i && i <= e;
5
+ /** @type {(i: number) => Range} */
6
+ export const one = a => [a, a];
@@ -0,0 +1,18 @@
1
+ import * as _ from './module.f.mjs';
2
+ export default () => {
3
+ if (!_.contains([0, 5])(1)) {
4
+ throw 1;
5
+ }
6
+ if (!_.contains([0, 5])(0)) {
7
+ throw 0;
8
+ }
9
+ if (!_.contains([0, 5])(5)) {
10
+ throw 5;
11
+ }
12
+ if (_.contains([0, 5])(-1)) {
13
+ throw -1;
14
+ }
15
+ if (_.contains([0, 5])(6)) {
16
+ throw 6;
17
+ }
18
+ };
@@ -1,11 +1,11 @@
1
- declare namespace _default {
2
- export { merge };
3
- export { get };
4
- export { fromRange };
5
- }
6
- export default _default;
1
+ /** @type {<T>(op: Operators<T>) => RangeMerge<T>} */
2
+ export const merge: <T>(op: Operators<T>) => RangeMerge<T>;
3
+ /** @type {<T>(def: T) => (value: number) => (rm: RangeMapArray<T>) => T} */
4
+ export const get: <T>(def: T) => (value: number) => (rm: RangeMapArray<T>) => T;
5
+ /** @type {<T>(def: T) => (r: Range.Range) => (value: T) => RangeMapArray<T>} */
6
+ export const fromRange: <T>(def: T) => (r: Range.Range) => (value: T) => RangeMapArray<T>;
7
7
  export type Entry<T> = [T, number];
8
- export type RangeMap<T> = SortedList.SortedList<Entry<T>>;
8
+ export type RangeMap<T> = sortedList.SortedList<Entry<T>>;
9
9
  export type RangeMapArray<T> = readonly Entry<T>[];
10
10
  export type Operators<T> = {
11
11
  readonly union: O.Reduce<T>;
@@ -13,13 +13,7 @@ export type Operators<T> = {
13
13
  };
14
14
  export type RangeState<T> = Option.Nullable<Entry<T>>;
15
15
  export type RangeMerge<T> = O.Reduce<RangeMap<T>>;
16
- /** @type {<T>(op: Operators<T>) => RangeMerge<T>} */
17
- declare const merge: <T>(op: Operators<T>) => RangeMerge<T>;
18
- /** @type {<T>(def: T) => (value: number) => (rm: RangeMapArray<T>) => T} */
19
- declare const get: <T>(def: T) => (value: number) => (rm: RangeMapArray<T>) => T;
20
- /** @type {<T>(def: T) => (r: Range.Range) => (value: T) => RangeMapArray<T>} */
21
- declare const fromRange: <T>(def: T) => (r: Range.Range) => (value: T) => RangeMapArray<T>;
22
- import * as SortedList from '../sorted_list/module.f.mjs';
16
+ import * as Range from '../range/module.f.mjs';
17
+ import * as sortedList from '../sorted_list/module.f.mjs';
23
18
  import * as O from '../function/operator/module.f.mjs';
24
19
  import * as Option from '../nullable/module.f.mjs';
25
- import * as Range from '../range/module.f.mjs';