functionalscript 0.35.2 → 0.37.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/asn.1/module.f.js +1 -1
- package/fs/asserts/proof.f.js +1 -1
- package/fs/base_n/module.f.js +3 -3
- package/fs/base_n/proof.f.js +3 -3
- package/fs/{base128 → basen/base128}/module.f.d.ts +1 -1
- package/fs/{base128 → basen/base128}/module.f.js +1 -1
- package/fs/{base128 → basen/base128}/proof.f.js +3 -3
- package/fs/{base64 → basen/base64}/module.f.d.ts +2 -2
- package/fs/basen/base64/module.f.js +71 -0
- package/fs/{base64 → basen/base64}/proof.f.d.ts +2 -0
- package/fs/{base64 → basen/base64}/proof.f.js +17 -2
- package/fs/{cbase32 → basen/cbase32}/module.f.d.ts +2 -2
- package/fs/{cbase32 → basen/cbase32}/module.f.js +2 -2
- package/fs/{cbase32 → basen/cbase32}/proof.f.js +1 -1
- package/fs/bnf/data/module.f.js +4 -4
- package/fs/bnf/data/proof.f.js +6 -6
- package/fs/bnf/descent/module.f.js +6 -6
- package/fs/bnf/descent/proof.f.js +6 -6
- package/fs/bnf/ll1/module.f.js +9 -9
- package/fs/bnf/ll1/proof.f.js +6 -6
- package/fs/bnf/module.f.js +4 -4
- package/fs/bnf/proof.f.js +2 -2
- package/fs/bnf/testlib.f.js +1 -1
- package/fs/cas/cli/module.f.js +7 -7
- package/fs/cas/cli/proof.f.js +8 -8
- package/fs/cas/mcp/module.f.d.ts +8 -4
- package/fs/cas/mcp/module.f.js +124 -72
- package/fs/cas/mcp/proof.f.d.ts +3 -8
- package/fs/cas/mcp/proof.f.js +122 -186
- package/fs/cas/module.f.js +12 -19
- package/fs/cas/proof.f.d.ts +4 -2
- package/fs/cas/proof.f.js +10 -10
- package/fs/ci/bun/module.f.js +2 -2
- package/fs/ci/common/module.f.d.ts +2 -2
- package/fs/ci/common/module.f.js +4 -4
- package/fs/ci/config/module.f.d.ts +20 -21
- package/fs/ci/config/module.f.js +8 -10
- package/fs/ci/deno/module.f.js +8 -4
- package/fs/ci/module.f.js +9 -9
- package/fs/ci/node/module.f.d.ts +1 -1
- package/fs/ci/node/module.f.js +3 -5
- package/fs/ci/playwright/module.f.js +3 -3
- package/fs/ci/proof.f.js +14 -14
- package/fs/ci/rust/module.f.js +2 -2
- package/fs/cli/module.f.js +3 -3
- package/fs/cli/proof.f.js +3 -3
- package/fs/{types → common}/monoid/module.f.d.ts +1 -1
- package/fs/crypto/hmac/module.f.js +2 -2
- package/fs/crypto/hmac/proof.f.js +5 -5
- package/fs/crypto/pow/module.f.js +3 -3
- package/fs/crypto/pow/proof.f.js +4 -4
- package/fs/crypto/secp/module.f.js +2 -2
- package/fs/crypto/secp/proof.f.js +3 -3
- package/fs/crypto/sha2/module.f.js +2 -2
- package/fs/crypto/sha2/proof.f.js +6 -6
- package/fs/crypto/sign/module.f.js +4 -4
- package/fs/crypto/vdf/module.f.js +1 -1
- package/fs/crypto/vdf/proof.f.js +1 -1
- package/fs/dev/module.f.js +6 -6
- package/fs/dev/package_json/module.f.js +6 -6
- package/fs/dev/package_json/proof.f.js +3 -3
- package/fs/dev/proof.f.js +2 -2
- package/fs/djs/ast/module.f.js +2 -2
- package/fs/djs/ast/proof.f.js +4 -4
- package/fs/djs/examples/m.f.d.ts +1 -1
- package/fs/djs/module.f.d.ts +1 -1
- package/fs/djs/module.f.js +5 -5
- package/fs/djs/parser/module.f.js +4 -4
- package/fs/djs/parser/proof.f.js +19 -7
- package/fs/djs/proof.f.js +3 -3
- package/fs/djs/serializer/module.f.js +6 -6
- package/fs/djs/serializer/proof.f.js +4 -4
- package/fs/djs/tokenizer/module.f.js +3 -3
- package/fs/djs/tokenizer/proof.f.js +5 -5
- package/fs/djs/tokenizer-new/proof.f.js +6 -6
- package/fs/djs/transpiler/module.f.d.ts +5 -0
- package/fs/djs/transpiler/module.f.js +21 -11
- package/fs/djs/transpiler/proof.f.js +5 -5
- package/fs/effects/memory/module.f.js +4 -4
- package/fs/effects/memory/proof.f.js +3 -3
- package/fs/effects/module.f.d.ts +15 -0
- package/fs/effects/module.f.js +15 -1
- package/fs/effects/node/memory/module.js +2 -2
- package/fs/effects/node/memory/proof.js +3 -3
- package/fs/effects/node/module.f.js +10 -20
- package/fs/effects/node/module.js +13 -11
- 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 +7 -8
- package/fs/effects/node/virtual/proof.f.d.ts +1 -0
- package/fs/effects/node/virtual/proof.f.js +11 -4
- package/fs/effects/proof.f.d.ts +5 -0
- package/fs/effects/proof.f.js +22 -1
- package/fs/emergent_testing/all.test.js +2 -2
- package/fs/emergent_testing/example.f.d.ts +1 -1
- package/fs/emergent_testing/module.f.js +6 -6
- package/fs/emergent_testing/proof.f.d.ts +19 -17
- package/fs/emergent_testing/proof.f.js +7 -7
- package/fs/emergent_testing/scenarios/all.js +1 -1
- package/fs/fsc/bnf.f.js +2 -2
- package/fs/fsc/json.f.js +1 -1
- package/fs/fsc/module.f.d.ts +1 -0
- package/fs/fsc/module.f.js +11 -7
- package/fs/fsc/proof.f.js +4 -4
- package/fs/fsm/module.f.js +9 -9
- package/fs/fsm/proof.f.js +7 -7
- package/fs/js/tokenizer/module.f.d.ts +1 -1
- package/fs/js/tokenizer/module.f.js +14 -8
- package/fs/js/tokenizer/proof.f.js +64 -5
- package/fs/mcp/module.f.d.ts +13 -13
- package/fs/mcp/module.f.js +8 -8
- package/fs/mcp/proof.f.js +5 -5
- package/fs/mcp/stdio/module.f.d.ts +2 -2
- package/fs/mcp/stdio/module.f.js +10 -10
- package/fs/mcp/stdio/proof.f.js +10 -10
- package/fs/{html → media/html}/module.f.d.ts +3 -3
- package/fs/{html → media/html}/module.f.js +9 -9
- package/fs/media/json/module.f.d.ts +50 -0
- package/fs/{json → media/json}/module.f.js +7 -7
- package/fs/{json → media/json}/parser/module.f.d.ts +2 -2
- package/fs/{json → media/json}/parser/module.f.js +7 -7
- package/fs/{json → media/json}/parser/proof.f.js +24 -6
- package/fs/{json → media/json}/proof.f.js +4 -4
- package/fs/media/json/rpc/module.f.d.ts +114 -0
- package/fs/{json → media/json}/rpc/module.f.js +3 -3
- package/fs/{json → media/json}/rpc/proof.f.js +4 -4
- package/fs/media/json/schema/module.f.d.ts +78 -0
- package/fs/{json → media/json}/schema/module.f.js +2 -2
- package/fs/{json → media/json}/schema/proof.f.js +3 -3
- package/fs/{json → media/json}/serializer/module.f.d.ts +1 -1
- package/fs/{json → media/json}/serializer/module.f.js +2 -2
- package/fs/{json → media/json}/serializer/proof.f.js +2 -2
- package/fs/{json → media/json}/tokenizer/module.f.d.ts +2 -2
- package/fs/{json → media/json}/tokenizer/module.f.js +4 -4
- package/fs/{json → media/json}/tokenizer/proof.f.js +5 -5
- package/fs/media/module.f.d.ts +37 -0
- package/fs/media/module.f.js +24 -0
- package/fs/media/proof.f.d.ts +9 -0
- package/fs/media/proof.f.js +57 -0
- package/fs/media/revision/module.f.d.ts +51 -0
- package/fs/media/revision/module.f.js +110 -0
- package/fs/media/revision/proof.f.d.ts +29 -0
- package/fs/media/revision/proof.f.js +119 -0
- package/fs/{mime → media/type}/module.f.d.ts +6 -6
- package/fs/{mime → media/type}/module.f.js +6 -6
- package/fs/{mime → media/type}/proof.f.js +6 -6
- package/fs/module.f.d.ts +2 -0
- package/fs/{fjs/module.f.js → module.f.js} +8 -8
- package/fs/module.js +4 -0
- package/fs/path/module.f.d.ts +6 -0
- package/fs/path/module.f.js +8 -2
- package/fs/path/proof.f.d.ts +1 -0
- package/fs/path/proof.f.js +40 -2
- package/fs/{fjs/proof.f.d.ts → proof.f.d.ts} +1 -0
- package/fs/{fjs/proof.f.js → proof.f.js} +10 -4
- package/fs/sul/id/module.f.js +9 -9
- package/fs/sul/id/proof.f.js +5 -5
- package/fs/sul/level/hash/module.f.js +3 -3
- package/fs/sul/level/hash/proof.f.js +3 -3
- package/fs/sul/level/literal/module.f.js +5 -5
- package/fs/sul/level/literal/proof.f.js +3 -3
- package/fs/sul/module.f.js +3 -3
- package/fs/sul/proof.f.js +3 -3
- package/fs/text/ascii/proof.f.js +3 -3
- package/fs/text/code_point/module.f.js +2 -2
- package/fs/text/code_point/proof.f.js +1 -1
- package/fs/text/module.f.js +5 -5
- package/fs/text/proof.f.js +4 -4
- package/fs/text/sgr/module.f.js +2 -2
- package/fs/text/sgr/proof.f.js +2 -2
- package/fs/text/utf16/module.f.js +5 -5
- package/fs/text/utf16/proof.f.js +4 -4
- package/fs/text/utf8/module.f.d.ts +6 -0
- package/fs/text/utf8/module.f.js +37 -19
- package/fs/text/utf8/proof.f.js +58 -5
- package/fs/types/array/module.f.js +1 -1
- package/fs/types/array/proof.f.js +3 -3
- package/fs/types/bigfloat/module.f.js +1 -1
- package/fs/types/bigfloat/proof.f.js +1 -1
- package/fs/types/bigint/module.f.js +2 -2
- package/fs/types/bigint/proof.f.js +3 -3
- package/fs/types/bit_vec/module.f.js +8 -8
- package/fs/types/bit_vec/proof.f.js +5 -5
- package/fs/types/btree/find/module.f.js +1 -1
- package/fs/types/btree/find/proof.f.d.ts +3 -1
- package/fs/types/btree/find/proof.f.js +7 -7
- package/fs/types/btree/module.f.js +2 -2
- package/fs/types/btree/proof.f.d.ts +11 -5
- package/fs/types/btree/proof.f.js +7 -7
- package/fs/types/btree/remove/module.f.js +4 -4
- package/fs/types/btree/remove/proof.f.d.ts +5 -2
- package/fs/types/btree/remove/proof.f.js +5 -5
- package/fs/types/btree/set/module.f.js +3 -3
- package/fs/types/btree/set/proof.f.js +4 -4
- package/fs/types/byte_set/module.f.js +2 -2
- package/fs/types/byte_set/proof.f.js +4 -4
- package/fs/types/function/compare/proof.f.js +1 -1
- package/fs/types/function/operator/proof.f.d.ts +21 -10
- package/fs/types/function/operator/proof.f.js +1 -1
- package/fs/types/function/proof.f.js +1 -1
- package/fs/types/list/module.f.js +2 -2
- package/fs/types/list/proof.f.d.ts +15 -7
- package/fs/types/list/proof.f.js +4 -4
- package/fs/types/map/proof.f.js +2 -2
- package/fs/types/nibble_set/proof.f.js +2 -2
- package/fs/types/nullable/module.f.js +2 -2
- package/fs/types/nullable/proof.f.js +1 -1
- package/fs/types/number/module.f.js +5 -5
- package/fs/types/number/proof.f.js +1 -1
- package/fs/types/object/module.f.js +4 -4
- package/fs/types/object/proof.f.js +1 -1
- package/fs/types/ordered_map/module.f.js +6 -6
- package/fs/types/ordered_map/proof.f.js +3 -3
- package/fs/types/patricia_trie/proof.f.d.ts +11 -5
- package/fs/types/patricia_trie/proof.f.js +2 -2
- package/fs/types/prime_field/module.f.js +2 -2
- package/fs/types/prime_field/proof.f.js +2 -2
- package/fs/types/range/proof.f.js +1 -1
- package/fs/types/range_map/module.f.js +4 -4
- package/fs/types/range_map/proof.f.js +7 -7
- package/fs/types/result/module.f.d.ts +4 -0
- package/fs/types/result/module.f.js +4 -0
- package/fs/types/result/module.js +1 -1
- package/fs/types/result/proof.f.d.ts +9 -3
- package/fs/types/result/proof.f.js +12 -2
- package/fs/types/rtti/common/module.f.js +4 -4
- package/fs/types/rtti/module.f.d.ts +2 -2
- package/fs/types/rtti/module.f.js +1 -1
- package/fs/types/rtti/parse/module.f.js +5 -5
- package/fs/types/rtti/parse/proof.f.js +2 -2
- package/fs/types/rtti/ts/module.f.js +1 -1
- package/fs/types/rtti/ts/proof.f.js +2 -2
- package/fs/types/rtti/validate/module.f.js +4 -4
- package/fs/types/rtti/validate/proof.f.js +2 -2
- package/fs/types/sorted_list/module.f.js +3 -3
- package/fs/types/sorted_list/proof.f.js +6 -6
- package/fs/types/sorted_set/module.f.js +1 -1
- package/fs/types/sorted_set/proof.f.js +6 -6
- package/fs/types/string/module.f.js +4 -4
- package/fs/types/string/proof.f.js +2 -2
- package/fs/types/string_set/module.f.js +6 -6
- package/fs/types/string_set/proof.f.js +1 -1
- package/fs/types/ts/proof.f.d.ts +18 -18
- package/fs/types/ts/proof.f.js +1 -1
- package/fs/types/uint8array/module.f.js +4 -4
- package/fs/types/uint8array/proof.f.js +4 -4
- package/fs/website/module.f.js +3 -3
- package/fs/website/proof.f.js +3 -3
- package/package.json +8 -8
- package/fs/base64/module.f.js +0 -60
- package/fs/fjs/module.f.d.ts +0 -2
- package/fs/fjs/module.js +0 -4
- package/fs/json/module.f.d.ts +0 -50
- package/fs/json/rpc/module.f.d.ts +0 -114
- package/fs/json/schema/module.f.d.ts +0 -77
- /package/fs/{base128 → basen/base128}/proof.f.d.ts +0 -0
- /package/fs/{cbase32 → basen/cbase32}/proof.f.d.ts +0 -0
- /package/fs/{types → common}/monoid/module.f.js +0 -0
- /package/fs/{types → common}/monoid/proof.f.d.ts +0 -0
- /package/fs/{types → common}/monoid/proof.f.js +0 -0
- /package/fs/{html → media/html}/proof.f.d.ts +0 -0
- /package/fs/{html → media/html}/proof.f.js +0 -0
- /package/fs/{json → media/json}/parser/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/rpc/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/schema/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/serializer/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/tokenizer/proof.f.d.ts +0 -0
- /package/fs/{mime → media/type}/proof.f.d.ts +0 -0
- /package/fs/{fjs/module.d.ts → module.d.ts} +0 -0
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
* cmp('apple')('banana') // -1
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
import { reduce as listReduce, repeat as listRepeat } from
|
|
19
|
-
import { compose } from
|
|
20
|
-
import { cmp as uCmp } from
|
|
21
|
-
import { join as joinOp, concat as concatOp } from
|
|
18
|
+
import { reduce as listReduce, repeat as listRepeat } from '../list/module.f.js';
|
|
19
|
+
import { compose } from '../function/module.f.js';
|
|
20
|
+
import { cmp as uCmp } from '../function/compare/module.f.js';
|
|
21
|
+
import { join as joinOp, concat as concatOp } from '../function/operator/module.f.js';
|
|
22
22
|
const reduce = o => listReduce(o)('');
|
|
23
23
|
export const join = compose(joinOp)(reduce);
|
|
24
24
|
export const concat = reduce(concatOp);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { join, concat, repeat, cmp, splitAt } from
|
|
2
|
-
import { repeat as repeatList } from
|
|
1
|
+
import { join, concat, repeat, cmp, splitAt } from './module.f.js';
|
|
2
|
+
import { repeat as repeatList } from '../list/module.f.js';
|
|
3
3
|
export const proof = {
|
|
4
4
|
example: () => {
|
|
5
5
|
const words = ['hello', 'world'];
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
* if (contains('banana')(mySet)) { throw '4' }
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
import { empty as btEmpty, values as btValues } from
|
|
23
|
-
import { find, isFound } from
|
|
24
|
-
import { remove as btreeRemove } from
|
|
25
|
-
import { set as btreeSet } from
|
|
22
|
+
import { empty as btEmpty, values as btValues } from '../btree/module.f.js';
|
|
23
|
+
import { find, isFound } from '../btree/find/module.f.js';
|
|
24
|
+
import { remove as btreeRemove } from '../btree/remove/module.f.js';
|
|
25
|
+
import { set as btreeSet } from '../btree/set/module.f.js';
|
|
26
26
|
import { cmp } from "../string/module.f.js";
|
|
27
|
-
import { fold } from
|
|
28
|
-
import { compose } from
|
|
27
|
+
import { fold } from '../list/module.f.js';
|
|
28
|
+
import { compose } from '../function/module.f.js';
|
|
29
29
|
export const values = btValues;
|
|
30
30
|
export const empty = btEmpty;
|
|
31
31
|
export const contains = value => {
|
package/fs/types/ts/proof.f.d.ts
CHANGED
|
@@ -17,22 +17,22 @@ export declare const printerMutableStruct: () => void;
|
|
|
17
17
|
export declare const printerMutableArray: () => void;
|
|
18
18
|
export declare const printerMutableRecord: () => void;
|
|
19
19
|
export declare const proof: {
|
|
20
|
-
primitiveNull:
|
|
21
|
-
primitiveBigint:
|
|
22
|
-
primitiveString:
|
|
23
|
-
primitiveNumberFinite:
|
|
24
|
-
primitiveNumberInfinite:
|
|
25
|
-
primitiveUndefined:
|
|
26
|
-
primitiveBoolean:
|
|
27
|
-
unionEmpty:
|
|
28
|
-
unionSingle:
|
|
29
|
-
unionMulti:
|
|
30
|
-
printerReadonlyTuple:
|
|
31
|
-
printerReadonlyStruct:
|
|
32
|
-
printerReadonlyArray:
|
|
33
|
-
printerReadonlyRecord:
|
|
34
|
-
printerMutableTuple:
|
|
35
|
-
printerMutableStruct:
|
|
36
|
-
printerMutableArray:
|
|
37
|
-
printerMutableRecord:
|
|
20
|
+
primitiveNull: typeof primitiveNull;
|
|
21
|
+
primitiveBigint: typeof primitiveBigint;
|
|
22
|
+
primitiveString: typeof primitiveString;
|
|
23
|
+
primitiveNumberFinite: typeof primitiveNumberFinite;
|
|
24
|
+
primitiveNumberInfinite: typeof primitiveNumberInfinite;
|
|
25
|
+
primitiveUndefined: typeof primitiveUndefined;
|
|
26
|
+
primitiveBoolean: typeof primitiveBoolean;
|
|
27
|
+
unionEmpty: typeof unionEmpty;
|
|
28
|
+
unionSingle: typeof unionSingle;
|
|
29
|
+
unionMulti: typeof unionMulti;
|
|
30
|
+
printerReadonlyTuple: typeof printerReadonlyTuple;
|
|
31
|
+
printerReadonlyStruct: typeof printerReadonlyStruct;
|
|
32
|
+
printerReadonlyArray: typeof printerReadonlyArray;
|
|
33
|
+
printerReadonlyRecord: typeof printerReadonlyRecord;
|
|
34
|
+
printerMutableTuple: typeof printerMutableTuple;
|
|
35
|
+
printerMutableStruct: typeof printerMutableStruct;
|
|
36
|
+
printerMutableArray: typeof printerMutableArray;
|
|
37
|
+
printerMutableRecord: typeof printerMutableRecord;
|
|
38
38
|
};
|
package/fs/types/ts/proof.f.js
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
|
-
import { utf8, utf8ToString } from
|
|
13
|
-
import { maxLengthBytes, msb, u8List, u8ListToVec } from
|
|
14
|
-
import { compose } from
|
|
15
|
-
import { flat, fromArrayLike, iterable, map } from
|
|
12
|
+
import { utf8, utf8ToString } from '../../text/module.f.js';
|
|
13
|
+
import { maxLengthBytes, msb, u8List, u8ListToVec } from '../bit_vec/module.f.js';
|
|
14
|
+
import { compose } from '../function/module.f.js';
|
|
15
|
+
import { flat, fromArrayLike, iterable, map } from '../list/module.f.js';
|
|
16
16
|
const u8ListToVecMsb = u8ListToVec(msb);
|
|
17
17
|
const u8ListMsb = u8List(msb);
|
|
18
18
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { maxLength, maxLengthBytes, vec } from
|
|
2
|
-
import { toVec, fromVec, listToVec, decodeUtf8, encodeUtf8 } from
|
|
3
|
-
import { strictEqual } from
|
|
4
|
-
import { equal, fromArrayLike } from
|
|
1
|
+
import { maxLength, maxLengthBytes, vec } from '../bit_vec/module.f.js';
|
|
2
|
+
import { toVec, fromVec, listToVec, decodeUtf8, encodeUtf8 } from './module.f.js';
|
|
3
|
+
import { strictEqual } from '../function/operator/module.f.js';
|
|
4
|
+
import { equal, fromArrayLike } from '../list/module.f.js';
|
|
5
5
|
const assertEq = (a, b) => {
|
|
6
6
|
if (a !== b) {
|
|
7
7
|
throw [a, b];
|
package/fs/website/module.f.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { htmlUtf8 } from
|
|
7
|
-
import { writeFile } from
|
|
8
|
-
import { pure } from
|
|
6
|
+
import { htmlUtf8 } from '../media/html/module.f.js';
|
|
7
|
+
import { writeFile } from '../effects/node/module.f.js';
|
|
8
|
+
import { pure } from '../effects/module.f.js';
|
|
9
9
|
const html = htmlUtf8()(['a',
|
|
10
10
|
{ href: 'https://github.com/functionalscript/functionalscript' },
|
|
11
11
|
'GitHub Repository'
|
package/fs/website/proof.f.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { main } from
|
|
2
|
-
import { emptyState, virtual } from
|
|
3
|
-
import { assert } from
|
|
1
|
+
import { main } from './module.f.js';
|
|
2
|
+
import { emptyState, virtual } from '../effects/node/virtual/module.f.js';
|
|
3
|
+
import { assert } from '../asserts/module.f.js';
|
|
4
4
|
export const proof = {
|
|
5
5
|
main: () => {
|
|
6
6
|
const program = main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "functionalscript",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
"description": "FunctionalScript is a purely functional subset of JavaScript",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"prepack": "tsc --NoEmit false",
|
|
12
|
-
"test": "tsc && node ./fs/
|
|
12
|
+
"test": "tsc && node ./fs/module.ts t",
|
|
13
13
|
"cov": "node --test --experimental-test-coverage --test-coverage-include=**/module.f.ts",
|
|
14
|
-
"start": "node ./fs/
|
|
15
|
-
"ci-update": "node ./fs/
|
|
14
|
+
"start": "node ./fs/module.ts",
|
|
15
|
+
"ci-update": "node ./fs/module.ts ci",
|
|
16
16
|
"update": "npx npm-check-updates -u && npm install && deno install && bun install && npm run ci-update",
|
|
17
|
-
"index-html": "node ./fs/
|
|
17
|
+
"index-html": "node ./fs/module.ts r ./fs/website/module.f.ts",
|
|
18
18
|
"website": "npm run prepack && npm run index-html"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=22"
|
|
22
22
|
},
|
|
23
23
|
"bin": {
|
|
24
|
-
"fjs": "fs/
|
|
24
|
+
"fjs": "fs/module.js"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"homepage": "https://github.com/functionalscript/functionalscript#readme",
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@playwright/test": "1.61.1",
|
|
47
|
-
"@types/node": "26.1.
|
|
48
|
-
"typescript": "
|
|
47
|
+
"@types/node": "26.1.1",
|
|
48
|
+
"typescript": "7.0.2"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/fs/base64/module.f.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Standard Base64 encoding and decoding (RFC 4648).
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import { msb, length, vec, empty } from "../types/bit_vec/module.f.js";
|
|
7
|
-
import { baseN } from "../base_n/module.f.js";
|
|
8
|
-
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
9
|
-
const { popFront, concat } = msb;
|
|
10
|
-
const { vecToString, stringToVec } = baseN(6n, alphabet);
|
|
11
|
-
export const encode = (input) => {
|
|
12
|
-
const len = length(input);
|
|
13
|
-
// Base64 is a byte codec; reject non-octet-aligned inputs.
|
|
14
|
-
if (len % 8n !== 0n) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
const rem = len % 24n;
|
|
18
|
-
const padBits = rem === 0n ? 0n : 6n - rem % 6n;
|
|
19
|
-
const v = padBits > 0n ? concat(input)(vec(padBits)(0n)) : input;
|
|
20
|
-
let result = vecToString(v);
|
|
21
|
-
// Append `=` padding to make total length a multiple of 4.
|
|
22
|
-
while (result.length % 4 !== 0) {
|
|
23
|
-
result += '=';
|
|
24
|
-
}
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
export const decode = (input) => {
|
|
28
|
-
// Count and strip trailing `=` padding (0, 1, or 2).
|
|
29
|
-
let padChars = 0;
|
|
30
|
-
for (let i = input.length - 1; i >= 0 && input[i] === '='; i--) {
|
|
31
|
-
padChars++;
|
|
32
|
-
}
|
|
33
|
-
if (padChars > 2) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
const body = input.slice(0, input.length - padChars);
|
|
37
|
-
// Total chars must make a multiple of 4 with the padding.
|
|
38
|
-
if ((body.length + padChars) % 4 !== 0) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
// Decode each character to 6 bits.
|
|
42
|
-
const result = stringToVec(body);
|
|
43
|
-
if (result === null) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
// Remove the zero-padding bits introduced during encode.
|
|
47
|
-
// padChars=1 → 2 padding bits removed, padChars=2 → 4 padding bits removed.
|
|
48
|
-
const removeBits = BigInt(padChars * 2);
|
|
49
|
-
const totalBits = length(result);
|
|
50
|
-
const targetLen = totalBits - removeBits;
|
|
51
|
-
if (targetLen === 0n) {
|
|
52
|
-
return empty;
|
|
53
|
-
}
|
|
54
|
-
const [kept, padVec] = popFront(targetLen)(result);
|
|
55
|
-
// Padding bits must be zero (RFC 4648 §3.5).
|
|
56
|
-
if (removeBits > 0n && padVec !== vec(removeBits)(0n)) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
return vec(targetLen)(kept);
|
|
60
|
-
};
|
package/fs/fjs/module.f.d.ts
DELETED
package/fs/fjs/module.js
DELETED
package/fs/json/module.f.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JSON value types, rtti schemas, and utilities: `serialize`, `stringify`,
|
|
3
|
-
* `parse`, and `setProperty` for immutable nested updates.
|
|
4
|
-
*
|
|
5
|
-
* The JSON value types (`Unknown`, `Primitive`) are derived from the rtti
|
|
6
|
-
* schemas defined here, so the schema is the single source of truth — no
|
|
7
|
-
* hand-written types to keep in sync.
|
|
8
|
-
*
|
|
9
|
-
* @module
|
|
10
|
-
*/
|
|
11
|
-
import { type List } from '../types/list/module.f.ts';
|
|
12
|
-
import { type Entry as ObjectEntry } from '../types/object/module.f.ts';
|
|
13
|
-
import type { Ts } from '../types/rtti/ts/module.f.ts';
|
|
14
|
-
/** rtti schema matching any JSON primitive: `null`, `boolean`, `number`, or `string`. */
|
|
15
|
-
export declare const primitive: import("../types/rtti/module.f.ts").Or<[null, import("../types/rtti/module.f.ts").Boolean, import("../types/rtti/module.f.ts").Number, import("../types/rtti/module.f.ts").String]>;
|
|
16
|
-
/**
|
|
17
|
-
* rtti schema matching any JSON value: a primitive, an array of JSON values,
|
|
18
|
-
* or an object whose values are JSON values. Self-referential via a thunk;
|
|
19
|
-
* rtti instantiates array/record item validators lazily so recursion terminates
|
|
20
|
-
* on acyclic input.
|
|
21
|
-
*
|
|
22
|
-
* A struct field typed `unknown` is **required when present** — unlike rtti
|
|
23
|
-
* core's `unknown`, the JSON `unknown` excludes `undefined`.
|
|
24
|
-
*/
|
|
25
|
-
export declare const unknown: () => readonly ["or", import("../types/rtti/module.f.ts").Or<[null, import("../types/rtti/module.f.ts").Boolean, import("../types/rtti/module.f.ts").Number, import("../types/rtti/module.f.ts").String]>, import("../types/rtti/module.f.ts").Type1<"record", () => readonly ["or", import("../types/rtti/module.f.ts").Or<[null, import("../types/rtti/module.f.ts").Boolean, import("../types/rtti/module.f.ts").Number, import("../types/rtti/module.f.ts").String]>, import("../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>]>, import("../types/rtti/module.f.ts").Type1<"array", () => readonly ["or", import("../types/rtti/module.f.ts").Or<[null, import("../types/rtti/module.f.ts").Boolean, import("../types/rtti/module.f.ts").Number, import("../types/rtti/module.f.ts").String]>, import("../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>]>];
|
|
26
|
-
/**
|
|
27
|
-
* rtti schema matching a JSON object: `{ readonly [k: string]?: Unknown }`.
|
|
28
|
-
*/
|
|
29
|
-
export declare const object: import("../types/rtti/module.f.ts").Type1<"record", () => readonly ["or", import("../types/rtti/module.f.ts").Or<[null, import("../types/rtti/module.f.ts").Boolean, import("../types/rtti/module.f.ts").Number, import("../types/rtti/module.f.ts").String]>, import("../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>]>;
|
|
30
|
-
/** rtti schema matching a JSON array: `readonly Unknown[]`. */
|
|
31
|
-
export declare const array: import("../types/rtti/module.f.ts").Type1<"array", () => readonly ["or", import("../types/rtti/module.f.ts").Or<[null, import("../types/rtti/module.f.ts").Boolean, import("../types/rtti/module.f.ts").Number, import("../types/rtti/module.f.ts").String]>, import("../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>]>;
|
|
32
|
-
export type Primitive = Ts<typeof primitive>;
|
|
33
|
-
export type Unknown = Object | Array | Primitive;
|
|
34
|
-
export type Object = {
|
|
35
|
-
readonly [k in string]?: Unknown;
|
|
36
|
-
};
|
|
37
|
-
export type Array = readonly Unknown[];
|
|
38
|
-
export declare const setProperty: (value: Unknown) => (path: List<string>) => (src: Unknown) => Unknown;
|
|
39
|
-
export type Entry = ObjectEntry<Unknown>;
|
|
40
|
-
type Entries = List<Entry>;
|
|
41
|
-
type MapEntries = (entries: Entries) => Entries;
|
|
42
|
-
export declare const serialize: (mapEntries: MapEntries) => (value: Unknown) => List<string>;
|
|
43
|
-
/**
|
|
44
|
-
* The standard `JSON.stringify` rules determined by
|
|
45
|
-
* https://262.ecma-international.org/6.0/#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys
|
|
46
|
-
* https://tc39.es/ecma262/#sec-serializejsonproperty
|
|
47
|
-
*/
|
|
48
|
-
export declare const stringify: (mapEntries: MapEntries) => (value: Unknown) => string;
|
|
49
|
-
export declare const parse: (value: string) => Unknown;
|
|
50
|
-
export {};
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import type { Ts } from '../../types/rtti/ts/module.f.ts';
|
|
2
|
-
import type { Result } from '../../types/result/module.f.ts';
|
|
3
|
-
import { type Unknown } from '../module.f.ts';
|
|
4
|
-
export declare const jsonrpc: "2.0";
|
|
5
|
-
/** Request/response identifier: a string, a number, or `null`. */
|
|
6
|
-
declare const id: import("../../types/rtti/module.f.ts").Or<[import("../../types/rtti/module.f.ts").String, import("../../types/rtti/module.f.ts").Number, null]>;
|
|
7
|
-
/**
|
|
8
|
-
* A request or notification envelope. `id` present → request (a response is
|
|
9
|
-
* expected); `id` absent → notification (no response). `params` is optional.
|
|
10
|
-
*
|
|
11
|
-
* https://www.jsonrpc.org/specification#request_object
|
|
12
|
-
*/
|
|
13
|
-
export declare const request: {
|
|
14
|
-
readonly jsonrpc: "2.0";
|
|
15
|
-
readonly method: import("../../types/rtti/module.f.ts").String;
|
|
16
|
-
readonly params: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
17
|
-
readonly id: import("../../types/rtti/module.f.ts").Or<readonly [import("../../types/rtti/module.f.ts").Or<[import("../../types/rtti/module.f.ts").String, import("../../types/rtti/module.f.ts").Number, null]>, undefined]>;
|
|
18
|
-
};
|
|
19
|
-
/** The JSON-RPC error object. */
|
|
20
|
-
export declare const error: {
|
|
21
|
-
readonly code: import("../../types/rtti/module.f.ts").Number;
|
|
22
|
-
readonly message: import("../../types/rtti/module.f.ts").String;
|
|
23
|
-
readonly data: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
24
|
-
};
|
|
25
|
-
export type Id = Ts<typeof id>;
|
|
26
|
-
export type Request = Ts<typeof request>;
|
|
27
|
-
export type RpcError = Ts<typeof error>;
|
|
28
|
-
export declare const successResponse: {
|
|
29
|
-
readonly jsonrpc: "2.0";
|
|
30
|
-
readonly result: () => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>];
|
|
31
|
-
readonly id: import("../../types/rtti/module.f.ts").Or<[import("../../types/rtti/module.f.ts").String, import("../../types/rtti/module.f.ts").Number, null]>;
|
|
32
|
-
};
|
|
33
|
-
export declare const errorResponse: {
|
|
34
|
-
readonly jsonrpc: "2.0";
|
|
35
|
-
readonly error: {
|
|
36
|
-
readonly code: import("../../types/rtti/module.f.ts").Number;
|
|
37
|
-
readonly message: import("../../types/rtti/module.f.ts").String;
|
|
38
|
-
readonly data: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
39
|
-
};
|
|
40
|
-
readonly id: import("../../types/rtti/module.f.ts").Or<[import("../../types/rtti/module.f.ts").String, import("../../types/rtti/module.f.ts").Number, null]>;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* A response envelope: either a success (`result`) or an error (`error`).
|
|
44
|
-
* Derived from the rtti schema via `Ts<>` — the same declaration is the
|
|
45
|
-
* runtime decoder and the static type, with no drift. rtti structs are open
|
|
46
|
-
* (extra keys allowed), so "result XOR error" is not enforced at runtime; in
|
|
47
|
-
* practice the dispatcher only ever constructs one or the other.
|
|
48
|
-
*
|
|
49
|
-
* https://www.jsonrpc.org/specification#response_object
|
|
50
|
-
*/
|
|
51
|
-
export declare const response: import("../../types/rtti/module.f.ts").Or<[{
|
|
52
|
-
readonly jsonrpc: "2.0";
|
|
53
|
-
readonly result: () => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>];
|
|
54
|
-
readonly id: import("../../types/rtti/module.f.ts").Or<[import("../../types/rtti/module.f.ts").String, import("../../types/rtti/module.f.ts").Number, null]>;
|
|
55
|
-
}, {
|
|
56
|
-
readonly jsonrpc: "2.0";
|
|
57
|
-
readonly error: {
|
|
58
|
-
readonly code: import("../../types/rtti/module.f.ts").Number;
|
|
59
|
-
readonly message: import("../../types/rtti/module.f.ts").String;
|
|
60
|
-
readonly data: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
61
|
-
};
|
|
62
|
-
readonly id: import("../../types/rtti/module.f.ts").Or<[import("../../types/rtti/module.f.ts").String, import("../../types/rtti/module.f.ts").Number, null]>;
|
|
63
|
-
}]>;
|
|
64
|
-
export type Response = Ts<typeof response>;
|
|
65
|
-
/** Decodes an untrusted value as a JSON-RPC request / notification. */
|
|
66
|
-
export declare const decodeRequest: import("../../types/rtti/common/module.f.ts").Validate<{
|
|
67
|
-
readonly jsonrpc: "2.0";
|
|
68
|
-
readonly method: import("../../types/rtti/module.f.ts").String;
|
|
69
|
-
readonly params: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
70
|
-
readonly id: import("../../types/rtti/module.f.ts").Or<readonly [import("../../types/rtti/module.f.ts").Or<[import("../../types/rtti/module.f.ts").String, import("../../types/rtti/module.f.ts").Number, null]>, undefined]>;
|
|
71
|
-
}>;
|
|
72
|
-
/** A method implementation: maps `params` to a result or an `RpcError`. */
|
|
73
|
-
export type Handler = (params: Unknown | undefined) => Result<Unknown, RpcError>;
|
|
74
|
-
/** A `method` name → `Handler` map. */
|
|
75
|
-
export type Handlers = {
|
|
76
|
-
readonly [method: string]: Handler;
|
|
77
|
-
};
|
|
78
|
-
/** Builds an `RpcError` with the given `code` and `message` (no `data`). */
|
|
79
|
-
export declare const rpcError: (code: number) => (message: string) => RpcError;
|
|
80
|
-
export declare const parseError: import("../../types/rtti/ts/module.f.ts").StructTs<{
|
|
81
|
-
readonly code: import("../../types/rtti/module.f.ts").Number;
|
|
82
|
-
readonly message: import("../../types/rtti/module.f.ts").String;
|
|
83
|
-
readonly data: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
84
|
-
}>;
|
|
85
|
-
export declare const invalidRequest: import("../../types/rtti/ts/module.f.ts").StructTs<{
|
|
86
|
-
readonly code: import("../../types/rtti/module.f.ts").Number;
|
|
87
|
-
readonly message: import("../../types/rtti/module.f.ts").String;
|
|
88
|
-
readonly data: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
89
|
-
}>;
|
|
90
|
-
export declare const methodNotFound: import("../../types/rtti/ts/module.f.ts").StructTs<{
|
|
91
|
-
readonly code: import("../../types/rtti/module.f.ts").Number;
|
|
92
|
-
readonly message: import("../../types/rtti/module.f.ts").String;
|
|
93
|
-
readonly data: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
94
|
-
}>;
|
|
95
|
-
export declare const invalidParams: import("../../types/rtti/ts/module.f.ts").StructTs<{
|
|
96
|
-
readonly code: import("../../types/rtti/module.f.ts").Number;
|
|
97
|
-
readonly message: import("../../types/rtti/module.f.ts").String;
|
|
98
|
-
readonly data: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
99
|
-
}>;
|
|
100
|
-
export declare const internalError: import("../../types/rtti/ts/module.f.ts").StructTs<{
|
|
101
|
-
readonly code: import("../../types/rtti/module.f.ts").Number;
|
|
102
|
-
readonly message: import("../../types/rtti/module.f.ts").String;
|
|
103
|
-
readonly data: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
104
|
-
}>;
|
|
105
|
-
/**
|
|
106
|
-
* Dispatches an already-parsed JSON-RPC value against `handlers`.
|
|
107
|
-
*
|
|
108
|
-
* - invalid envelope → `Invalid Request` (`-32600`) with `id: null`
|
|
109
|
-
* - notification (no `id`) → `null` (never a response)
|
|
110
|
-
* - unknown method → `Method not found` (`-32601`)
|
|
111
|
-
* - otherwise the handler's `ok` / `error` result becomes a success / error response
|
|
112
|
-
*/
|
|
113
|
-
export declare const dispatch: (handlers: Handlers) => (value: Unknown) => Response | null;
|
|
114
|
-
export {};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts an rtti schema to a JSON Schema (draft 2020-12) object.
|
|
3
|
-
*
|
|
4
|
-
* Mirrors the visitor structure of `fs/types/rtti/ts/module.f.ts` (`printer` / `toTs`),
|
|
5
|
-
* but emits a JSON Schema object instead of a TypeScript type string.
|
|
6
|
-
*
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import { type Type as RttiType } from '../../types/rtti/module.f.ts';
|
|
10
|
-
import type { Ts } from '../../types/rtti/ts/module.f.ts';
|
|
11
|
-
import type { Phantom } from '../../types/phantom/module.f.ts';
|
|
12
|
-
declare const unknownThunk: () => readonly ["const", {
|
|
13
|
-
readonly type: import("../../types/rtti/module.f.ts").Or<["boolean", "number", "string", "integer", "array", "object", undefined]>;
|
|
14
|
-
readonly const: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
15
|
-
readonly not: import("../../types/rtti/module.f.ts").Or<readonly [Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>, undefined]>;
|
|
16
|
-
readonly anyOf: import("../../types/rtti/module.f.ts").Or<readonly [import("../../types/rtti/module.f.ts").Type1<"array", Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>>, undefined]>;
|
|
17
|
-
readonly items: import("../../types/rtti/module.f.ts").Or<[Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>, false, undefined]>;
|
|
18
|
-
readonly prefixItems: import("../../types/rtti/module.f.ts").Or<readonly [import("../../types/rtti/module.f.ts").Type1<"array", Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>>, undefined]>;
|
|
19
|
-
readonly properties: import("../../types/rtti/module.f.ts").Or<readonly [import("../../types/rtti/module.f.ts").Type1<"record", Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>>, undefined]>;
|
|
20
|
-
readonly required: import("../../types/rtti/module.f.ts").Or<readonly [import("../../types/rtti/module.f.ts").Type1<"array", import("../../types/rtti/module.f.ts").String>, undefined]>;
|
|
21
|
-
readonly additionalProperties: import("../../types/rtti/module.f.ts").Or<readonly [Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>, undefined]>;
|
|
22
|
-
}];
|
|
23
|
-
/** rtti schema for a JSON Schema (draft 2020-12) document. */
|
|
24
|
-
export declare const unknown: Phantom<typeof unknownThunk, UnknownConst>;
|
|
25
|
-
/** A JSON Schema (draft 2020-12) document — the subset of keywords that `toJsonSchema` emits. */
|
|
26
|
-
export type Unknown = Ts<typeof unknown>;
|
|
27
|
-
declare const unknownConst: {
|
|
28
|
-
readonly type: import("../../types/rtti/module.f.ts").Or<["boolean", "number", "string", "integer", "array", "object", undefined]>;
|
|
29
|
-
readonly const: import("../../types/rtti/module.f.ts").Or<readonly [() => readonly ["or", import("../../types/rtti/module.f.ts").Or<[null, import("../../types/rtti/module.f.ts").Boolean, import("../../types/rtti/module.f.ts").Number, import("../../types/rtti/module.f.ts").String]>, import("../../types/rtti/module.f.ts").Type1<"record", /*elided*/ any>, import("../../types/rtti/module.f.ts").Type1<"array", /*elided*/ any>], undefined]>;
|
|
30
|
-
readonly not: import("../../types/rtti/module.f.ts").Or<readonly [Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>, undefined]>;
|
|
31
|
-
readonly anyOf: import("../../types/rtti/module.f.ts").Or<readonly [import("../../types/rtti/module.f.ts").Type1<"array", Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>>, undefined]>;
|
|
32
|
-
readonly items: import("../../types/rtti/module.f.ts").Or<[Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>, false, undefined]>;
|
|
33
|
-
readonly prefixItems: import("../../types/rtti/module.f.ts").Or<readonly [import("../../types/rtti/module.f.ts").Type1<"array", Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>>, undefined]>;
|
|
34
|
-
readonly properties: import("../../types/rtti/module.f.ts").Or<readonly [import("../../types/rtti/module.f.ts").Type1<"record", Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>>, undefined]>;
|
|
35
|
-
readonly required: import("../../types/rtti/module.f.ts").Or<readonly [import("../../types/rtti/module.f.ts").Type1<"array", import("../../types/rtti/module.f.ts").String>, undefined]>;
|
|
36
|
-
readonly additionalProperties: import("../../types/rtti/module.f.ts").Or<readonly [Phantom<() => readonly ["const", /*elided*/ any], UnknownConst>, undefined]>;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Hand-written base type used as the `$out` annotation on `unknown`.
|
|
40
|
-
*
|
|
41
|
-
* The `?` markers are required even though `Ts<>` already includes `undefined`
|
|
42
|
-
* in each field type. Without `?`, `Unknown = UnknownConst` would require all
|
|
43
|
-
* 9 fields to be present in every object literal returned by `toJsonSchema`,
|
|
44
|
-
* because TypeScript distinguishes "field absent" (`?`) from "field present but
|
|
45
|
-
* undefined" (`T | undefined`). JSON Schema objects only include the fields
|
|
46
|
-
* they need, so all fields must be optional.
|
|
47
|
-
*/
|
|
48
|
-
type UnknownConst = {
|
|
49
|
-
readonly type?: Ts<typeof unknownConst.type>;
|
|
50
|
-
readonly const?: Ts<typeof unknownConst.const>;
|
|
51
|
-
readonly not?: Ts<typeof unknownConst.not>;
|
|
52
|
-
readonly anyOf?: Ts<typeof unknownConst.anyOf>;
|
|
53
|
-
readonly items?: Ts<typeof unknownConst.items>;
|
|
54
|
-
readonly prefixItems?: Ts<typeof unknownConst.prefixItems>;
|
|
55
|
-
readonly properties?: Ts<typeof unknownConst.properties>;
|
|
56
|
-
readonly required?: Ts<typeof unknownConst.required>;
|
|
57
|
-
readonly additionalProperties?: Ts<typeof unknownConst.additionalProperties>;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Converts an rtti `Type` to a JSON Schema (draft 2020-12) object.
|
|
61
|
-
*
|
|
62
|
-
* | rtti | JSON Schema |
|
|
63
|
-
* |-----------------------------------------------|-------------------------------------------------------------------------------------|
|
|
64
|
-
* | `boolean` / `number` / `string` | `{ "type": "..." }` |
|
|
65
|
-
* | `bigint` | `{ "type": "integer" }` (lossy; JSON integers are IEEE-754 doubles) |
|
|
66
|
-
* | `unknown` | `{}` (always-true schema) |
|
|
67
|
-
* | primitive const (`42`, `'x'`, `true`, `null`) | `{ "const": <value> }` |
|
|
68
|
-
* | `bigint` const | `{ "const": Number(value) }` (lossy for \|value\| > MAX_SAFE_INTEGER) |
|
|
69
|
-
* | `undefined` const | `{ "not": {} }` (no JSON value satisfies this) |
|
|
70
|
-
* | struct `{ a: T, … }` | `{ "type": "object", "properties": { "a": …T… }, "required": [non-optional keys] }` |
|
|
71
|
-
* | tuple `[A, B]` | `{ "type": "array", "prefixItems": […A…, …B…], "items": false }` |
|
|
72
|
-
* | `array(T)` | `{ "type": "array", "items": …T… }` |
|
|
73
|
-
* | `record(T)` | `{ "type": "object", "additionalProperties": …T… }` |
|
|
74
|
-
* | `or(...types)` | `{ "anyOf": […each…] }` |
|
|
75
|
-
*/
|
|
76
|
-
export declare const toJsonSchema: (rtti: RttiType) => Unknown;
|
|
77
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|