functionalscript 0.35.2 → 0.36.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 (40) hide show
  1. package/fs/base64/module.f.js +6 -5
  2. package/fs/base64/proof.f.d.ts +1 -0
  3. package/fs/base64/proof.f.js +10 -1
  4. package/fs/cas/mcp/module.f.d.ts +8 -4
  5. package/fs/cas/mcp/module.f.js +33 -21
  6. package/fs/cas/mcp/proof.f.d.ts +0 -7
  7. package/fs/cas/mcp/proof.f.js +47 -139
  8. package/fs/cas/module.f.js +3 -10
  9. package/fs/ci/config/module.f.d.ts +7 -7
  10. package/fs/ci/config/module.f.js +8 -8
  11. package/fs/djs/parser/proof.f.js +12 -0
  12. package/fs/effects/module.f.d.ts +15 -0
  13. package/fs/effects/module.f.js +14 -0
  14. package/fs/effects/node/module.f.js +5 -15
  15. package/fs/effects/node/module.js +3 -1
  16. package/fs/effects/node/proof.f.d.ts +3 -0
  17. package/fs/effects/node/proof.f.js +19 -1
  18. package/fs/effects/node/virtual/module.f.js +1 -2
  19. package/fs/effects/proof.f.d.ts +5 -0
  20. package/fs/effects/proof.f.js +22 -1
  21. package/fs/fjs/proof.f.d.ts +1 -0
  22. package/fs/fjs/proof.f.js +6 -0
  23. package/fs/fsc/module.f.d.ts +1 -0
  24. package/fs/fsc/module.f.js +5 -1
  25. package/fs/js/tokenizer/module.f.d.ts +1 -1
  26. package/fs/js/tokenizer/module.f.js +7 -1
  27. package/fs/js/tokenizer/proof.f.js +59 -0
  28. package/fs/json/parser/proof.f.js +18 -0
  29. package/fs/path/module.f.d.ts +6 -0
  30. package/fs/path/module.f.js +6 -0
  31. package/fs/path/proof.f.d.ts +1 -0
  32. package/fs/path/proof.f.js +40 -2
  33. package/fs/text/utf8/module.f.d.ts +6 -0
  34. package/fs/text/utf8/module.f.js +15 -2
  35. package/fs/text/utf8/proof.f.js +53 -0
  36. package/fs/types/result/module.f.d.ts +4 -0
  37. package/fs/types/result/module.f.js +4 -0
  38. package/fs/types/result/proof.f.d.ts +1 -0
  39. package/fs/types/result/proof.f.js +12 -2
  40. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { error, ok, unwrap, invert } from "./module.f.js";
1
+ import { error, ok, unwrap, invert, mapOk } from "./module.f.js";
2
2
  const example = () => {
3
3
  const success = ok(42);
4
4
  const failure = error('Something went wrong');
@@ -39,4 +39,14 @@ const unwrapError = () => {
39
39
  throw 'expected throw';
40
40
  }
41
41
  };
42
- export const proof = { example, invertTest, unwrapError };
42
+ const mapOkTest = () => {
43
+ const [k0, v0] = mapOk((n) => n + 1)(ok(41));
44
+ if (k0 !== 'ok' || v0 !== 42) {
45
+ throw [k0, v0];
46
+ }
47
+ const [k1, v1] = mapOk((n) => n + 1)(error('oops'));
48
+ if (k1 !== 'error' || v1 !== 'oops') {
49
+ throw [k1, v1];
50
+ }
51
+ };
52
+ export const proof = { example, invertTest, unwrapError, mapOkTest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functionalscript",
3
- "version": "0.35.2",
3
+ "version": "0.36.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "**/*.js",