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.
- package/fs/base64/module.f.js +6 -5
- package/fs/base64/proof.f.d.ts +1 -0
- package/fs/base64/proof.f.js +10 -1
- package/fs/cas/mcp/module.f.d.ts +8 -4
- package/fs/cas/mcp/module.f.js +33 -21
- package/fs/cas/mcp/proof.f.d.ts +0 -7
- package/fs/cas/mcp/proof.f.js +47 -139
- package/fs/cas/module.f.js +3 -10
- package/fs/ci/config/module.f.d.ts +7 -7
- package/fs/ci/config/module.f.js +8 -8
- package/fs/djs/parser/proof.f.js +12 -0
- package/fs/effects/module.f.d.ts +15 -0
- package/fs/effects/module.f.js +14 -0
- package/fs/effects/node/module.f.js +5 -15
- package/fs/effects/node/module.js +3 -1
- package/fs/effects/node/proof.f.d.ts +3 -0
- package/fs/effects/node/proof.f.js +19 -1
- package/fs/effects/node/virtual/module.f.js +1 -2
- package/fs/effects/proof.f.d.ts +5 -0
- package/fs/effects/proof.f.js +22 -1
- package/fs/fjs/proof.f.d.ts +1 -0
- package/fs/fjs/proof.f.js +6 -0
- package/fs/fsc/module.f.d.ts +1 -0
- package/fs/fsc/module.f.js +5 -1
- package/fs/js/tokenizer/module.f.d.ts +1 -1
- package/fs/js/tokenizer/module.f.js +7 -1
- package/fs/js/tokenizer/proof.f.js +59 -0
- package/fs/json/parser/proof.f.js +18 -0
- package/fs/path/module.f.d.ts +6 -0
- package/fs/path/module.f.js +6 -0
- package/fs/path/proof.f.d.ts +1 -0
- package/fs/path/proof.f.js +40 -2
- package/fs/text/utf8/module.f.d.ts +6 -0
- package/fs/text/utf8/module.f.js +15 -2
- package/fs/text/utf8/proof.f.js +53 -0
- package/fs/types/result/module.f.d.ts +4 -0
- package/fs/types/result/module.f.js +4 -0
- package/fs/types/result/proof.f.d.ts +1 -0
- package/fs/types/result/proof.f.js +12 -2
- 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
|
-
|
|
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 };
|