functionalscript 0.13.1 → 0.14.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 (361) 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/{ci → fs/ci}/module.f.d.ts +1 -1
  22. package/fs/ci/module.f.js +43 -0
  23. package/fs/ci/node/module.f.d.ts +6 -0
  24. package/fs/ci/node/module.f.js +36 -0
  25. package/fs/ci/playwright/module.f.d.ts +2 -0
  26. package/fs/ci/playwright/module.f.js +23 -0
  27. package/fs/ci/rust/module.f.d.ts +2 -0
  28. package/fs/ci/rust/module.f.js +49 -0
  29. package/{dev/tf → fs/ci}/test.f.d.ts +2 -1
  30. package/fs/ci/test.f.js +40 -0
  31. package/{crypto → fs/crypto}/secp/module.f.d.ts +1 -2
  32. package/{dev → fs/dev}/module.f.d.ts +2 -0
  33. package/{dev → fs/dev}/module.f.js +5 -0
  34. package/{dev → fs/dev}/tf/all.test.js +7 -5
  35. package/{dev → fs/dev}/tf/module.f.d.ts +1 -1
  36. package/{dev → fs/dev}/tf/module.f.js +12 -9
  37. package/fs/dev/tf/test.f.d.ts +16 -0
  38. package/fs/dev/tf/test.f.js +22 -0
  39. package/fs/dev/version/module.f.d.ts +3 -0
  40. package/{djs → fs/djs}/tokenizer/module.f.js +3 -3
  41. package/{djs/parser-new → fs/djs/tokenizer-new}/test.f.d.ts +2 -1
  42. package/fs/djs/tokenizer-new/test.f.js +894 -0
  43. package/{js → fs/js}/tokenizer/module.f.js +34 -34
  44. package/{json → fs/json}/tokenizer/module.f.js +1 -1
  45. package/{path → fs/path}/module.f.d.ts +1 -1
  46. package/fs/sul/id/module.f.d.ts +33 -0
  47. package/fs/sul/id/module.f.js +94 -0
  48. package/fs/sul/id/test.f.d.ts +21 -0
  49. package/fs/sul/id/test.f.js +75 -0
  50. package/fs/sul/level/hash/module.f.d.ts +38 -0
  51. package/fs/sul/level/hash/module.f.js +43 -0
  52. package/fs/sul/level/hash/test.f.d.ts +14 -0
  53. package/fs/sul/level/hash/test.f.js +112 -0
  54. package/fs/sul/level/literal/module.f.d.ts +64 -0
  55. package/fs/sul/level/literal/module.f.js +88 -0
  56. package/fs/sul/level/literal/test.f.d.ts +12 -0
  57. package/fs/sul/level/literal/test.f.js +722 -0
  58. package/fs/sul/module.f.d.ts +23 -0
  59. package/fs/sul/module.f.js +46 -0
  60. package/fs/sul/test.f.d.ts +10 -0
  61. package/fs/sul/test.f.js +47 -0
  62. package/{text → fs/text}/module.f.d.ts +1 -1
  63. package/{text → fs/text}/utf16/module.f.js +8 -8
  64. package/{text → fs/text}/utf8/module.f.js +2 -2
  65. package/{types → fs/types}/bit_vec/module.f.d.ts +13 -1
  66. package/{types → fs/types}/bit_vec/module.f.js +33 -15
  67. package/{types → fs/types}/effects/module.f.d.ts +1 -0
  68. package/{types → fs/types}/effects/node/virtual/module.f.d.ts +3 -3
  69. package/{types → fs/types}/function/operator/module.f.d.ts +1 -1
  70. package/{types → fs/types}/function/operator/module.f.js +1 -1
  71. package/{types → fs/types}/list/module.f.js +1 -1
  72. package/fs/types/patricia_trie/module.f.d.ts +25 -0
  73. package/fs/types/patricia_trie/module.f.js +35 -0
  74. package/fs/types/patricia_trie/test.f.d.ts +8 -0
  75. package/fs/types/patricia_trie/test.f.js +121 -0
  76. package/{types → fs/types}/rtti/module.f.d.ts +12 -1
  77. package/fs/types/rtti/module.f.js +100 -0
  78. package/fs/types/rtti/parse/module.f.d.ts +32 -0
  79. package/fs/types/rtti/parse/module.f.js +113 -0
  80. package/fs/types/rtti/parse/test.f.d.ts +116 -0
  81. package/fs/types/rtti/parse/test.f.js +345 -0
  82. package/fs/types/rtti/test.f.d.ts +34 -0
  83. package/fs/types/rtti/test.f.js +123 -0
  84. package/fs/types/rtti/validate/module.f.d.ts +80 -0
  85. package/{types → fs/types}/rtti/validate/module.f.js +33 -25
  86. package/{types → fs/types}/rtti/validate/test.f.d.ts +23 -0
  87. package/{types → fs/types}/rtti/validate/test.f.js +67 -0
  88. package/{types → fs/types}/uint8array/module.f.d.ts +2 -2
  89. package/package.json +8 -8
  90. package/ci/module.f.js +0 -183
  91. package/dev/tf/test.f.js +0 -5
  92. package/dev/version/module.f.d.ts +0 -3
  93. package/djs/parser-new/test.f.js +0 -202
  94. package/types/rtti/module.f.js +0 -27
  95. package/types/rtti/test.f.d.ts +0 -6
  96. package/types/rtti/test.f.js +0 -22
  97. package/types/rtti/validate/module.f.d.ts +0 -50
  98. /package/{types → fs}/asn.1/test.f.d.ts +0 -0
  99. /package/{cas → fs/base128}/test.f.d.ts +0 -0
  100. /package/{bnf → fs/bnf}/data/module.f.js +0 -0
  101. /package/{bnf → fs/bnf}/data/test.f.d.ts +0 -0
  102. /package/{bnf → fs/bnf}/data/test.f.js +0 -0
  103. /package/{bnf → fs/bnf}/module.f.d.ts +0 -0
  104. /package/{bnf → fs/bnf}/module.f.js +0 -0
  105. /package/{bnf → fs/bnf}/test.f.d.ts +0 -0
  106. /package/{bnf → fs/bnf}/test.f.js +0 -0
  107. /package/{bnf → fs/bnf}/testlib.f.d.ts +0 -0
  108. /package/{bnf → fs/bnf}/testlib.f.js +0 -0
  109. /package/{types/base128 → fs/cas}/test.f.d.ts +0 -0
  110. /package/{cas → fs/cas}/test.f.js +0 -0
  111. /package/{types → fs}/cbase32/test.f.d.ts +0 -0
  112. /package/{crypto → fs/crypto}/hmac/module.f.d.ts +0 -0
  113. /package/{crypto → fs/crypto}/hmac/module.f.js +0 -0
  114. /package/{crypto → fs/crypto}/hmac/test.f.d.ts +0 -0
  115. /package/{crypto → fs/crypto}/hmac/test.f.js +0 -0
  116. /package/{crypto → fs/crypto}/secp/module.f.js +0 -0
  117. /package/{crypto → fs/crypto}/secp/test.f.d.ts +0 -0
  118. /package/{crypto → fs/crypto}/secp/test.f.js +0 -0
  119. /package/{crypto → fs/crypto}/sha2/module.f.d.ts +0 -0
  120. /package/{crypto → fs/crypto}/sha2/module.f.js +0 -0
  121. /package/{crypto → fs/crypto}/sha2/test.f.d.ts +0 -0
  122. /package/{crypto → fs/crypto}/sha2/test.f.js +0 -0
  123. /package/{crypto → fs/crypto}/sign/module.f.d.ts +0 -0
  124. /package/{crypto → fs/crypto}/sign/module.f.js +0 -0
  125. /package/{crypto → fs/crypto}/sign/test.f.d.ts +0 -0
  126. /package/{crypto → fs/crypto}/sign/test.f.js +0 -0
  127. /package/{dev → fs/dev}/index/module.f.d.ts +0 -0
  128. /package/{dev → fs/dev}/index/module.f.js +0 -0
  129. /package/{dev → fs/dev}/test.f.d.ts +0 -0
  130. /package/{dev → fs/dev}/test.f.js +0 -0
  131. /package/{dev → fs/dev}/tf/all.test.d.ts +0 -0
  132. /package/{dev → fs/dev}/version/module.f.js +0 -0
  133. /package/{dev → fs/dev}/version/test.f.d.ts +0 -0
  134. /package/{dev → fs/dev}/version/test.f.js +0 -0
  135. /package/{djs → fs/djs}/ast/module.f.d.ts +0 -0
  136. /package/{djs → fs/djs}/ast/module.f.js +0 -0
  137. /package/{djs → fs/djs}/ast/test.f.d.ts +0 -0
  138. /package/{djs → fs/djs}/ast/test.f.js +0 -0
  139. /package/{djs → fs/djs}/examples/input.f.d.ts +0 -0
  140. /package/{djs → fs/djs}/examples/input.f.js +0 -0
  141. /package/{djs → fs/djs}/examples/m.f.d.ts +0 -0
  142. /package/{djs → fs/djs}/examples/m.f.js +0 -0
  143. /package/{djs → fs/djs}/module.f.d.ts +0 -0
  144. /package/{djs → fs/djs}/module.f.js +0 -0
  145. /package/{djs → fs/djs}/parser/module.f.d.ts +0 -0
  146. /package/{djs → fs/djs}/parser/module.f.js +0 -0
  147. /package/{djs → fs/djs}/parser/test.f.d.ts +0 -0
  148. /package/{djs → fs/djs}/parser/test.f.js +0 -0
  149. /package/{djs → fs/djs}/serializer/module.f.d.ts +0 -0
  150. /package/{djs → fs/djs}/serializer/module.f.js +0 -0
  151. /package/{djs → fs/djs}/serializer/test.f.d.ts +0 -0
  152. /package/{djs → fs/djs}/serializer/test.f.js +0 -0
  153. /package/{djs → fs/djs}/tokenizer/module.f.d.ts +0 -0
  154. /package/{djs → fs/djs}/tokenizer/test.f.d.ts +0 -0
  155. /package/{djs → fs/djs}/tokenizer/test.f.js +0 -0
  156. /package/{djs/parser-new → fs/djs/tokenizer-new}/module.f.d.ts +0 -0
  157. /package/{djs/parser-new → fs/djs/tokenizer-new}/module.f.js +0 -0
  158. /package/{djs → fs/djs}/transpiler/module.f.d.ts +0 -0
  159. /package/{djs → fs/djs}/transpiler/module.f.js +0 -0
  160. /package/{djs → fs/djs}/transpiler/test.f.d.ts +0 -0
  161. /package/{djs → fs/djs}/transpiler/test.f.js +0 -0
  162. /package/{fjs → fs/fjs}/module.d.ts +0 -0
  163. /package/{fjs → fs/fjs}/module.f.d.ts +0 -0
  164. /package/{fjs → fs/fjs}/module.f.js +0 -0
  165. /package/{fjs → fs/fjs}/module.js +0 -0
  166. /package/{fsc → fs/fsc}/bnf.f.d.ts +0 -0
  167. /package/{fsc → fs/fsc}/bnf.f.js +0 -0
  168. /package/{fsc → fs/fsc}/json.f.d.ts +0 -0
  169. /package/{fsc → fs/fsc}/json.f.js +0 -0
  170. /package/{fsc → fs/fsc}/module.f.d.ts +0 -0
  171. /package/{fsc → fs/fsc}/module.f.js +0 -0
  172. /package/{fsc → fs/fsc}/test.f.d.ts +0 -0
  173. /package/{fsc → fs/fsc}/test.f.js +0 -0
  174. /package/{fsm → fs/fsm}/module.f.d.ts +0 -0
  175. /package/{fsm → fs/fsm}/module.f.js +0 -0
  176. /package/{fsm → fs/fsm}/test.f.d.ts +0 -0
  177. /package/{fsm → fs/fsm}/test.f.js +0 -0
  178. /package/{html → fs/html}/module.f.d.ts +0 -0
  179. /package/{html → fs/html}/module.f.js +0 -0
  180. /package/{html → fs/html}/test.f.d.ts +0 -0
  181. /package/{html → fs/html}/test.f.js +0 -0
  182. /package/{io → fs/io}/module.d.ts +0 -0
  183. /package/{io → fs/io}/module.f.d.ts +0 -0
  184. /package/{io → fs/io}/module.f.js +0 -0
  185. /package/{io → fs/io}/module.js +0 -0
  186. /package/{io → fs/io}/virtual/module.f.d.ts +0 -0
  187. /package/{io → fs/io}/virtual/module.f.js +0 -0
  188. /package/{js → fs/js}/tokenizer/module.f.d.ts +0 -0
  189. /package/{js → fs/js}/tokenizer/test.f.d.ts +0 -0
  190. /package/{js → fs/js}/tokenizer/test.f.js +0 -0
  191. /package/{json → fs/json}/module.f.d.ts +0 -0
  192. /package/{json → fs/json}/module.f.js +0 -0
  193. /package/{json → fs/json}/parser/module.f.d.ts +0 -0
  194. /package/{json → fs/json}/parser/module.f.js +0 -0
  195. /package/{json → fs/json}/parser/test.f.d.ts +0 -0
  196. /package/{json → fs/json}/parser/test.f.js +0 -0
  197. /package/{json → fs/json}/serializer/module.f.d.ts +0 -0
  198. /package/{json → fs/json}/serializer/module.f.js +0 -0
  199. /package/{json → fs/json}/serializer/test.f.d.ts +0 -0
  200. /package/{json → fs/json}/serializer/test.f.js +0 -0
  201. /package/{json → fs/json}/test.f.d.ts +0 -0
  202. /package/{json → fs/json}/test.f.js +0 -0
  203. /package/{json → fs/json}/tokenizer/module.f.d.ts +0 -0
  204. /package/{json → fs/json}/tokenizer/test.f.d.ts +0 -0
  205. /package/{json → fs/json}/tokenizer/test.f.js +0 -0
  206. /package/{path → fs/path}/module.f.js +0 -0
  207. /package/{path → fs/path}/test.f.d.ts +0 -0
  208. /package/{path → fs/path}/test.f.js +0 -0
  209. /package/{text → fs/text}/ascii/module.f.d.ts +0 -0
  210. /package/{text → fs/text}/ascii/module.f.js +0 -0
  211. /package/{text → fs/text}/ascii/test.f.d.ts +0 -0
  212. /package/{text → fs/text}/ascii/test.f.js +0 -0
  213. /package/{text → fs/text}/module.f.js +0 -0
  214. /package/{text → fs/text}/sgr/module.f.d.ts +0 -0
  215. /package/{text → fs/text}/sgr/module.f.js +0 -0
  216. /package/{text → fs/text}/sgr/test.f.d.ts +0 -0
  217. /package/{text → fs/text}/sgr/test.f.js +0 -0
  218. /package/{text → fs/text}/test.f.d.ts +0 -0
  219. /package/{text → fs/text}/test.f.js +0 -0
  220. /package/{text → fs/text}/utf16/module.f.d.ts +0 -0
  221. /package/{text → fs/text}/utf16/test.f.d.ts +0 -0
  222. /package/{text → fs/text}/utf16/test.f.js +0 -0
  223. /package/{text → fs/text}/utf8/module.f.d.ts +0 -0
  224. /package/{text → fs/text}/utf8/test.f.d.ts +0 -0
  225. /package/{text → fs/text}/utf8/test.f.js +0 -0
  226. /package/{types → fs/types}/array/module.f.d.ts +0 -0
  227. /package/{types → fs/types}/array/module.f.js +0 -0
  228. /package/{types → fs/types}/array/test.f.d.ts +0 -0
  229. /package/{types → fs/types}/array/test.f.js +0 -0
  230. /package/{types → fs/types}/bigfloat/module.f.d.ts +0 -0
  231. /package/{types → fs/types}/bigfloat/module.f.js +0 -0
  232. /package/{types → fs/types}/bigfloat/test.f.d.ts +0 -0
  233. /package/{types → fs/types}/bigfloat/test.f.js +0 -0
  234. /package/{types → fs/types}/bigint/module.f.d.ts +0 -0
  235. /package/{types → fs/types}/bigint/module.f.js +0 -0
  236. /package/{types → fs/types}/bigint/test.f.d.ts +0 -0
  237. /package/{types → fs/types}/bigint/test.f.js +0 -0
  238. /package/{types → fs/types}/bit_vec/test.f.d.ts +0 -0
  239. /package/{types → fs/types}/bit_vec/test.f.js +0 -0
  240. /package/{types → fs/types}/btree/find/module.f.d.ts +0 -0
  241. /package/{types → fs/types}/btree/find/module.f.js +0 -0
  242. /package/{types → fs/types}/btree/find/test.f.d.ts +0 -0
  243. /package/{types → fs/types}/btree/find/test.f.js +0 -0
  244. /package/{types → fs/types}/btree/module.f.d.ts +0 -0
  245. /package/{types → fs/types}/btree/module.f.js +0 -0
  246. /package/{types → fs/types}/btree/remove/module.f.d.ts +0 -0
  247. /package/{types → fs/types}/btree/remove/module.f.js +0 -0
  248. /package/{types → fs/types}/btree/remove/test.f.d.ts +0 -0
  249. /package/{types → fs/types}/btree/remove/test.f.js +0 -0
  250. /package/{types → fs/types}/btree/set/module.f.d.ts +0 -0
  251. /package/{types → fs/types}/btree/set/module.f.js +0 -0
  252. /package/{types → fs/types}/btree/set/test.f.d.ts +0 -0
  253. /package/{types → fs/types}/btree/set/test.f.js +0 -0
  254. /package/{types → fs/types}/btree/test.f.d.ts +0 -0
  255. /package/{types → fs/types}/btree/test.f.js +0 -0
  256. /package/{types → fs/types}/btree/types/module.f.d.ts +0 -0
  257. /package/{types → fs/types}/btree/types/module.f.js +0 -0
  258. /package/{types → fs/types}/byte_set/module.f.d.ts +0 -0
  259. /package/{types → fs/types}/byte_set/module.f.js +0 -0
  260. /package/{types → fs/types}/byte_set/test.f.d.ts +0 -0
  261. /package/{types → fs/types}/byte_set/test.f.js +0 -0
  262. /package/{types → fs/types}/effects/mock/module.f.d.ts +0 -0
  263. /package/{types → fs/types}/effects/mock/module.f.js +0 -0
  264. /package/{types → fs/types}/effects/module.d.ts +0 -0
  265. /package/{types → fs/types}/effects/module.f.js +0 -0
  266. /package/{types → fs/types}/effects/module.js +0 -0
  267. /package/{types → fs/types}/effects/node/module.f.d.ts +0 -0
  268. /package/{types → fs/types}/effects/node/module.f.js +0 -0
  269. /package/{types → fs/types}/effects/node/test.f.d.ts +0 -0
  270. /package/{types → fs/types}/effects/node/test.f.js +0 -0
  271. /package/{types → fs/types}/effects/node/virtual/module.f.js +0 -0
  272. /package/{types → fs/types}/function/compare/module.f.d.ts +0 -0
  273. /package/{types → fs/types}/function/compare/module.f.js +0 -0
  274. /package/{types → fs/types}/function/compare/test.f.d.ts +0 -0
  275. /package/{types → fs/types}/function/compare/test.f.js +0 -0
  276. /package/{types → fs/types}/function/module.f.d.ts +0 -0
  277. /package/{types → fs/types}/function/module.f.js +0 -0
  278. /package/{types → fs/types}/function/test.f.d.ts +0 -0
  279. /package/{types → fs/types}/function/test.f.js +0 -0
  280. /package/{types → fs/types}/list/module.f.d.ts +0 -0
  281. /package/{types → fs/types}/list/test.f.d.ts +0 -0
  282. /package/{types → fs/types}/list/test.f.js +0 -0
  283. /package/{types → fs/types}/map/module.f.d.ts +0 -0
  284. /package/{types → fs/types}/map/module.f.js +0 -0
  285. /package/{types → fs/types}/map/test.f.d.ts +0 -0
  286. /package/{types → fs/types}/map/test.f.js +0 -0
  287. /package/{types → fs/types}/monoid/module.f.d.ts +0 -0
  288. /package/{types → fs/types}/monoid/module.f.js +0 -0
  289. /package/{types → fs/types}/monoid/test.f.d.ts +0 -0
  290. /package/{types → fs/types}/monoid/test.f.js +0 -0
  291. /package/{types → fs/types}/nibble_set/module.f.d.ts +0 -0
  292. /package/{types → fs/types}/nibble_set/module.f.js +0 -0
  293. /package/{types → fs/types}/nibble_set/test.f.d.ts +0 -0
  294. /package/{types → fs/types}/nibble_set/test.f.js +0 -0
  295. /package/{types → fs/types}/nominal/module.f.d.ts +0 -0
  296. /package/{types → fs/types}/nominal/module.f.js +0 -0
  297. /package/{types → fs/types}/nominal/test.f.d.ts +0 -0
  298. /package/{types → fs/types}/nominal/test.f.js +0 -0
  299. /package/{types → fs/types}/nullable/module.f.d.ts +0 -0
  300. /package/{types → fs/types}/nullable/module.f.js +0 -0
  301. /package/{types → fs/types}/nullable/test.f.d.ts +0 -0
  302. /package/{types → fs/types}/nullable/test.f.js +0 -0
  303. /package/{types → fs/types}/number/module.f.d.ts +0 -0
  304. /package/{types → fs/types}/number/module.f.js +0 -0
  305. /package/{types → fs/types}/number/test.f.d.ts +0 -0
  306. /package/{types → fs/types}/number/test.f.js +0 -0
  307. /package/{types → fs/types}/object/module.f.d.ts +0 -0
  308. /package/{types → fs/types}/object/module.f.js +0 -0
  309. /package/{types → fs/types}/object/test.f.d.ts +0 -0
  310. /package/{types → fs/types}/object/test.f.js +0 -0
  311. /package/{types → fs/types}/option/module.f.d.ts +0 -0
  312. /package/{types → fs/types}/option/module.f.js +0 -0
  313. /package/{types → fs/types}/ordered_map/module.f.d.ts +0 -0
  314. /package/{types → fs/types}/ordered_map/module.f.js +0 -0
  315. /package/{types → fs/types}/ordered_map/test.f.d.ts +0 -0
  316. /package/{types → fs/types}/ordered_map/test.f.js +0 -0
  317. /package/{types → fs/types}/prime_field/module.f.d.ts +0 -0
  318. /package/{types → fs/types}/prime_field/module.f.js +0 -0
  319. /package/{types → fs/types}/prime_field/test.f.d.ts +0 -0
  320. /package/{types → fs/types}/prime_field/test.f.js +0 -0
  321. /package/{types → fs/types}/range/module.f.d.ts +0 -0
  322. /package/{types → fs/types}/range/module.f.js +0 -0
  323. /package/{types → fs/types}/range/test.f.d.ts +0 -0
  324. /package/{types → fs/types}/range/test.f.js +0 -0
  325. /package/{types → fs/types}/range_map/module.f.d.ts +0 -0
  326. /package/{types → fs/types}/range_map/module.f.js +0 -0
  327. /package/{types → fs/types}/range_map/test.f.d.ts +0 -0
  328. /package/{types → fs/types}/range_map/test.f.js +0 -0
  329. /package/{types → fs/types}/result/module.d.ts +0 -0
  330. /package/{types → fs/types}/result/module.f.d.ts +0 -0
  331. /package/{types → fs/types}/result/module.f.js +0 -0
  332. /package/{types → fs/types}/result/module.js +0 -0
  333. /package/{types → fs/types}/result/test.f.d.ts +0 -0
  334. /package/{types → fs/types}/result/test.f.js +0 -0
  335. /package/{types → fs/types}/rtti/ts/module.f.d.ts +0 -0
  336. /package/{types → fs/types}/rtti/ts/module.f.js +0 -0
  337. /package/{types → fs/types}/rtti/ts/test.f.d.ts +0 -0
  338. /package/{types → fs/types}/rtti/ts/test.f.js +0 -0
  339. /package/{types → fs/types}/sorted_list/module.f.d.ts +0 -0
  340. /package/{types → fs/types}/sorted_list/module.f.js +0 -0
  341. /package/{types → fs/types}/sorted_list/test.f.d.ts +0 -0
  342. /package/{types → fs/types}/sorted_list/test.f.js +0 -0
  343. /package/{types → fs/types}/sorted_set/module.f.d.ts +0 -0
  344. /package/{types → fs/types}/sorted_set/module.f.js +0 -0
  345. /package/{types → fs/types}/sorted_set/test.f.d.ts +0 -0
  346. /package/{types → fs/types}/sorted_set/test.f.js +0 -0
  347. /package/{types → fs/types}/string/module.f.d.ts +0 -0
  348. /package/{types → fs/types}/string/module.f.js +0 -0
  349. /package/{types → fs/types}/string/test.f.d.ts +0 -0
  350. /package/{types → fs/types}/string/test.f.js +0 -0
  351. /package/{types → fs/types}/string_set/module.f.d.ts +0 -0
  352. /package/{types → fs/types}/string_set/module.f.js +0 -0
  353. /package/{types → fs/types}/string_set/test.f.d.ts +0 -0
  354. /package/{types → fs/types}/string_set/test.f.js +0 -0
  355. /package/{types → fs/types}/ts/module.f.d.ts +0 -0
  356. /package/{types → fs/types}/ts/module.f.js +0 -0
  357. /package/{types → fs/types}/uint8array/module.f.js +0 -0
  358. /package/{types → fs/types}/uint8array/test.f.d.ts +0 -0
  359. /package/{types → fs/types}/uint8array/test.f.js +0 -0
  360. /package/{website → fs/website}/module.f.d.ts +0 -0
  361. /package/{website → fs/website}/module.f.js +0 -0
@@ -0,0 +1,345 @@
1
+ import { parse } from "./module.f.js";
2
+ import { boolean, number, string, bigint, unknown, array, record, or, option } from "../module.f.js";
3
+ const assertOk = ([k]) => { if (k !== 'ok') {
4
+ throw 'expected ok';
5
+ } };
6
+ const assertError = ([k]) => { if (k !== 'error') {
7
+ throw 'expected error';
8
+ } };
9
+ const unwrap = (r) => {
10
+ if (r[0] !== 'ok') {
11
+ throw 'expected ok';
12
+ }
13
+ return r[1];
14
+ };
15
+ const assertErrorPath = (expected) => (r) => {
16
+ if (r[0] !== 'error') {
17
+ throw 'expected error';
18
+ }
19
+ const e = r[1];
20
+ if (e.path.length !== expected.length) {
21
+ throw `path length ${e.path.length} != ${expected.length}`;
22
+ }
23
+ for (let i = 0; i < expected.length; i++) {
24
+ if (e.path[i] !== expected[i]) {
25
+ throw `path[${i}] ${e.path[i]} != ${expected[i]}`;
26
+ }
27
+ }
28
+ };
29
+ const assertDeepEqual = (a, b) => {
30
+ if (a === b) {
31
+ return;
32
+ }
33
+ if (a instanceof Array && b instanceof Array) {
34
+ if (a.length !== b.length) {
35
+ throw `array length ${a.length} != ${b.length}`;
36
+ }
37
+ for (let i = 0; i < a.length; i++) {
38
+ assertDeepEqual(a[i], b[i]);
39
+ }
40
+ return;
41
+ }
42
+ if (typeof a === 'object' && a !== null && typeof b === 'object' && b !== null) {
43
+ const ka = Object.keys(a).sort();
44
+ const kb = Object.keys(b).sort();
45
+ if (ka.length !== kb.length) {
46
+ throw `key count ${ka.length} != ${kb.length}`;
47
+ }
48
+ for (let i = 0; i < ka.length; i++) {
49
+ if (ka[i] !== kb[i]) {
50
+ throw `key ${ka[i]} != ${kb[i]}`;
51
+ }
52
+ assertDeepEqual(a[ka[i]], b[kb[i]]);
53
+ }
54
+ return;
55
+ }
56
+ throw `not deep-equal: ${String(a)} vs ${String(b)}`;
57
+ };
58
+ export default {
59
+ boolean: {
60
+ ok: () => {
61
+ assertOk(parse(boolean)(true));
62
+ assertOk(parse(boolean)(false));
63
+ },
64
+ error: () => {
65
+ assertError(parse(boolean)(0));
66
+ assertError(parse(boolean)('true'));
67
+ assertError(parse(boolean)(null));
68
+ },
69
+ },
70
+ number: {
71
+ ok: () => {
72
+ assertOk(parse(number)(42));
73
+ },
74
+ error: () => {
75
+ assertError(parse(number)('42'));
76
+ assertError(parse(number)(42n));
77
+ },
78
+ },
79
+ string: {
80
+ ok: () => {
81
+ assertOk(parse(string)('hello'));
82
+ },
83
+ error: () => {
84
+ assertError(parse(string)(42));
85
+ assertError(parse(string)(null));
86
+ },
87
+ },
88
+ bigint: {
89
+ ok: () => {
90
+ assertOk(parse(bigint)(4n));
91
+ },
92
+ error: () => {
93
+ assertError(parse(bigint)(4));
94
+ assertError(parse(bigint)('4'));
95
+ },
96
+ },
97
+ unknown: {
98
+ ok: () => {
99
+ assertOk(parse(unknown)(null));
100
+ assertOk(parse(unknown)(42));
101
+ assertOk(parse(unknown)('hello'));
102
+ assertOk(parse(unknown)(true));
103
+ assertOk(parse(unknown)({}));
104
+ assertOk(parse(unknown)([]));
105
+ },
106
+ },
107
+ const: {
108
+ null: {
109
+ ok: () => assertOk(parse(null)(null)),
110
+ error: () => {
111
+ assertError(parse(null)(undefined));
112
+ assertError(parse(null)(0));
113
+ },
114
+ },
115
+ undefined: {
116
+ ok: () => assertOk(parse(undefined)(undefined)),
117
+ error: () => assertError(parse(undefined)(null)),
118
+ },
119
+ number: {
120
+ ok: () => assertOk(parse(42)(42)),
121
+ error: () => assertError(parse(42)(43)),
122
+ },
123
+ nan: {
124
+ ok: () => assertOk(parse(NaN)(NaN)),
125
+ error: () => {
126
+ assertError(parse(NaN)(0));
127
+ assertError(parse(0)(NaN));
128
+ assertError(parse(42)(NaN));
129
+ },
130
+ },
131
+ infinity: {
132
+ ok: () => {
133
+ assertOk(parse(Infinity)(Infinity));
134
+ assertOk(parse(-Infinity)(-Infinity));
135
+ },
136
+ error: () => {
137
+ assertError(parse(Infinity)(-Infinity));
138
+ assertError(parse(Infinity)(0));
139
+ },
140
+ },
141
+ signedZero: {
142
+ // `Object.is` distinguishes +0 and -0; `===` treats them equal.
143
+ distinct: () => {
144
+ assertError(parse(0)(-0));
145
+ assertError(parse(-0)(0));
146
+ },
147
+ self: () => {
148
+ assertOk(parse(0)(0));
149
+ assertOk(parse(-0)(-0));
150
+ },
151
+ },
152
+ string: {
153
+ ok: () => assertOk(parse('hello')('hello')),
154
+ error: () => assertError(parse('hello')('world')),
155
+ },
156
+ bigint: {
157
+ ok: () => assertOk(parse(7n)(7n)),
158
+ error: () => assertError(parse(7n)(8n)),
159
+ },
160
+ boolean: {
161
+ ok: () => assertOk(parse(true)(true)),
162
+ error: () => assertError(parse(true)(false)),
163
+ },
164
+ tuple: {
165
+ ok: () => {
166
+ const t = [42, 'hello'];
167
+ const r = parse(t)([42, 'hello']);
168
+ assertDeepEqual(unwrap(r), [42, 'hello']);
169
+ },
170
+ // The key behavior change vs `validate`: extra tuple elements are dropped.
171
+ extraItemsDropped: () => {
172
+ const r = parse([42])([42, 'extra']);
173
+ assertDeepEqual(unwrap(r), [42]);
174
+ },
175
+ error: () => {
176
+ assertError(parse([42])([99]));
177
+ assertError(parse([42])({}));
178
+ },
179
+ },
180
+ struct: {
181
+ ok: () => {
182
+ const t = { a: 42, b: 'hello' };
183
+ const r = parse(t)({ a: 42, b: 'hello' });
184
+ assertDeepEqual(unwrap(r), { a: 42, b: 'hello' });
185
+ },
186
+ // Undeclared properties are dropped from the constructed value.
187
+ extraKeysDropped: () => {
188
+ const r = parse({ a: 42 })({ a: 42, b: 'extra' });
189
+ assertDeepEqual(unwrap(r), { a: 42 });
190
+ },
191
+ error: () => {
192
+ assertError(parse({ a: 42 })({ a: 99 }));
193
+ assertError(parse({ a: 42 })([]));
194
+ },
195
+ },
196
+ },
197
+ array: {
198
+ empty: () => {
199
+ const r = parse(array(number))([]);
200
+ assertDeepEqual(unwrap(r), []);
201
+ },
202
+ ok: () => {
203
+ const r = parse(array(number))([1, 2, 3]);
204
+ assertDeepEqual(unwrap(r), [1, 2, 3]);
205
+ },
206
+ // `parse` always constructs a new array, even when the inner type is a primitive.
207
+ freshArray: () => {
208
+ const input = [1, 2, 3];
209
+ const out = unwrap(parse(array(number))(input));
210
+ if (out === input) {
211
+ throw 'expected a fresh array';
212
+ }
213
+ assertDeepEqual(out, [1, 2, 3]);
214
+ },
215
+ error: () => {
216
+ assertError(parse(array(number))([1, 'two', 3]));
217
+ assertError(parse(array(number))({}));
218
+ assertError(parse(array(number))(null));
219
+ },
220
+ nested: () => {
221
+ const r = parse(array(array(boolean)))([[true, false], [false]]);
222
+ assertDeepEqual(unwrap(r), [[true, false], [false]]);
223
+ assertError(parse(array(array(boolean)))([[true, 42]]));
224
+ },
225
+ },
226
+ record: {
227
+ empty: () => {
228
+ const r = parse(record(number))({});
229
+ assertDeepEqual(unwrap(r), {});
230
+ },
231
+ ok: () => {
232
+ const r = parse(record(string))({ a: 'hello', b: 'world' });
233
+ assertDeepEqual(unwrap(r), { a: 'hello', b: 'world' });
234
+ },
235
+ // `parse` always constructs a new record.
236
+ freshRecord: () => {
237
+ const input = { a: 1, b: 2 };
238
+ const out = unwrap(parse(record(number))(input));
239
+ if (out === input) {
240
+ throw 'expected a fresh record';
241
+ }
242
+ assertDeepEqual(out, { a: 1, b: 2 });
243
+ },
244
+ error: () => {
245
+ assertError(parse(record(number))({ a: 1, b: 'two' }));
246
+ assertError(parse(record(number))(null));
247
+ assertError(parse(record(number))([]));
248
+ },
249
+ },
250
+ constThunk: {
251
+ primitive: () => {
252
+ const t = () => ['const', 7n];
253
+ assertOk(parse(t)(7n));
254
+ assertError(parse(t)(8n));
255
+ },
256
+ },
257
+ or: {
258
+ consts: {
259
+ ok: () => {
260
+ const t = or(...[false, 42, 'hello']);
261
+ assertOk(parse(t)(false));
262
+ assertOk(parse(t)(42));
263
+ assertOk(parse(t)('hello'));
264
+ },
265
+ error: () => {
266
+ const t = or(...[false, 42, 'hello']);
267
+ assertError(parse(t)(true));
268
+ assertError(parse(t)(43));
269
+ assertError(parse(t)('world'));
270
+ assertError(parse(t)(null));
271
+ },
272
+ },
273
+ thunks: {
274
+ ok: () => {
275
+ const t = or(number, string);
276
+ assertOk(parse(t)(42));
277
+ assertOk(parse(t)('hello'));
278
+ },
279
+ error: () => {
280
+ const t = or(number, string);
281
+ assertError(parse(t)(true));
282
+ assertError(parse(t)(null));
283
+ },
284
+ },
285
+ // First matching variant wins; the freshly-constructed value comes from that variant.
286
+ firstMatchWins: () => {
287
+ const t = or([number], array(number));
288
+ const out = unwrap(parse(t)([1, 2, 3]));
289
+ // The const tuple `[number]` matches first and returns a length-1 result.
290
+ assertDeepEqual(out, [1]);
291
+ },
292
+ },
293
+ option: {
294
+ ok: () => {
295
+ const t = option(number);
296
+ assertOk(parse(t)(42));
297
+ assertOk(parse(t)(undefined));
298
+ },
299
+ error: () => {
300
+ const t = option(number);
301
+ assertError(parse(t)(null));
302
+ assertError(parse(t)('42'));
303
+ },
304
+ },
305
+ path: {
306
+ rootMismatch: () => assertErrorPath([])(parse(number)('not a number')),
307
+ arrayIndex: () => assertErrorPath(['1'])(parse(array(number))([1, 'two', 3])),
308
+ recordKey: () => {
309
+ const r = parse(record(number))({ a: 1, b: 'two', c: 3 });
310
+ assertErrorPath(['b'])(r);
311
+ },
312
+ nestedArray: () => assertErrorPath(['0', '1'])(parse(array(array(number)))([[1, 'x'], [2, 3]])),
313
+ tupleIndex: () => assertErrorPath(['1'])(parse([number, number])([1, 'two'])),
314
+ structKey: () => assertErrorPath(['b'])(parse({ a: number, b: number })({ a: 1, b: 'two' })),
315
+ deepStruct: () => {
316
+ const schema = { user: { name: string, age: number } };
317
+ const r = parse(schema)({ user: { name: 'A', age: 'old' } });
318
+ assertErrorPath(['user', 'age'])(r);
319
+ },
320
+ recursiveSchema: () => {
321
+ const list = () => ['array', list];
322
+ const r = parse(list)([[[42]]]);
323
+ assertErrorPath(['0', '0', '0'])(r);
324
+ },
325
+ orRoot: () => assertErrorPath([])(parse(or(number, string))(true)),
326
+ },
327
+ recursive: {
328
+ arrayOfArrays: () => {
329
+ const list = () => ['array', list];
330
+ const v = parse(list);
331
+ assertOk(v([]));
332
+ assertOk(v([[], []]));
333
+ assertOk(v([[[], []], []]));
334
+ assertError(v([42]));
335
+ assertError(v(null));
336
+ },
337
+ recordOfRecords: () => {
338
+ const tree = () => ['record', tree];
339
+ const v = parse(tree);
340
+ assertOk(v({}));
341
+ assertOk(v({ a: {}, b: { c: {} } }));
342
+ assertError(v({ a: 42 }));
343
+ },
344
+ },
345
+ };
@@ -0,0 +1,34 @@
1
+ declare const _default: {
2
+ typeof: {
3
+ [k: string]: (() => void)[];
4
+ };
5
+ or: {
6
+ flatten: {
7
+ shallow: () => void;
8
+ deep: () => void;
9
+ manualOrThunk: () => void;
10
+ selfReferential: () => void;
11
+ };
12
+ unknownCollapse: {
13
+ withConst: () => void;
14
+ withThunk: () => void;
15
+ nested: () => void;
16
+ };
17
+ dropPrimitiveSubset: {
18
+ number: () => void;
19
+ boolean: () => void;
20
+ string: () => void;
21
+ bigint: () => void;
22
+ keepIfThunkAbsent: () => void;
23
+ mixed: () => void;
24
+ };
25
+ dedup: {
26
+ sameThunkReference: () => void;
27
+ samePrimitive: () => void;
28
+ nanCollapses: () => void;
29
+ signedZeroDistinct: () => void;
30
+ };
31
+ emptyStillNever: () => void;
32
+ };
33
+ };
34
+ export default _default;
@@ -0,0 +1,123 @@
1
+ import { boolean, number, string, bigint, unknown, or, never } from "./module.f.js";
2
+ import { assertEq } from "../../dev/module.f.js";
3
+ const tests = {
4
+ undefined: [undefined],
5
+ boolean: [true, false],
6
+ string: ['hello'],
7
+ number: [3],
8
+ bigint: [4n],
9
+ object: [null, {}, []],
10
+ function: [() => undefined]
11
+ };
12
+ const variantsOf = (t) => {
13
+ if (typeof t !== 'function') {
14
+ throw 'expected an or thunk';
15
+ }
16
+ const info = t();
17
+ if (info[0] !== 'or') {
18
+ throw `expected an or thunk, got ${info[0]}`;
19
+ }
20
+ return info.slice(1);
21
+ };
22
+ export default {
23
+ typeof: Object.fromEntries(Object.entries(tests).map(([k, a]) => [k, a.map(v => () => {
24
+ if (typeof v !== k) {
25
+ throw `typeof ${v} !== ${k}`;
26
+ }
27
+ })])),
28
+ or: {
29
+ flatten: {
30
+ shallow: () => {
31
+ const v = variantsOf(or(or(boolean, number), string));
32
+ assertEq(v.length, 3);
33
+ assertEq(v[0], boolean);
34
+ assertEq(v[1], number);
35
+ assertEq(v[2], string);
36
+ },
37
+ deep: () => {
38
+ assertEq(variantsOf(or(or(or(boolean, number), string), bigint)).length, 4);
39
+ },
40
+ manualOrThunk: () => {
41
+ // Manually-constructed `() => ['or', ...]` thunks should also flatten.
42
+ const inner = () => ['or', boolean, number];
43
+ assertEq(variantsOf(or(inner, string)).length, 3);
44
+ },
45
+ selfReferential: () => {
46
+ // A self-referential `or` thunk terminates: it is expanded once,
47
+ // then kept as-is on the second encounter (via the visited set).
48
+ const t = (() => ['or', boolean, t]);
49
+ // expansion: t -> [boolean, t]; t (second) kept as-is; number kept.
50
+ assertEq(variantsOf(or(t, number)).length, 3);
51
+ },
52
+ },
53
+ unknownCollapse: {
54
+ withConst: () => {
55
+ const v = variantsOf(or(unknown, 42));
56
+ assertEq(v.length, 1);
57
+ assertEq(v[0], unknown);
58
+ },
59
+ withThunk: () => {
60
+ const v = variantsOf(or(number, unknown, string));
61
+ assertEq(v.length, 1);
62
+ assertEq(v[0], unknown);
63
+ },
64
+ nested: () => {
65
+ // nested `or` whose flattening surfaces an `unknown`
66
+ const v = variantsOf(or(or(boolean, unknown), 42));
67
+ assertEq(v.length, 1);
68
+ assertEq(v[0], unknown);
69
+ },
70
+ },
71
+ dropPrimitiveSubset: {
72
+ number: () => {
73
+ const v = variantsOf(or(42, number));
74
+ assertEq(v.length, 1);
75
+ assertEq(v[0], number);
76
+ },
77
+ boolean: () => {
78
+ const v = variantsOf(or(true, false, boolean));
79
+ assertEq(v.length, 1);
80
+ assertEq(v[0], boolean);
81
+ },
82
+ string: () => {
83
+ const v = variantsOf(or('hi', 'bye', string));
84
+ assertEq(v.length, 1);
85
+ assertEq(v[0], string);
86
+ },
87
+ bigint: () => {
88
+ const v = variantsOf(or(7n, bigint));
89
+ assertEq(v.length, 1);
90
+ assertEq(v[0], bigint);
91
+ },
92
+ keepIfThunkAbsent: () => {
93
+ // Without a matching primitive thunk, consts are kept.
94
+ assertEq(variantsOf(or(42, 'hello')).length, 2);
95
+ },
96
+ mixed: () => {
97
+ // `null`/`undefined` consts have no matching primitive thunk and remain.
98
+ assertEq(variantsOf(or(null, undefined, 42, number)).length, 3);
99
+ },
100
+ },
101
+ dedup: {
102
+ sameThunkReference: () => {
103
+ assertEq(variantsOf(or(boolean, boolean)).length, 1);
104
+ },
105
+ samePrimitive: () => {
106
+ assertEq(variantsOf(or(42, 42)).length, 1);
107
+ },
108
+ nanCollapses: () => {
109
+ // `Object.is(NaN, NaN)` is true, so duplicate `NaN` variants
110
+ // collapse — matching `constPrimitiveValidate` semantics.
111
+ assertEq(variantsOf(or(NaN, NaN)).length, 1);
112
+ },
113
+ signedZeroDistinct: () => {
114
+ // `Object.is(+0, -0)` is false, so they remain distinct.
115
+ assertEq(variantsOf(or(0, -0)).length, 2);
116
+ },
117
+ },
118
+ emptyStillNever: () => {
119
+ assertEq(variantsOf(or()).length, 0);
120
+ assertEq(variantsOf(never).length, 0);
121
+ },
122
+ },
123
+ };
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Runtime validation of unknown values against RTTI schemas.
3
+ *
4
+ * The main entry point is `validate(rtti)`, which takes a schema `Type` and returns
5
+ * a `Validate<T>` function. When called with an unknown value, it returns a `Result`
6
+ * that is either `['ok', typedValue]` or `['error', { path, message }]`.
7
+ *
8
+ * ## Error path
9
+ *
10
+ * On failure, the error carries a `path` pointing at the offending sub-value:
11
+ * each step is the string property name (for structs/records) or the stringified
12
+ * index (for tuples/arrays). The path is empty when the failure is at the root.
13
+ *
14
+ * ## Dispatch strategy
15
+ *
16
+ * - **`Thunk`** schemas are evaluated lazily: the thunk is called once to obtain an
17
+ * `Info` descriptor, then dispatched by tag:
18
+ * - `'const'` — delegates to `constValidate`
19
+ * - `'unknown'` — always succeeds (any DJS value is valid)
20
+ * - `Tag1` (`'array'`, `'record'`) — delegates to `containerValidate`
21
+ * - `Tag0` (`'boolean'`, `'number'`, `'string'`, `'bigint'`) — uses `typeof` check
22
+ * - `'or'` — tries each variant; reports `'no match'` at the current location if all fail
23
+ * - **`Const`** schemas (primitives, tuples, structs) validate by exact equality or
24
+ * recursive field/element checking.
25
+ *
26
+ * ## Recursion safety
27
+ *
28
+ * For `array` and `record` schemas, the inner item validator is instantiated lazily —
29
+ * only after confirming the container is non-empty. This prevents infinite recursion
30
+ * when validating recursive schemas like `const list = () => ['array', list]`.
31
+ *
32
+ * @module
33
+ */
34
+ import type { Unknown } from '../../../djs/module.f.ts';
35
+ import { type Info0, type Primitive0, type Type } from '../module.f.ts';
36
+ import { type Error, type Result as CommonResult } from '../../result/module.f.ts';
37
+ import type { Ts } from '../ts/module.f.ts';
38
+ import type { Primitive } from '../../../djs/module.f.ts';
39
+ /** A path to a sub-value within the validated structure. Each step is an object key or stringified array index. */
40
+ export type Path = readonly string[];
41
+ /** Detailed validation failure: the offending `path` plus a short `message`. */
42
+ export type ValidationError = {
43
+ readonly path: Path;
44
+ readonly message: string;
45
+ };
46
+ /** Validation result: either the typed value or a `ValidationError`. */
47
+ export type Result<T extends Type> = CommonResult<Ts<T>, ValidationError>;
48
+ /** A function that validates an unknown value against schema `T`. */
49
+ export type Validate<T extends Type> = (value: Unknown) => Result<T>;
50
+ /** Builds an error result with empty path and the given message. */
51
+ export declare const verror: (message: string) => Error<ValidationError>;
52
+ /** Prepends `key` to the error's path, used to build the path bottom-up. */
53
+ export declare const prependPath: (key: string, r: Error<ValidationError>) => Error<ValidationError>;
54
+ /** Validates a `Tag0` primitive schema using `typeof`. */
55
+ export declare const primitive0Validate: <K extends Primitive0, T extends Info0<K>>(tag: K) => Validate<T>;
56
+ /**
57
+ * Validates a primitive `Const` schema using `Object.is` (SameValue).
58
+ *
59
+ * `Object.is` is used instead of `===` so that:
60
+ * - `NaN` const schemas match `NaN` values (`===` would always fail because `NaN !== NaN`).
61
+ * - `+0` and `-0` are treated as distinct const values.
62
+ */
63
+ export declare const constPrimitiveValidate: <T extends Primitive>(rtti: T) => Validate<T>;
64
+ /**
65
+ * Creates a validator function for the given RTTI schema.
66
+ *
67
+ * @param rtti - A schema `Type`: a `Thunk` for tag-based schemas, or a `Const`
68
+ * (primitive literal, tuple, or struct) for exact-value schemas.
69
+ * @returns A `Validate<T>` function that checks an unknown value and returns
70
+ * `['ok', value]` or `['error', { path, message }]`.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const v = validate(array(number))
75
+ * v([1, 2, 3]) // ['ok', [1, 2, 3]]
76
+ * v([1, 'two']) // ['error', { path: ['1'], message: 'unexpected value' }]
77
+ * v(['a']) // ['error', { path: ['0'], message: 'unexpected value' }]
78
+ * ```
79
+ */
80
+ export declare const validate: <T extends Type>(rtti: T) => Validate<T>;