functionalscript 0.19.0 → 0.21.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 (256) hide show
  1. package/fs/asn.1/{test.f.d.ts → proof.f.d.ts} +1 -2
  2. package/fs/asn.1/{test.f.js → proof.f.js} +1 -1
  3. package/fs/asserts/module.f.d.ts +4 -0
  4. package/fs/asserts/module.f.js +6 -0
  5. package/fs/base128/proof.f.d.ts +1 -0
  6. package/fs/base128/{test.f.js → proof.f.js} +1 -1
  7. package/fs/bnf/data/{test.f.d.ts → proof.f.d.ts} +1 -2
  8. package/fs/bnf/data/{test.f.js → proof.f.js} +1 -1
  9. package/fs/bnf/proof.f.d.ts +3 -0
  10. package/fs/bnf/{test.f.js → proof.f.js} +1 -1
  11. package/fs/cas/module.f.js +9 -23
  12. package/fs/cas/proof.f.d.ts +4 -0
  13. package/fs/cas/proof.f.js +37 -0
  14. package/fs/cbase32/{test.f.d.ts → proof.f.d.ts} +1 -2
  15. package/fs/cbase32/{test.f.js → proof.f.js} +1 -1
  16. package/fs/ci/bun/module.f.js +2 -7
  17. package/fs/ci/common/module.f.d.ts +2 -1
  18. package/fs/ci/common/module.f.js +7 -9
  19. package/fs/ci/config/module.f.d.ts +12 -3
  20. package/fs/ci/config/module.f.js +24 -4
  21. package/fs/ci/deno/module.f.js +2 -5
  22. package/fs/ci/node/module.f.js +14 -9
  23. package/fs/ci/playwright/module.f.js +5 -8
  24. package/fs/ci/{test.f.d.ts → proof.f.d.ts} +1 -2
  25. package/fs/ci/{test.f.js → proof.f.js} +2 -2
  26. package/fs/ci/rust/module.f.js +3 -9
  27. package/fs/crypto/hmac/{test.f.d.ts → proof.f.d.ts} +1 -2
  28. package/fs/crypto/hmac/{test.f.js → proof.f.js} +1 -1
  29. package/fs/crypto/secp/{test.f.d.ts → proof.f.d.ts} +1 -2
  30. package/fs/crypto/secp/{test.f.js → proof.f.js} +1 -1
  31. package/fs/crypto/sha2/{test.f.d.ts → proof.f.d.ts} +1 -2
  32. package/fs/crypto/sha2/{test.f.js → proof.f.js} +1 -1
  33. package/fs/crypto/sign/{test.f.d.ts → proof.f.d.ts} +1 -2
  34. package/fs/crypto/sign/{test.f.js → proof.f.js} +1 -1
  35. package/fs/dev/module.f.d.ts +28 -5
  36. package/fs/dev/module.f.js +38 -28
  37. package/fs/dev/{test.f.d.ts → proof.f.d.ts} +5 -2
  38. package/fs/dev/{test.f.js → proof.f.js} +26 -2
  39. package/fs/dev/version/proof.f.d.ts +3 -0
  40. package/fs/dev/version/{test.f.js → proof.f.js} +1 -1
  41. package/fs/djs/ast/{test.f.d.ts → proof.f.d.ts} +1 -2
  42. package/fs/djs/ast/{test.f.js → proof.f.js} +1 -1
  43. package/fs/djs/parser/{test.f.d.ts → proof.f.d.ts} +1 -2
  44. package/fs/djs/parser/{test.f.js → proof.f.js} +1 -1
  45. package/fs/djs/{test.f.d.ts → proof.f.d.ts} +1 -2
  46. package/fs/djs/{test.f.js → proof.f.js} +1 -1
  47. package/fs/djs/serializer/module.f.d.ts +2 -2
  48. package/fs/djs/serializer/module.f.js +47 -79
  49. package/fs/djs/serializer/{test.f.d.ts → proof.f.d.ts} +1 -2
  50. package/fs/djs/serializer/{test.f.js → proof.f.js} +8 -8
  51. package/fs/djs/tokenizer/{test.f.d.ts → proof.f.d.ts} +1 -2
  52. package/fs/djs/tokenizer/{test.f.js → proof.f.js} +1 -1
  53. package/fs/djs/tokenizer-new/module.f.js +1 -1
  54. package/fs/djs/tokenizer-new/{test.f.d.ts → proof.f.d.ts} +1 -2
  55. package/fs/djs/tokenizer-new/{test.f.js → proof.f.js} +1 -1
  56. package/fs/djs/transpiler/module.f.d.ts +15 -0
  57. package/fs/djs/transpiler/module.f.js +10 -2
  58. package/fs/djs/transpiler/{test.f.d.ts → proof.f.d.ts} +1 -2
  59. package/fs/djs/transpiler/{test.f.js → proof.f.js} +1 -1
  60. package/fs/{dev/tf → emergent-testing}/module.f.d.ts +66 -8
  61. package/fs/{dev/tf → emergent-testing}/module.f.js +101 -34
  62. package/fs/{dev/tf → emergent-testing}/module.js +2 -2
  63. package/fs/{dev/tf/test.f.d.ts → emergent-testing/proof.f.d.ts} +28 -0
  64. package/fs/{dev/tf/test.f.js → emergent-testing/proof.f.js} +119 -40
  65. package/fs/emergent-testing/scenarios/async-subtests.fail.d.ts +6 -0
  66. package/fs/emergent-testing/scenarios/async-subtests.fail.js +9 -0
  67. package/fs/emergent-testing/scenarios/async-subtests.pass.d.ts +6 -0
  68. package/fs/emergent-testing/scenarios/async-subtests.pass.js +9 -0
  69. package/fs/emergent-testing/scenarios/async.fail.d.ts +3 -0
  70. package/fs/emergent-testing/scenarios/async.fail.js +6 -0
  71. package/fs/emergent-testing/scenarios/async.pass.d.ts +3 -0
  72. package/fs/emergent-testing/scenarios/async.pass.js +5 -0
  73. package/fs/emergent-testing/scenarios/fail.fail.d.ts +3 -0
  74. package/fs/emergent-testing/scenarios/fail.fail.js +3 -0
  75. package/fs/emergent-testing/scenarios/return-value.pass.d.ts +3 -0
  76. package/fs/emergent-testing/scenarios/return-value.pass.js +4 -0
  77. package/fs/emergent-testing/scenarios/thenable.pass.d.ts +5 -0
  78. package/fs/emergent-testing/scenarios/thenable.pass.js +11 -0
  79. package/fs/emergent-testing/scenarios/thenable2.pass.d.ts +5 -0
  80. package/fs/emergent-testing/scenarios/thenable2.pass.js +3 -0
  81. package/fs/emergent-testing/scenarios/throw.pass.d.ts +5 -0
  82. package/fs/{dev/tf/scenarios/throw.pass.f.js → emergent-testing/scenarios/throw.pass.js} +1 -1
  83. package/fs/fjs/module.f.js +4 -5
  84. package/fs/fsc/{test.f.d.ts → proof.f.d.ts} +1 -2
  85. package/fs/fsc/{test.f.js → proof.f.js} +1 -1
  86. package/fs/fsm/proof.f.d.ts +4 -0
  87. package/fs/fsm/{test.f.js → proof.f.js} +1 -1
  88. package/fs/html/{test.f.d.ts → proof.f.d.ts} +1 -2
  89. package/fs/html/{test.f.js → proof.f.js} +1 -1
  90. package/fs/io/module.d.ts +1 -1
  91. package/fs/io/module.f.d.ts +3 -2
  92. package/fs/io/module.f.js +4 -3
  93. package/fs/io/module.js +19 -11
  94. package/fs/js/tokenizer/{test.f.d.ts → proof.f.d.ts} +1 -2
  95. package/fs/js/tokenizer/{test.f.js → proof.f.js} +1 -1
  96. package/fs/json/parser/{test.f.d.ts → proof.f.d.ts} +1 -2
  97. package/fs/json/parser/{test.f.js → proof.f.js} +1 -1
  98. package/fs/json/{test.f.d.ts → proof.f.d.ts} +1 -2
  99. package/fs/json/{test.f.js → proof.f.js} +1 -1
  100. package/fs/json/serializer/{test.f.d.ts → proof.f.d.ts} +1 -2
  101. package/fs/json/serializer/{test.f.js → proof.f.js} +1 -1
  102. package/fs/json/tokenizer/{test.f.d.ts → proof.f.d.ts} +1 -2
  103. package/fs/json/tokenizer/{test.f.js → proof.f.js} +1 -1
  104. package/fs/path/proof.f.d.ts +5 -0
  105. package/fs/path/{test.f.js → proof.f.js} +4 -3
  106. package/fs/sul/id/module.f.js +1 -1
  107. package/fs/sul/id/{test.f.d.ts → proof.f.d.ts} +1 -2
  108. package/fs/sul/id/{test.f.js → proof.f.js} +2 -2
  109. package/fs/sul/level/hash/{test.f.d.ts → proof.f.d.ts} +1 -2
  110. package/fs/sul/level/hash/{test.f.js → proof.f.js} +2 -2
  111. package/fs/sul/level/literal/{test.f.d.ts → proof.f.d.ts} +1 -2
  112. package/fs/sul/level/literal/{test.f.js → proof.f.js} +1 -1
  113. package/fs/sul/{test.f.d.ts → proof.f.d.ts} +1 -2
  114. package/fs/sul/{test.f.js → proof.f.js} +2 -2
  115. package/fs/text/ascii/proof.f.d.ts +3 -0
  116. package/fs/text/ascii/{test.f.js → proof.f.js} +1 -1
  117. package/fs/text/code_point/module.f.d.ts +28 -0
  118. package/fs/text/code_point/module.f.js +31 -0
  119. package/fs/text/{test.f.d.ts → proof.f.d.ts} +1 -2
  120. package/fs/text/{test.f.js → proof.f.js} +1 -1
  121. package/fs/text/sgr/proof.f.d.ts +1 -0
  122. package/fs/text/sgr/{test.f.js → proof.f.js} +1 -1
  123. package/fs/text/utf16/module.f.js +3 -53
  124. package/fs/text/utf16/{test.f.d.ts → proof.f.d.ts} +1 -2
  125. package/fs/text/utf16/{test.f.js → proof.f.js} +1 -1
  126. package/fs/text/utf8/module.f.js +3 -25
  127. package/fs/text/utf8/{test.f.d.ts → proof.f.d.ts} +1 -2
  128. package/fs/text/utf8/{test.f.js → proof.f.js} +1 -1
  129. package/fs/types/array/module.f.js +2 -5
  130. package/fs/types/array/{test.f.d.ts → proof.f.d.ts} +1 -2
  131. package/fs/types/array/{test.f.js → proof.f.js} +1 -1
  132. package/fs/types/bigfloat/{test.f.d.ts → proof.f.d.ts} +1 -2
  133. package/fs/types/bigfloat/{test.f.js → proof.f.js} +1 -1
  134. package/fs/types/bigint/{test.f.d.ts → proof.f.d.ts} +1 -2
  135. package/fs/types/bigint/{test.f.js → proof.f.js} +1 -1
  136. package/fs/types/bit_vec/{test.f.d.ts → proof.f.d.ts} +1 -2
  137. package/fs/types/bit_vec/{test.f.js → proof.f.js} +1 -1
  138. package/fs/types/btree/find/proof.f.d.ts +1 -0
  139. package/fs/types/btree/find/{test.f.js → proof.f.js} +1 -1
  140. package/fs/types/btree/{test.f.d.ts → proof.f.d.ts} +1 -2
  141. package/fs/types/btree/{test.f.js → proof.f.js} +1 -1
  142. package/fs/types/btree/remove/proof.f.d.ts +4 -0
  143. package/fs/types/btree/remove/{test.f.js → proof.f.js} +1 -1
  144. package/fs/types/btree/set/proof.f.d.ts +1 -0
  145. package/fs/types/btree/set/{test.f.js → proof.f.js} +1 -1
  146. package/fs/types/btree/types/module.f.d.ts +8 -0
  147. package/fs/types/btree/types/module.f.js +8 -0
  148. package/fs/types/byte_set/{test.f.d.ts → proof.f.d.ts} +1 -2
  149. package/fs/types/byte_set/{test.f.js → proof.f.js} +1 -1
  150. package/fs/types/effects/module.f.d.ts +17 -0
  151. package/fs/types/effects/module.f.js +17 -0
  152. package/fs/types/effects/node/module.f.d.ts +60 -5
  153. package/fs/types/effects/node/module.f.js +12 -1
  154. package/fs/types/effects/node/{test.f.d.ts → proof.f.d.ts} +1 -2
  155. package/fs/types/effects/node/{test.f.js → proof.f.js} +1 -1
  156. package/fs/types/effects/node/virtual/module.f.js +2 -1
  157. package/fs/types/effects/proof.f.d.ts +11 -0
  158. package/fs/types/effects/proof.f.js +57 -0
  159. package/fs/types/function/compare/proof.f.d.ts +1 -0
  160. package/fs/types/function/compare/{test.f.js → proof.f.js} +1 -1
  161. package/fs/types/function/operator/proof.f.d.ts +12 -0
  162. package/fs/types/function/operator/{test.f.js → proof.f.js} +11 -10
  163. package/fs/types/function/proof.f.d.ts +1 -0
  164. package/fs/types/function/{test.f.js → proof.f.js} +1 -1
  165. package/fs/types/list/{test.f.d.ts → proof.f.d.ts} +2 -2
  166. package/fs/types/list/{test.f.js → proof.f.js} +15 -1
  167. package/fs/types/map/proof.f.d.ts +4 -0
  168. package/fs/types/map/{test.f.js → proof.f.js} +1 -1
  169. package/fs/types/monoid/{test.f.d.ts → proof.f.d.ts} +1 -2
  170. package/fs/types/monoid/{test.f.js → proof.f.js} +1 -1
  171. package/fs/types/nibble_set/{test.f.d.ts → proof.f.d.ts} +1 -2
  172. package/fs/types/nibble_set/{test.f.js → proof.f.js} +1 -1
  173. package/fs/types/nominal/proof.f.d.ts +4 -0
  174. package/fs/types/nominal/{test.f.js → proof.f.js} +1 -1
  175. package/fs/types/nullable/module.f.d.ts +7 -0
  176. package/fs/types/nullable/module.f.js +7 -0
  177. package/fs/types/nullable/proof.f.d.ts +1 -0
  178. package/fs/types/nullable/{test.f.js → proof.f.js} +20 -3
  179. package/fs/types/number/{test.f.d.ts → proof.f.d.ts} +1 -2
  180. package/fs/types/number/{test.f.js → proof.f.js} +1 -1
  181. package/fs/types/object/module.f.js +2 -4
  182. package/fs/types/object/{test.f.d.ts → proof.f.d.ts} +1 -2
  183. package/fs/types/object/{test.f.js → proof.f.js} +1 -1
  184. package/fs/types/ordered_map/{test.f.d.ts → proof.f.d.ts} +1 -2
  185. package/fs/types/ordered_map/{test.f.js → proof.f.js} +1 -1
  186. package/fs/types/patricia_trie/{test.f.d.ts → proof.f.d.ts} +1 -2
  187. package/fs/types/patricia_trie/{test.f.js → proof.f.js} +2 -2
  188. package/fs/types/prime_field/{test.f.d.ts → proof.f.d.ts} +1 -2
  189. package/fs/types/prime_field/{test.f.js → proof.f.js} +1 -1
  190. package/fs/types/range/proof.f.d.ts +1 -0
  191. package/fs/types/range/{test.f.js → proof.f.js} +1 -1
  192. package/fs/types/range_map/{test.f.d.ts → proof.f.d.ts} +1 -2
  193. package/fs/types/range_map/{test.f.js → proof.f.js} +1 -1
  194. package/fs/types/result/proof.f.d.ts +5 -0
  195. package/fs/types/result/{test.f.js → proof.f.js} +18 -2
  196. package/fs/types/rtti/parse/{test.f.d.ts → proof.f.d.ts} +1 -2
  197. package/fs/types/rtti/parse/{test.f.js → proof.f.js} +1 -1
  198. package/fs/types/rtti/{test.f.d.ts → proof.f.d.ts} +1 -2
  199. package/fs/types/rtti/{test.f.js → proof.f.js} +1 -1
  200. package/fs/types/rtti/ts/{test.f.d.ts → proof.f.d.ts} +1 -2
  201. package/fs/types/rtti/ts/{test.f.js → proof.f.js} +1 -1
  202. package/fs/types/rtti/validate/{test.f.d.ts → proof.f.d.ts} +1 -2
  203. package/fs/types/rtti/validate/{test.f.js → proof.f.js} +1 -1
  204. package/fs/types/sorted_list/{test.f.d.ts → proof.f.d.ts} +1 -2
  205. package/fs/types/sorted_list/{test.f.js → proof.f.js} +1 -1
  206. package/fs/types/sorted_set/{test.f.d.ts → proof.f.d.ts} +1 -2
  207. package/fs/types/sorted_set/{test.f.js → proof.f.js} +1 -1
  208. package/fs/types/string/{test.f.d.ts → proof.f.d.ts} +1 -2
  209. package/fs/types/string/{test.f.js → proof.f.js} +1 -1
  210. package/fs/types/string_set/{test.f.d.ts → proof.f.d.ts} +1 -2
  211. package/fs/types/string_set/{test.f.js → proof.f.js} +1 -1
  212. package/fs/types/ts/module.f.d.ts +0 -1
  213. package/fs/types/ts/{test.f.d.ts → proof.f.d.ts} +20 -0
  214. package/fs/types/ts/{test.f.js → proof.f.js} +1 -0
  215. package/fs/types/uint8array/{test.f.d.ts → proof.f.d.ts} +1 -2
  216. package/fs/types/uint8array/{test.f.js → proof.f.js} +1 -1
  217. package/fs/website/proof.f.d.ts +3 -0
  218. package/fs/website/proof.f.js +9 -0
  219. package/issues/demo/sample/{test.f.js → proof.f.js} +1 -1
  220. package/issues/{test.f.d.ts → proof.f.d.ts} +1 -2
  221. package/issues/{test.f.js → proof.f.js} +1 -1
  222. package/nanvm-lib/tests/{test.f.d.ts → proof.f.d.ts} +1 -2
  223. package/nanvm-lib/tests/{test.f.js → proof.f.js} +1 -1
  224. package/nanvm-lib/tests/vm/{test.f.d.ts → proof.f.d.ts} +1 -2
  225. package/nanvm-lib/tests/vm/{test.f.js → proof.f.js} +1 -1
  226. package/package.json +2 -2
  227. package/fs/base128/test.f.d.ts +0 -2
  228. package/fs/bnf/test.f.d.ts +0 -4
  229. package/fs/cas/test.f.d.ts +0 -2
  230. package/fs/cas/test.f.js +0 -1
  231. package/fs/dev/tf/scenarios/fail.fail.f.d.ts +0 -1
  232. package/fs/dev/tf/scenarios/fail.fail.f.js +0 -1
  233. package/fs/dev/tf/scenarios/return-value.pass.f.d.ts +0 -1
  234. package/fs/dev/tf/scenarios/return-value.pass.f.js +0 -2
  235. package/fs/dev/tf/scenarios/throw.pass.f.d.ts +0 -6
  236. package/fs/dev/version/test.f.d.ts +0 -4
  237. package/fs/fsm/test.f.d.ts +0 -5
  238. package/fs/path/test.f.d.ts +0 -3
  239. package/fs/text/ascii/test.f.d.ts +0 -4
  240. package/fs/text/sgr/test.f.d.ts +0 -2
  241. package/fs/types/btree/find/test.f.d.ts +0 -2
  242. package/fs/types/btree/remove/test.f.d.ts +0 -5
  243. package/fs/types/btree/set/test.f.d.ts +0 -2
  244. package/fs/types/function/compare/test.f.d.ts +0 -2
  245. package/fs/types/function/operator/test.f.d.ts +0 -10
  246. package/fs/types/function/test.f.d.ts +0 -2
  247. package/fs/types/map/test.f.d.ts +0 -5
  248. package/fs/types/nominal/test.f.d.ts +0 -5
  249. package/fs/types/nullable/test.f.d.ts +0 -2
  250. package/fs/types/range/test.f.d.ts +0 -2
  251. package/fs/types/result/test.f.d.ts +0 -2
  252. /package/fs/{dev/tf → emergent-testing}/all.test.d.ts +0 -0
  253. /package/fs/{dev/tf → emergent-testing}/all.test.js +0 -0
  254. /package/fs/{dev/tf → emergent-testing}/module.d.ts +0 -0
  255. /package/fs/{dev/tf → emergent-testing}/scenarios/all.d.ts +0 -0
  256. /package/fs/{dev/tf → emergent-testing}/scenarios/all.js +0 -0
@@ -1,5 +1,4 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  valid: (() => void)[];
3
3
  invalid: (() => void)[];
4
4
  };
5
- export default _default;
@@ -6,7 +6,7 @@ import { sort } from "../../types/object/module.f.js";
6
6
  import { stringToList } from "../../text/utf16/module.f.js";
7
7
  const tokenizeString = s => toArray(tokenize(stringToList(s)));
8
8
  const stringify = jsonStringify(sort);
9
- export default {
9
+ export const proof = {
10
10
  valid: [
11
11
  () => {
12
12
  const tokenList = tokenizeString('null');
@@ -1,8 +1,7 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  setProperty: () => void;
3
3
  stringify: {
4
4
  sort: () => void;
5
5
  identity: () => void;
6
6
  }[];
7
7
  };
8
- export default _default;
@@ -1,7 +1,7 @@
1
1
  import { setProperty, stringify } from "./module.f.js";
2
2
  import { sort } from "../types/object/module.f.js";
3
3
  import { identity } from "../types/function/module.f.js";
4
- export default {
4
+ export const proof = {
5
5
  setProperty: () => {
6
6
  if (setProperty("Hello")([])({}) !== "Hello") {
7
7
  throw 'error';
@@ -1,8 +1,7 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  arrayWrap: (() => void)[];
3
3
  objectWrap: (() => void)[];
4
4
  stringSerialize: (() => void)[];
5
5
  numberSerialize: (() => void)[];
6
6
  boolSerialize: (() => void)[];
7
7
  };
8
- export default _default;
@@ -1,7 +1,7 @@
1
1
  import { arrayWrap, boolSerialize, numberSerialize, objectWrap, stringSerialize } from "./module.f.js";
2
2
  import * as list from "../../types/list/module.f.js";
3
3
  const { toArray } = list;
4
- export default {
4
+ export const proof = {
5
5
  arrayWrap: [
6
6
  () => {
7
7
  const result = JSON.stringify(toArray(arrayWrap(null)));
@@ -1,6 +1,5 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  json: (() => void)[];
3
3
  id: (() => void)[];
4
4
  keywords: (() => void)[];
5
5
  };
6
- export default _default;
@@ -5,7 +5,7 @@ import { sort } from "../../types/object/module.f.js";
5
5
  import { stringToList } from "../../text/utf16/module.f.js";
6
6
  const tokenizeString = s => toArray(tokenize(stringToList(s)));
7
7
  const stringify = stringifyAsTree(sort);
8
- export default {
8
+ export const proof = {
9
9
  json: [
10
10
  () => {
11
11
  const result = stringify(tokenizeString(''));
@@ -0,0 +1,5 @@
1
+ export declare const proof: {
2
+ normalizeTest: (() => void)[];
3
+ concatTest: (() => void)[];
4
+ relativizeTest: (() => void)[];
5
+ };
@@ -1,5 +1,5 @@
1
1
  import { concat, normalize, relativize } from "./module.f.js";
2
- export const normalizeTest = [
2
+ const normalizeTest = [
3
3
  () => {
4
4
  const norm = normalize("dir/file.json");
5
5
  if (norm !== "dir/file.json") {
@@ -25,7 +25,7 @@ export const normalizeTest = [
25
25
  }
26
26
  },
27
27
  ];
28
- export const concatTest = [
28
+ const concatTest = [
29
29
  () => {
30
30
  const c = concat("a")("b");
31
31
  if (c !== "a/b") {
@@ -45,7 +45,7 @@ export const concatTest = [
45
45
  }
46
46
  },
47
47
  ];
48
- export const relativizeTest = [
48
+ const relativizeTest = [
49
49
  () => {
50
50
  const r = relativize('/repo', '/repo/fs/a.ts');
51
51
  if (r !== './fs/a.ts') {
@@ -65,3 +65,4 @@ export const relativizeTest = [
65
65
  }
66
66
  },
67
67
  ];
68
+ export const proof = { normalizeTest, concatTest, relativizeTest };
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { toArray } from "../../types/list/module.f.js";
9
9
  import { length, msb, uint, uintChunkList, unpack, vec } from "../../types/bit_vec/module.f.js";
10
- import { assertEq } from "../../dev/module.f.js";
10
+ import { assertEq } from "../../asserts/module.f.js";
11
11
  import { utf8 } from "../../text/module.f.js";
12
12
  import { secp256r1 } from "../../crypto/secp/module.f.js";
13
13
  import { base32 } from "../../crypto/sha2/module.f.js";
@@ -1,4 +1,4 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  inline_00_00: () => void;
3
3
  inline_00_01: () => void;
4
4
  inline_01_00: () => void;
@@ -18,4 +18,3 @@ declare const _default: {
18
18
  hash_merge_b_sensitivity: () => void;
19
19
  hash_merge_shift: () => void;
20
20
  };
21
- export default _default;
@@ -1,4 +1,4 @@
1
- import { assert, assertEq } from "../../dev/module.f.js";
1
+ import { assert, assertEq } from "../../asserts/module.f.js";
2
2
  import { mask } from "../../types/bigint/module.f.js";
3
3
  import { vec } from "../../types/bit_vec/module.f.js";
4
4
  import { compress, hashId, isHash, isRaw, level3Id, rawId } from "./module.f.js";
@@ -15,7 +15,7 @@ const hFE = hashId(mask(0xffn) - 1n);
15
15
  assertEq(asBase(level3Id(0n)), 0n);
16
16
  assertEq(asBase(hashId(0n)), 1n << 0xffn);
17
17
  assertEq(asBase(hFF), mask(0x100n));
18
- export default {
18
+ export const proof = {
19
19
  // Two level-3 literals whose combined bit vectors fit inline (≤ 253 bits)
20
20
  inline_00_00: () => assertEq(compress(level3Id(0x00n), level3Id(0x00n)), rawId(vec(16n)(0x0000n))),
21
21
  inline_00_01: () => assertEq(compress(level3Id(0x00n), level3Id(0x01n)), rawId(vec(16n)(0x0001n))),
@@ -1,4 +1,4 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  min_equal: () => void;
3
3
  min_greater: () => void;
4
4
  intermediate_undefined: () => void;
@@ -11,4 +11,3 @@ declare const _default: {
11
11
  isSymbol_terminal_only: () => void;
12
12
  isSymbol_min_word: () => void;
13
13
  };
14
- export default _default;
@@ -1,4 +1,4 @@
1
- import { assert, assertEq } from "../../../dev/module.f.js";
1
+ import { assert, assertEq } from "../../../asserts/module.f.js";
2
2
  import { compress, level3Id } from "../../id/module.f.js";
3
3
  import { emptyEncodeState, encode } from "./module.f.js";
4
4
  const add = (l, r, m, isSymbol, s) => [...s, [l, r, m, isSymbol]];
@@ -24,7 +24,7 @@ const verifyStorage = (storage) => {
24
24
  };
25
25
  const s0 = level3Id(0n);
26
26
  const s1 = level3Id(1n);
27
- export default {
27
+ export const proof = {
28
28
  // Minimum word [s0, t] with t == s0
29
29
  min_equal: () => {
30
30
  const [out, storage] = runWord([s0, s0]);
@@ -1,4 +1,4 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  x2: () => void;
3
3
  x5: () => void;
4
4
  x81: () => void;
@@ -9,4 +9,3 @@ declare const _default: {
9
9
  };
10
10
  pipeline: () => void;
11
11
  };
12
- export default _default;
@@ -46,7 +46,7 @@ const w = (symbol, expected) => {
46
46
  if (out !== symbol)
47
47
  throw out;
48
48
  };
49
- export default {
49
+ export const proof = {
50
50
  x2: () => {
51
51
  const { c, n } = tests(0n);
52
52
  c(-1n, 0n);
@@ -1,4 +1,4 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  deterministic: () => void;
3
3
  distinct: () => void;
4
4
  order_matters: () => void;
@@ -7,4 +7,3 @@ declare const _default: {
7
7
  compress_correct: () => void;
8
8
  isSymbol_terminal_only: () => void;
9
9
  };
10
- export default _default;
@@ -1,4 +1,4 @@
1
- import { assert, assertEq } from "../dev/module.f.js";
1
+ import { assert, assertEq } from "../asserts/module.f.js";
2
2
  import { compress } from "./id/module.f.js";
3
3
  import { encode, emptyEncodeState } from "./module.f.js";
4
4
  const run = (bits) => {
@@ -13,7 +13,7 @@ const run = (bits) => {
13
13
  };
14
14
  const id = (bits) => run(bits)[0];
15
15
  const zeros = (n) => new Array(n).fill(0n);
16
- export default {
16
+ export const proof = {
17
17
  deterministic: () => {
18
18
  assertEq(id(zeros(16)), id(zeros(16)));
19
19
  },
@@ -0,0 +1,3 @@
1
+ export declare const proof: {
2
+ range: () => void;
3
+ };
@@ -2,7 +2,7 @@ import { range } from "./module.f.js";
2
2
  import { stringify as jsonStringify } from "../../json/module.f.js";
3
3
  import { sort } from "../../types/object/module.f.js";
4
4
  const stringify = jsonStringify(sort);
5
- export default {
5
+ export const proof = {
6
6
  range: () => {
7
7
  const r = stringify(range("A"));
8
8
  if (r !== '[65,65]') {
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Shared Unicode code-point contract for the UTF-8 and UTF-16 decoders: the
3
+ * error-tag mask used to flag invalid sequences, and a streaming `decoder`
4
+ * factory that wraps a per-unit step and an end-of-input step into a single
5
+ * `List`-to-`List` conversion.
6
+ *
7
+ * @module
8
+ */
9
+ import { type List } from '../../types/list/module.f.ts';
10
+ import type { StateScan } from '../../types/function/operator/module.f.ts';
11
+ /**
12
+ * Error mask used to tag invalid code points or encoding errors. A decoded
13
+ * value with this bit set represents a malformed unit rather than a valid
14
+ * code point.
15
+ */
16
+ export declare const errorMask = 2147483648;
17
+ /**
18
+ * Builds a streaming decoder from the two direction-specific steps.
19
+ *
20
+ * Decoding starts from the empty (`null`) state. The input is processed unit by
21
+ * unit through `byteOp`, then a trailing end-of-input marker drives `eofOp` to
22
+ * flush any leftover decoding state.
23
+ *
24
+ * @param byteOp - The per-unit decoding step.
25
+ * @param eofOp - The end-of-input step that flushes the remaining state.
26
+ * @returns A function converting a list of code units into a list of code points.
27
+ */
28
+ export declare const decoder: <Unit, S, Cp>(byteOp: StateScan<Unit, S | null, List<Cp>>, eofOp: (state: S | null) => readonly [List<Cp>, S | null]) => (input: List<Unit>) => List<Cp>;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Shared Unicode code-point contract for the UTF-8 and UTF-16 decoders: the
3
+ * error-tag mask used to flag invalid sequences, and a streaming `decoder`
4
+ * factory that wraps a per-unit step and an end-of-input step into a single
5
+ * `List`-to-`List` conversion.
6
+ *
7
+ * @module
8
+ */
9
+ import { flat, stateScan } from "../../types/list/module.f.js";
10
+ /**
11
+ * Error mask used to tag invalid code points or encoding errors. A decoded
12
+ * value with this bit set represents a malformed unit rather than a valid
13
+ * code point.
14
+ */
15
+ export const errorMask = 0b1000_0000_0000_0000_0000_0000_0000_0000;
16
+ /**
17
+ * Builds a streaming decoder from the two direction-specific steps.
18
+ *
19
+ * Decoding starts from the empty (`null`) state. The input is processed unit by
20
+ * unit through `byteOp`, then a trailing end-of-input marker drives `eofOp` to
21
+ * flush any leftover decoding state.
22
+ *
23
+ * @param byteOp - The per-unit decoding step.
24
+ * @param eofOp - The end-of-input step that flushes the remaining state.
25
+ * @returns A function converting a list of code units into a list of code points.
26
+ */
27
+ export const decoder = (byteOp, eofOp) => {
28
+ const op = (input, state) => input === null ? eofOp(state) : byteOp(input, state);
29
+ const run = stateScan(op)(null);
30
+ return input => flat(run(flat([input, [null]])));
31
+ };
@@ -1,5 +1,4 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  block: () => void;
3
3
  encoding: () => void;
4
4
  };
5
- export default _default;
@@ -1,6 +1,6 @@
1
1
  import { flat, utf8, utf8ToString } from "./module.f.js";
2
2
  import { join } from "../types/string/module.f.js";
3
- export default {
3
+ export const proof = {
4
4
  block: () => {
5
5
  const text = [
6
6
  'a',
@@ -0,0 +1 @@
1
+ export declare const proof: (() => void)[];
@@ -1,5 +1,5 @@
1
1
  import { fgRed, createConsoleText, backspace } from "./module.f.js";
2
- export default [
2
+ export const proof = [
3
3
  () => {
4
4
  if (fgRed !== '\x1b[31m') {
5
5
  throw new Error('Test failed: sgr(0)');
@@ -5,10 +5,11 @@
5
5
  *
6
6
  * @module
7
7
  */
8
- import { map, flat, stateScan, reduce, flatMap, empty, } from "../../types/list/module.f.js";
8
+ import { map, reduce, flatMap, empty, } from "../../types/list/module.f.js";
9
9
  import { concat } from "../../types/function/operator/module.f.js";
10
10
  import { contains } from "../../types/range/module.f.js";
11
11
  import { fn } from "../../types/function/module.f.js";
12
+ import { decoder, errorMask } from "../code_point/module.f.js";
12
13
  /**
13
14
  * Ranges of code points for the lower (Low) and higher (High) parts of the BMP (Basic Multilingual Plane) plane.
14
15
  */
@@ -29,10 +30,6 @@ const isHighSurrogate = contains([0xd800, 0xdbff]);
29
30
  * Range: 0xDC00 – 0xDFFF.
30
31
  */
31
32
  const isLowSurrogate = contains([0xdc00, 0xdfff]);
32
- /**
33
- * Mask of mistakes. Used to indicate invalid code points or coding errors
34
- */
35
- const errorMask = 0b1000_0000_0000_0000_0000_0000_0000_0000;
36
33
  /**
37
34
  * Checks whether the code point belongs to the additional (Supplementary) plane of Unicode.
38
35
  * Additional planes include code points from 0x010000 to 0x10FFFF.
@@ -219,53 +216,6 @@ const utf16ByteToCodePointOp = (word, state) => {
219
216
  * ```
220
217
  */
221
218
  const utf16EofToCodePointOp = (state) => [state === null ? empty : [state | errorMask], null];
222
- /**
223
- * A stateful scan operation that processes UTF-16 input (word or EOF).
224
- * This function determines whether to handle a UTF-16 word or an end-of-file (EOF)
225
- * signal during decoding:
226
- * 1. If the input is `null` (EOF), it calls `utf16EofToCodePointOp` to process
227
- * any remaining state.
228
- * 2. If the input is a valid UTF-16 word, it calls `utf16ByteToCodePointOp` to
229
- * process the word and update the state accordingly.
230
- * @param state - The current state in the UTF-16 decoding process:
231
- * - `null`: No pending surrogate.
232
- * - A high surrogate waiting for a low surrogate.
233
- * @param input - The current UTF-16 word to process, or `null` to signal EOF.
234
- * @returns A tuple:
235
- * - A list of decoded code points (if any).
236
- * - The updated decoding state.
237
- *
238
- * @example
239
- *
240
- * ```ts
241
- * // Example 1: Process a valid UTF-16 word
242
- * const input1 = 0x0041 // 'A' (BMP code point)
243
- * const result1 = utf16ByteOrEofToCodePointOp(input1, null)
244
- * console.log(result1) // [[0x0041], null]
245
- * // Example 2: Process a high surrogate, followed by EOF
246
- * const input2 = 0xD83D // High surrogate
247
- * const result2 = utf16ByteOrEofToCodePointOp(input2, null)
248
- * console.log(result2) // [[], 0xD83D] (waiting for a low surrogate)
249
- * const eofResult = utf16ByteOrEofToCodePointOp(null, 0xD83D)
250
- * console.log(eofResult) // [[0xD83D | errorMask], null] (unpaired high surrogate)
251
- * // Example 3: Handle EOF with no pending state
252
- * const eofResult2 = utf16ByteOrEofToCodePointOp(null, null)
253
- * ```
254
- */
255
- const utf16ByteOrEofToCodePointOp = (input, state) => input === null ? utf16EofToCodePointOp(state) : utf16ByteToCodePointOp(input, state);
256
- /**
257
- * Represents an end-of-file (EOF) indicator in a list of UTF-16 code units.
258
- *
259
- * This list contains a single element, `null`, which is used to signal the end
260
- * of input during UTF-16 decoding operations.
261
- * @example
262
- *
263
- * ```ts
264
- * const input = [...utf16Data, ...eofList]
265
- * // Ensures the EOF is handled during processing.
266
- * ```
267
- */
268
- const eofList = [null];
269
219
  /**
270
220
  * Converts a list of UTF-16 code units to a list of Unicode code points (CodePoint).
271
221
  * This function processes each UTF-16 code unit, decoding them into their corresponding Unicode code points.
@@ -281,7 +231,7 @@ const eofList = [null];
281
231
  * const codePoints = toCodePointList(utf16List)
282
232
  * ```
283
233
  */
284
- export const toCodePointList = (input) => flat(stateScan(utf16ByteOrEofToCodePointOp)(null)(flat([input, eofList])));
234
+ export const toCodePointList = decoder(utf16ByteToCodePointOp, utf16EofToCodePointOp);
285
235
  /**
286
236
  * Converts a string to a list of UTF-16 code units (U16).
287
237
  *
@@ -1,4 +1,4 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  toCodePointList: (() => void)[];
3
3
  fromCodePointList: (() => void)[];
4
4
  string: (() => void)[];
@@ -7,4 +7,3 @@ declare const _default: {
7
7
  stringToCodePointList: (() => void)[];
8
8
  codePointListToString: (() => void)[];
9
9
  };
10
- export default _default;
@@ -3,7 +3,7 @@ import { stringify as jsonStringify } from "../../json/module.f.js";
3
3
  import { sort } from "../../types/object/module.f.js";
4
4
  import { toArray } from "../../types/list/module.f.js";
5
5
  const stringify = (a) => jsonStringify(sort)(a);
6
- export default {
6
+ export const proof = {
7
7
  toCodePointList: [
8
8
  () => {
9
9
  const result = stringify(toArray(toCodePointList([-1, 65536])));
@@ -3,11 +3,8 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { flat, flatMap, stateScan } from "../../types/list/module.f.js";
7
- /**
8
- * Error mask constant used to represent invalid code points or encoding errors in UTF-8.
9
- */
10
- const errorMask = 0b1000_0000_0000_0000_0000_0000_0000_0000;
6
+ import { flatMap } from "../../types/list/module.f.js";
7
+ import { decoder, errorMask } from "../code_point/module.f.js";
11
8
  /**
12
9
  * Converts a Unicode code point to a sequence of UTF-8 bytes.
13
10
  * @param input The Unicode code point to be converted. Valid range:
@@ -175,29 +172,10 @@ const utf8EofToCodePointOp = (state) => [
175
172
  state === null ? null : [utf8StateToError(state)],
176
173
  null,
177
174
  ];
178
- /**
179
- * Combines UTF-8 byte and EOF handling into a single decoding operation.
180
- *
181
- * @param state - The current UTF-8 decoding state.
182
- * @param input - The next byte or EOF indicator.
183
- * @returns A tuple containing:
184
- * - A list of decoded Unicode code points or error codes.
185
- * - The updated UTF-8 state.
186
- */
187
- const utf8ByteOrEofToCodePointOp = (input, state) => input === null ? utf8EofToCodePointOp(state) : utf8ByteToCodePointOp(input, state);
188
- /**
189
- * A constant representing the end-of-file (EOF) marker for UTF-8 decoding.
190
- *
191
- * @remarks
192
- * This is used as a sentinel value in decoding operations to signify the
193
- * termination of input. The list contains a single `null` value, which
194
- * represents the EOF condition.
195
- */
196
- const eofList = [null];
197
175
  /**
198
176
  * Converts a list of UTF-8 bytes into a list of Unicode code points.
199
177
  *
200
178
  * @param input - A list of UTF-8 bytes.
201
179
  * @returns A list of Unicode code points or error codes.
202
180
  */
203
- export const toCodePointList = (input) => flat(stateScan(utf8ByteOrEofToCodePointOp)(null)(flat([input, eofList])));
181
+ export const toCodePointList = decoder(utf8ByteToCodePointOp, utf8EofToCodePointOp);
@@ -1,6 +1,5 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  toCodePoint: (() => void)[];
3
3
  fromCodePointList: (() => void)[];
4
4
  toFrom: (() => void)[];
5
5
  };
6
- export default _default;
@@ -3,7 +3,7 @@ import { stringify as jsonStringify } from "../../json/module.f.js";
3
3
  import { sort } from "../../types/object/module.f.js";
4
4
  import { toArray } from "../../types/list/module.f.js";
5
5
  const stringify = jsonStringify(sort);
6
- export default {
6
+ export const proof = {
7
7
  toCodePoint: [
8
8
  () => {
9
9
  const result = stringify(toArray(toCodePointList([-1, 256])));
@@ -3,15 +3,12 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { map } from "../nullable/module.f.js";
6
+ import { fromUndefined, map } from "../nullable/module.f.js";
7
7
  export const isArray = (value) => value instanceof Array;
8
8
  export const isArray2 = (a) => a.length === 2;
9
9
  const uncheckTail = (a) => a.slice(1);
10
10
  const uncheckHead = (a) => a.slice(0, -1);
11
- export const at = (i) => (a) => {
12
- const r = a[i];
13
- return r === undefined ? null : r;
14
- };
11
+ export const at = (i) => (a) => fromUndefined(a[i]);
15
12
  export const first = at(0);
16
13
  export const last = (a) => at(a.length - 1)(a);
17
14
  export const tail = (a) => a.length === 0 ? null : uncheckTail(a);
@@ -1,4 +1,4 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  stringify: () => void;
3
3
  at: (() => void)[];
4
4
  first: (() => void)[];
@@ -9,4 +9,3 @@ declare const _default: {
9
9
  splitLast: (() => void)[];
10
10
  empty: () => void;
11
11
  };
12
- export default _default;
@@ -2,7 +2,7 @@ import { at, first, last, head, tail, splitFirst, splitLast, empty } from "./mod
2
2
  import { stringify as jsonStringify } from "../../json/module.f.js";
3
3
  import { sort } from "../object/module.f.js";
4
4
  const stringify = jsonStringify(sort);
5
- export default {
5
+ export const proof = {
6
6
  stringify: () => {
7
7
  const result = stringify([1, 20, 300]);
8
8
  if (result !== '[1,20,300]') {
@@ -1,6 +1,5 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  decToBin: (() => void)[];
3
3
  roundingPositive: (() => void)[];
4
4
  roundingNegative: (() => void)[];
5
5
  };
6
- export default _default;
@@ -1,5 +1,5 @@
1
1
  import { decToBin } from "./module.f.js";
2
- export default {
2
+ export const proof = {
3
3
  decToBin: [
4
4
  () => {
5
5
  const result = decToBin([0n, 0]);
@@ -1,5 +1,5 @@
1
1
  export declare const clz32Log2: (v: bigint) => bigint;
2
- declare const _default: {
2
+ export declare const proof: {
3
3
  example: () => void;
4
4
  benchmark: () => {
5
5
  big: {
@@ -30,4 +30,3 @@ declare const _default: {
30
30
  divUp: () => void;
31
31
  roundUp: () => void;
32
32
  };
33
- export default _default;
@@ -148,7 +148,7 @@ const benchmarkSmall = f => () => {
148
148
  --e;
149
149
  } while (c !== 0n);
150
150
  };
151
- export default {
151
+ export const proof = {
152
152
  example: () => {
153
153
  const total = sum([1n, 2n, 3n]); // 6n
154
154
  if (total !== 6n) {
@@ -1,4 +1,4 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  examples: {
3
3
  vec: () => void;
4
4
  uint: () => void;
@@ -54,4 +54,3 @@ declare const _default: {
54
54
  msb_unaligned: () => void;
55
55
  };
56
56
  };
57
- export default _default;
@@ -80,7 +80,7 @@ const concat = (e) => (r) => () => {
80
80
  throw ab;
81
81
  }
82
82
  };
83
- export default {
83
+ export const proof = {
84
84
  examples: {
85
85
  vec: () => {
86
86
  const vec4 = vec(4n);
@@ -0,0 +1 @@
1
+ export declare const proof: () => void;
@@ -148,4 +148,4 @@ const test = () => {
148
148
  }
149
149
  }
150
150
  };
151
- export default test;
151
+ export const proof = test;
@@ -1,8 +1,7 @@
1
- declare const _default: {
1
+ export declare const proof: {
2
2
  valueTest1: () => void;
3
3
  valuesTest2: () => void;
4
4
  findTrue: () => void;
5
5
  find: () => void;
6
6
  test: () => void;
7
7
  };
8
- export default _default;
@@ -62,7 +62,7 @@ const test = () => {
62
62
  }
63
63
  }
64
64
  };
65
- export default {
65
+ export const proof = {
66
66
  valueTest1,
67
67
  valuesTest2,
68
68
  findTrue,