functionalscript 0.36.0 → 0.38.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/README.md +1 -1
- package/{fs → fjs}/asn.1/module.f.js +1 -1
- package/{fs → fjs}/asn.1/proof.f.js +32 -94
- package/fjs/asserts/module.f.d.ts +36 -0
- package/fjs/asserts/module.f.js +39 -0
- package/fjs/asserts/proof.f.d.ts +11 -0
- package/fjs/asserts/proof.f.js +18 -0
- package/{fs → fjs}/base_n/module.f.js +3 -3
- package/{fs → fjs}/base_n/proof.f.js +15 -39
- package/{fs → fjs/basen}/base128/module.f.d.ts +1 -1
- package/{fs → fjs/basen}/base128/module.f.js +1 -1
- package/{fs → fjs/basen}/base128/proof.f.js +3 -3
- package/{fs → fjs/basen}/base64/module.f.d.ts +2 -2
- package/{fs → fjs/basen}/base64/module.f.js +25 -15
- package/{fs → fjs/basen}/base64/proof.f.d.ts +2 -0
- package/{fs → fjs/basen}/base64/proof.f.js +26 -6
- package/{fs → fjs/basen}/cbase32/module.f.d.ts +2 -2
- package/{fs → fjs/basen}/cbase32/module.f.js +2 -2
- package/{fs → fjs/basen}/cbase32/proof.f.js +16 -43
- package/fjs/bnf/data/module.f.d.ts +52 -0
- package/{fs → fjs}/bnf/data/module.f.js +56 -6
- package/{fs → fjs}/bnf/data/proof.f.d.ts +1 -0
- package/{fs → fjs}/bnf/data/proof.f.js +59 -24
- package/{fs → fjs}/bnf/descent/module.f.d.ts +4 -14
- package/fjs/bnf/descent/module.f.js +124 -0
- package/{fs → fjs}/bnf/descent/proof.f.d.ts +1 -0
- package/{fs → fjs}/bnf/descent/proof.f.js +59 -28
- package/{fs → fjs}/bnf/ll1/module.f.d.ts +4 -4
- package/{fs → fjs}/bnf/ll1/module.f.js +15 -13
- package/{fs → fjs}/bnf/ll1/proof.f.d.ts +1 -0
- package/{fs → fjs}/bnf/ll1/proof.f.js +33 -16
- package/{fs → fjs}/bnf/module.f.d.ts +19 -5
- package/{fs → fjs}/bnf/module.f.js +14 -15
- package/fjs/bnf/proof.f.js +69 -0
- package/{fs → fjs}/bnf/testlib.f.js +2 -2
- package/{fs → fjs}/cas/cli/module.f.js +7 -7
- package/{fs → fjs}/cas/cli/proof.f.d.ts +4 -1
- package/{fs → fjs}/cas/cli/proof.f.js +37 -74
- package/fjs/cas/evo/mcp/module.f.d.ts +19 -0
- package/fjs/cas/evo/mcp/module.f.js +56 -0
- package/fjs/cas/evo/mcp/proof.f.d.ts +9 -0
- package/fjs/cas/evo/mcp/proof.f.js +95 -0
- package/fjs/cas/evo/module.f.d.ts +138 -0
- package/fjs/cas/evo/module.f.js +309 -0
- package/fjs/cas/evo/proof.f.d.ts +32 -0
- package/fjs/cas/evo/proof.f.js +453 -0
- package/fjs/cas/mcp/module.f.d.ts +49 -0
- package/fjs/cas/mcp/module.f.js +267 -0
- package/{fs → fjs}/cas/mcp/proof.f.d.ts +7 -2
- package/{fs → fjs}/cas/mcp/proof.f.js +116 -60
- package/{fs → fjs}/cas/module.f.d.ts +10 -0
- package/{fs → fjs}/cas/module.f.js +36 -10
- package/{fs → fjs}/cas/proof.f.d.ts +8 -2
- package/{fs → fjs}/cas/proof.f.js +85 -94
- package/{fs → fjs}/ci/bun/module.f.js +2 -2
- package/{fs → fjs}/ci/common/module.f.d.ts +2 -2
- package/{fs → fjs}/ci/common/module.f.js +4 -4
- package/fjs/ci/config/module.f.d.ts +42 -0
- package/{fs → fjs}/ci/config/module.f.js +6 -8
- package/fjs/ci/deno/module.f.js +20 -0
- package/{fs → fjs}/ci/module.f.js +9 -9
- package/{fs → fjs}/ci/node/module.f.d.ts +1 -1
- package/{fs → fjs}/ci/node/module.f.js +3 -5
- package/{fs → fjs}/ci/playwright/module.f.js +3 -3
- package/{fs → fjs}/ci/proof.f.js +27 -22
- package/{fs → fjs}/ci/rust/module.f.js +11 -3
- package/{fs → fjs}/cli/module.f.js +3 -3
- package/{fs → fjs}/cli/proof.f.js +25 -66
- package/{fs/types → fjs/common}/monoid/module.f.d.ts +1 -1
- package/{fs/types → fjs/common}/monoid/proof.f.js +4 -9
- package/{fs → fjs}/crypto/hmac/module.f.js +2 -2
- package/{fs → fjs}/crypto/hmac/proof.f.js +9 -17
- package/{fs → fjs}/crypto/pow/module.f.js +3 -3
- package/fjs/crypto/pow/proof.f.js +111 -0
- package/{fs → fjs}/crypto/secp/module.f.js +2 -2
- package/{fs → fjs}/crypto/secp/proof.f.js +14 -35
- package/{fs → fjs}/crypto/sha2/module.f.js +2 -2
- package/{fs → fjs}/crypto/sha2/proof.f.js +23 -54
- package/{fs → fjs}/crypto/sign/module.f.d.ts +0 -5
- package/{fs → fjs}/crypto/sign/module.f.js +11 -8
- package/{fs → fjs}/crypto/sign/proof.f.js +36 -105
- package/{fs → fjs}/crypto/vdf/module.f.js +1 -1
- package/{fs → fjs}/crypto/vdf/proof.f.js +23 -64
- package/{fs → fjs}/dev/module.f.js +6 -6
- package/{fs → fjs}/dev/package_json/module.f.js +6 -6
- package/{fs → fjs}/dev/package_json/proof.f.js +9 -9
- package/{fs → fjs}/dev/proof.f.js +3 -5
- package/{fs → fjs}/djs/ast/module.f.js +2 -2
- package/{fs → fjs}/djs/ast/proof.f.js +8 -16
- package/fjs/djs/examples/m.f.d.ts +2 -0
- package/{fs → fjs}/djs/module.f.d.ts +1 -1
- package/{fs → fjs}/djs/module.f.js +5 -5
- package/{fs → fjs}/djs/parser/module.f.d.ts +5 -0
- package/{fs → fjs}/djs/parser/module.f.js +24 -4
- package/{fs → fjs}/djs/parser/proof.f.js +145 -407
- package/{fs → fjs}/djs/proof.f.js +16 -39
- package/{fs → fjs}/djs/serializer/module.f.js +6 -6
- package/{fs → fjs}/djs/serializer/proof.f.js +18 -43
- package/fjs/djs/tokenizer/module.f.d.ts +24 -0
- package/fjs/djs/tokenizer/module.f.js +472 -0
- package/{fs/djs/tokenizer-new → fjs/djs/tokenizer}/proof.f.d.ts +4 -3
- package/{fs/djs/tokenizer-new → fjs/djs/tokenizer}/proof.f.js +447 -446
- package/{fs → fjs}/djs/transpiler/module.f.d.ts +5 -0
- package/{fs → fjs}/djs/transpiler/module.f.js +21 -11
- package/{fs → fjs}/djs/transpiler/proof.f.d.ts +3 -0
- package/fjs/djs/transpiler/proof.f.js +67 -0
- package/{fs → fjs}/effects/memory/module.f.js +4 -4
- package/{fs → fjs}/effects/memory/proof.f.js +11 -24
- package/{fs → fjs}/effects/module.f.js +1 -1
- package/{fs → fjs}/effects/node/memory/module.js +2 -2
- package/{fs → fjs}/effects/node/memory/proof.js +8 -15
- package/{fs → fjs}/effects/node/module.d.ts +1 -1
- package/{fs → fjs}/effects/node/module.f.d.ts +1 -1
- package/{fs → fjs}/effects/node/module.f.js +7 -7
- package/{fs → fjs}/effects/node/module.js +13 -13
- package/{fs → fjs}/effects/node/proof.f.d.ts +1 -0
- package/{fs → fjs}/effects/node/proof.f.js +106 -292
- package/{fs → fjs}/effects/node/virtual/module.f.js +7 -7
- package/{fs → fjs}/effects/node/virtual/proof.f.d.ts +2 -0
- package/{fs → fjs}/effects/node/virtual/proof.f.js +44 -30
- package/{fs → fjs}/effects/proof.f.js +18 -47
- package/fjs/emergent_testing/all.test.js +4 -0
- package/{fs → fjs}/emergent_testing/example.f.d.ts +1 -1
- package/{fs → fjs}/emergent_testing/module.f.js +6 -6
- package/{fs → fjs}/emergent_testing/proof.f.d.ts +19 -17
- package/{fs → fjs}/emergent_testing/proof.f.js +14 -14
- package/fjs/emergent_testing/scenarios/all.js +1 -0
- package/{fs → fjs}/fsc/bnf.f.js +2 -2
- package/{fs → fjs}/fsc/json.f.js +1 -1
- package/{fs → fjs}/fsc/module.f.js +7 -7
- package/{fs → fjs}/fsc/proof.f.js +16 -38
- package/{fs → fjs}/fsm/module.f.js +9 -9
- package/{fs → fjs}/fsm/proof.f.js +12 -19
- package/{fs → fjs}/js/tokenizer/module.f.js +7 -7
- package/{fs → fjs}/js/tokenizer/proof.f.js +5 -5
- package/{fs → fjs}/mcp/module.f.d.ts +20 -13
- package/{fs → fjs}/mcp/module.f.js +16 -9
- package/{fs → fjs}/mcp/proof.f.js +17 -17
- package/{fs → fjs}/mcp/stdio/module.f.d.ts +4 -4
- package/{fs → fjs}/mcp/stdio/module.f.js +12 -12
- package/{fs → fjs}/mcp/stdio/proof.f.js +10 -10
- package/{fs → fjs/media}/html/module.f.d.ts +3 -3
- package/{fs → fjs/media}/html/module.f.js +9 -9
- package/{fs → fjs/media}/html/proof.f.js +12 -33
- package/fjs/media/json/module.f.d.ts +50 -0
- package/{fs → fjs/media}/json/module.f.js +7 -7
- package/{fs → fjs/media}/json/parser/module.f.d.ts +7 -2
- package/{fs → fjs/media}/json/parser/module.f.js +21 -7
- package/{fs → fjs/media}/json/parser/proof.f.js +45 -120
- package/{fs → fjs/media}/json/proof.f.js +4 -4
- package/fjs/media/json/rpc/module.f.d.ts +114 -0
- package/{fs → fjs/media}/json/rpc/module.f.js +4 -4
- package/{fs → fjs/media}/json/rpc/proof.f.js +4 -4
- package/fjs/media/json/schema/module.f.d.ts +78 -0
- package/{fs → fjs/media}/json/schema/module.f.js +25 -41
- package/{fs → fjs/media}/json/schema/proof.f.js +6 -9
- package/{fs → fjs/media}/json/serializer/module.f.d.ts +1 -1
- package/{fs → fjs/media}/json/serializer/module.f.js +2 -2
- package/{fs → fjs/media}/json/serializer/proof.f.js +12 -29
- package/{fs → fjs/media}/json/tokenizer/module.f.d.ts +2 -2
- package/{fs → fjs/media}/json/tokenizer/module.f.js +4 -4
- package/{fs → fjs/media}/json/tokenizer/proof.f.js +5 -5
- package/fjs/media/module.f.d.ts +37 -0
- package/fjs/media/module.f.js +23 -0
- package/fjs/media/proof.f.d.ts +9 -0
- package/fjs/media/proof.f.js +58 -0
- package/fjs/media/revision/module.f.d.ts +78 -0
- package/fjs/media/revision/module.f.js +122 -0
- package/fjs/media/revision/proof.f.d.ts +31 -0
- package/fjs/media/revision/proof.f.js +140 -0
- package/{fs/mime → fjs/media/type}/module.f.d.ts +6 -6
- package/{fs/mime → fjs/media/type}/module.f.js +6 -6
- package/{fs/mime → fjs/media/type}/proof.f.js +8 -12
- package/fjs/module.f.d.ts +2 -0
- package/{fs/fjs → fjs}/module.f.js +9 -9
- package/fjs/module.js +4 -0
- package/{fs → fjs}/path/module.f.js +2 -2
- package/{fs → fjs}/path/proof.f.js +27 -78
- package/{fs/fjs → fjs}/proof.f.js +6 -4
- package/{fs → fjs}/sul/id/module.f.js +9 -9
- package/{fs → fjs}/sul/id/proof.f.js +12 -26
- package/{fs → fjs}/sul/level/hash/module.f.js +3 -3
- package/{fs → fjs}/sul/level/hash/proof.f.js +8 -8
- package/{fs → fjs}/sul/level/literal/module.f.js +5 -5
- package/{fs → fjs}/sul/level/literal/proof.f.js +15 -29
- package/{fs → fjs}/sul/module.f.js +3 -3
- package/{fs → fjs}/sul/proof.f.js +3 -3
- package/fjs/text/ascii/proof.f.d.ts +6 -0
- package/fjs/text/ascii/proof.f.js +14 -0
- package/{fs → fjs}/text/code_point/module.f.js +12 -12
- package/{fs → fjs}/text/code_point/proof.f.js +1 -1
- package/{fs → fjs}/text/module.f.js +5 -5
- package/{fs → fjs}/text/proof.f.js +7 -12
- package/{fs → fjs}/text/sgr/module.f.js +2 -2
- package/{fs → fjs}/text/sgr/proof.f.js +8 -17
- package/{fs → fjs}/text/utf16/module.f.js +6 -6
- package/{fs → fjs}/text/utf16/proof.f.js +27 -70
- package/{fs → fjs}/text/utf8/module.f.js +22 -17
- package/{fs → fjs}/text/utf8/proof.f.js +59 -128
- package/{fs → fjs}/types/array/module.f.js +1 -1
- package/{fs → fjs}/types/array/proof.f.js +21 -55
- package/{fs → fjs}/types/bigfloat/module.f.js +1 -1
- package/fjs/types/bigfloat/proof.f.js +217 -0
- package/{fs → fjs}/types/bigint/module.f.js +2 -2
- package/{fs → fjs}/types/bigint/proof.f.js +51 -147
- package/{fs → fjs}/types/bit_vec/module.f.js +8 -8
- package/{fs → fjs}/types/bit_vec/proof.f.js +76 -218
- package/{fs → fjs}/types/btree/find/module.f.js +1 -1
- package/fjs/types/btree/find/proof.f.d.ts +3 -0
- package/fjs/types/btree/find/proof.f.js +108 -0
- package/{fs → fjs}/types/btree/module.f.js +2 -2
- package/fjs/types/btree/proof.f.d.ts +13 -0
- package/{fs → fjs}/types/btree/proof.f.js +12 -19
- package/{fs → fjs}/types/btree/remove/module.f.js +4 -4
- package/fjs/types/btree/remove/proof.f.d.ts +9 -0
- package/{fs → fjs}/types/btree/remove/proof.f.js +88 -235
- package/{fs → fjs}/types/btree/set/module.f.js +8 -5
- package/{fs → fjs}/types/btree/set/proof.f.js +39 -28
- package/{fs → fjs}/types/byte_set/module.f.js +2 -2
- package/fjs/types/byte_set/proof.f.js +79 -0
- package/{fs → fjs}/types/function/compare/proof.f.js +14 -37
- package/fjs/types/function/operator/proof.f.d.ts +23 -0
- package/{fs → fjs}/types/function/operator/proof.f.js +18 -49
- package/{fs → fjs}/types/function/proof.f.js +3 -4
- package/{fs → fjs}/types/list/module.f.js +2 -2
- package/fjs/types/list/proof.f.d.ts +30 -0
- package/{fs → fjs}/types/list/proof.f.js +59 -167
- package/{fs → fjs}/types/map/proof.f.js +6 -14
- package/fjs/types/nibble_set/proof.f.js +60 -0
- package/{fs → fjs}/types/nominal/proof.f.js +5 -10
- package/{fs → fjs}/types/nullable/module.f.js +2 -2
- package/fjs/types/nullable/proof.f.js +29 -0
- package/{fs → fjs}/types/number/module.f.js +5 -5
- package/{fs → fjs}/types/number/proof.f.js +10 -25
- package/{fs → fjs}/types/object/module.f.js +4 -4
- package/{fs → fjs}/types/object/proof.f.js +4 -7
- package/{fs → fjs}/types/ordered_map/module.f.js +6 -6
- package/{fs → fjs}/types/ordered_map/proof.f.js +3 -3
- package/fjs/types/patricia_trie/proof.f.d.ts +13 -0
- package/{fs → fjs}/types/patricia_trie/proof.f.js +22 -22
- package/{fs → fjs}/types/prime_field/module.f.js +3 -8
- package/{fs → fjs}/types/prime_field/proof.f.js +2 -2
- package/{fs → fjs}/types/range/module.f.d.ts +1 -1
- package/fjs/types/range/module.f.js +2 -0
- package/fjs/types/range/proof.f.js +9 -0
- package/{fs → fjs}/types/range_map/module.f.js +4 -4
- package/{fs → fjs}/types/range_map/proof.f.js +35 -88
- package/{fs → fjs}/types/result/module.js +1 -1
- package/fjs/types/result/proof.f.d.ts +12 -0
- package/fjs/types/result/proof.f.js +31 -0
- package/{fs → fjs}/types/rtti/common/module.f.d.ts +36 -1
- package/{fs → fjs}/types/rtti/common/module.f.js +48 -4
- package/fjs/types/rtti/common/proof.f.d.ts +8 -0
- package/fjs/types/rtti/common/proof.f.js +51 -0
- package/{fs → fjs}/types/rtti/module.f.d.ts +2 -2
- package/{fs → fjs}/types/rtti/module.f.js +1 -1
- package/{fs → fjs}/types/rtti/parse/module.f.js +16 -25
- package/{fs → fjs}/types/rtti/parse/proof.f.js +9 -20
- package/{fs → fjs}/types/rtti/ts/module.f.d.ts +10 -4
- package/{fs → fjs}/types/rtti/ts/module.f.js +1 -1
- package/{fs → fjs}/types/rtti/ts/proof.f.js +2 -2
- package/{fs → fjs}/types/rtti/validate/module.f.js +11 -32
- package/{fs → fjs}/types/rtti/validate/proof.f.js +6 -11
- package/{fs → fjs}/types/sorted_list/module.f.js +3 -3
- package/{fs → fjs}/types/sorted_list/proof.f.js +14 -27
- package/{fs → fjs}/types/sorted_set/module.f.js +1 -1
- package/{fs → fjs}/types/sorted_set/proof.f.js +20 -45
- package/{fs → fjs}/types/string/module.f.js +4 -4
- package/fjs/types/string/proof.f.js +77 -0
- package/{fs → fjs}/types/string_set/module.f.js +6 -6
- package/fjs/types/string_set/proof.f.js +43 -0
- package/{fs → fjs}/types/ts/proof.f.d.ts +18 -18
- package/{fs → fjs}/types/ts/proof.f.js +16 -43
- package/{fs → fjs}/types/uint8array/module.f.js +10 -10
- package/{fs → fjs}/types/uint8array/proof.f.d.ts +4 -1
- package/{fs → fjs}/types/uint8array/proof.f.js +11 -11
- package/{fs → fjs}/website/module.f.js +3 -3
- package/fjs/website/proof.f.js +13 -0
- package/package.json +8 -8
- package/fs/asserts/module.f.d.ts +0 -4
- package/fs/asserts/module.f.js +0 -9
- package/fs/asserts/proof.f.d.ts +0 -8
- package/fs/asserts/proof.f.js +0 -51
- package/fs/bnf/data/module.f.d.ts +0 -30
- package/fs/bnf/descent/module.f.js +0 -119
- package/fs/bnf/proof.f.js +0 -104
- package/fs/cas/mcp/module.f.d.ts +0 -36
- package/fs/cas/mcp/module.f.js +0 -249
- package/fs/ci/config/module.f.d.ts +0 -43
- package/fs/ci/deno/module.f.js +0 -16
- package/fs/crypto/pow/proof.f.js +0 -161
- package/fs/djs/examples/m.f.d.ts +0 -2
- package/fs/djs/tokenizer/module.f.d.ts +0 -12
- package/fs/djs/tokenizer/module.f.js +0 -62
- package/fs/djs/tokenizer/proof.f.d.ts +0 -7
- package/fs/djs/tokenizer/proof.f.js +0 -543
- package/fs/djs/tokenizer-new/module.f.d.ts +0 -3
- package/fs/djs/tokenizer-new/module.f.js +0 -155
- package/fs/djs/transpiler/proof.f.js +0 -68
- package/fs/emergent_testing/all.test.js +0 -4
- package/fs/emergent_testing/scenarios/all.js +0 -1
- 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/text/ascii/proof.f.d.ts +0 -4
- package/fs/text/ascii/proof.f.js +0 -24
- package/fs/types/bigfloat/proof.f.js +0 -348
- package/fs/types/btree/find/proof.f.js +0 -151
- package/fs/types/btree/proof.f.d.ts +0 -7
- package/fs/types/btree/remove/proof.f.d.ts +0 -4
- package/fs/types/byte_set/proof.f.js +0 -120
- package/fs/types/function/operator/proof.f.d.ts +0 -12
- package/fs/types/list/proof.f.d.ts +0 -22
- package/fs/types/nibble_set/proof.f.js +0 -89
- package/fs/types/nullable/proof.f.js +0 -50
- package/fs/types/patricia_trie/proof.f.d.ts +0 -7
- package/fs/types/range/module.f.js +0 -2
- package/fs/types/range/proof.f.d.ts +0 -1
- package/fs/types/range/proof.f.js +0 -18
- package/fs/types/result/proof.f.d.ts +0 -6
- package/fs/types/result/proof.f.js +0 -52
- package/fs/types/string/proof.f.js +0 -118
- package/fs/types/string_set/proof.f.js +0 -82
- package/fs/website/proof.f.js +0 -16
- /package/{fs → fjs}/asn.1/module.f.d.ts +0 -0
- /package/{fs → fjs}/asn.1/proof.f.d.ts +0 -0
- /package/{fs → fjs}/base_n/module.f.d.ts +0 -0
- /package/{fs → fjs}/base_n/proof.f.d.ts +0 -0
- /package/{fs → fjs/basen}/base128/proof.f.d.ts +0 -0
- /package/{fs → fjs/basen}/cbase32/proof.f.d.ts +0 -0
- /package/{fs → fjs}/bnf/proof.f.d.ts +0 -0
- /package/{fs → fjs}/bnf/testlib.f.d.ts +0 -0
- /package/{fs → fjs}/cas/cli/module.f.d.ts +0 -0
- /package/{fs → fjs}/ci/bun/module.f.d.ts +0 -0
- /package/{fs → fjs}/ci/deno/module.f.d.ts +0 -0
- /package/{fs → fjs}/ci/module.f.d.ts +0 -0
- /package/{fs → fjs}/ci/playwright/module.f.d.ts +0 -0
- /package/{fs → fjs}/ci/proof.f.d.ts +0 -0
- /package/{fs → fjs}/ci/rust/module.f.d.ts +0 -0
- /package/{fs → fjs}/cli/module.f.d.ts +0 -0
- /package/{fs → fjs}/cli/proof.f.d.ts +0 -0
- /package/{fs/types → fjs/common}/monoid/module.f.js +0 -0
- /package/{fs/types → fjs/common}/monoid/proof.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/hmac/module.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/hmac/proof.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/pow/module.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/pow/proof.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/secp/module.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/secp/proof.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/sha2/module.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/sha2/proof.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/sign/proof.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/vdf/module.f.d.ts +0 -0
- /package/{fs → fjs}/crypto/vdf/proof.f.d.ts +0 -0
- /package/{fs → fjs}/dev/module.f.d.ts +0 -0
- /package/{fs → fjs}/dev/package_json/module.f.d.ts +0 -0
- /package/{fs → fjs}/dev/package_json/proof.f.d.ts +0 -0
- /package/{fs → fjs}/dev/proof.f.d.ts +0 -0
- /package/{fs → fjs}/djs/ast/module.f.d.ts +0 -0
- /package/{fs → fjs}/djs/ast/proof.f.d.ts +0 -0
- /package/{fs → fjs}/djs/examples/input.f.d.ts +0 -0
- /package/{fs → fjs}/djs/examples/input.f.js +0 -0
- /package/{fs → fjs}/djs/examples/m.f.js +0 -0
- /package/{fs → fjs}/djs/parser/proof.f.d.ts +0 -0
- /package/{fs → fjs}/djs/proof.f.d.ts +0 -0
- /package/{fs → fjs}/djs/serializer/module.f.d.ts +0 -0
- /package/{fs → fjs}/djs/serializer/proof.f.d.ts +0 -0
- /package/{fs → fjs}/effects/list/module.f.d.ts +0 -0
- /package/{fs → fjs}/effects/list/module.f.js +0 -0
- /package/{fs → fjs}/effects/memory/module.f.d.ts +0 -0
- /package/{fs → fjs}/effects/memory/proof.f.d.ts +0 -0
- /package/{fs → fjs}/effects/mock/module.f.d.ts +0 -0
- /package/{fs → fjs}/effects/mock/module.f.js +0 -0
- /package/{fs → fjs}/effects/module.d.ts +0 -0
- /package/{fs → fjs}/effects/module.f.d.ts +0 -0
- /package/{fs → fjs}/effects/module.js +0 -0
- /package/{fs → fjs}/effects/node/memory/module.d.ts +0 -0
- /package/{fs → fjs}/effects/node/memory/proof.d.ts +0 -0
- /package/{fs → fjs}/effects/node/virtual/module.f.d.ts +0 -0
- /package/{fs → fjs}/effects/proof.f.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/all.test.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/example.f.js +0 -0
- /package/{fs → fjs}/emergent_testing/module.f.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/all.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/async-subtests.fail.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/async-subtests.fail.js +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/async-subtests.pass.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/async-subtests.pass.js +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/async.fail.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/async.fail.js +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/async.pass.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/async.pass.js +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/fail.fail.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/fail.fail.js +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/return-value.pass.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/return-value.pass.js +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/thenable.pass.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/thenable.pass.js +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/thenable2.pass.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/thenable2.pass.js +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/throw.pass.d.ts +0 -0
- /package/{fs → fjs}/emergent_testing/scenarios/throw.pass.js +0 -0
- /package/{fs → fjs}/fsc/bnf.f.d.ts +0 -0
- /package/{fs → fjs}/fsc/json.f.d.ts +0 -0
- /package/{fs → fjs}/fsc/module.f.d.ts +0 -0
- /package/{fs → fjs}/fsc/proof.f.d.ts +0 -0
- /package/{fs → fjs}/fsm/module.f.d.ts +0 -0
- /package/{fs → fjs}/fsm/proof.f.d.ts +0 -0
- /package/{fs → fjs}/js/tokenizer/module.f.d.ts +0 -0
- /package/{fs → fjs}/js/tokenizer/proof.f.d.ts +0 -0
- /package/{fs → fjs}/mcp/proof.f.d.ts +0 -0
- /package/{fs → fjs}/mcp/stdio/proof.f.d.ts +0 -0
- /package/{fs → fjs/media}/html/proof.f.d.ts +0 -0
- /package/{fs → fjs/media}/json/parser/proof.f.d.ts +0 -0
- /package/{fs → fjs/media}/json/proof.f.d.ts +0 -0
- /package/{fs → fjs/media}/json/rpc/proof.f.d.ts +0 -0
- /package/{fs → fjs/media}/json/schema/proof.f.d.ts +0 -0
- /package/{fs → fjs/media}/json/serializer/proof.f.d.ts +0 -0
- /package/{fs → fjs/media}/json/tokenizer/proof.f.d.ts +0 -0
- /package/{fs/mime → fjs/media/type}/proof.f.d.ts +0 -0
- /package/{fs/fjs → fjs}/module.d.ts +0 -0
- /package/{fs → fjs}/path/module.f.d.ts +0 -0
- /package/{fs → fjs}/path/proof.f.d.ts +0 -0
- /package/{fs/fjs → fjs}/proof.f.d.ts +0 -0
- /package/{fs → fjs}/sul/id/module.f.d.ts +0 -0
- /package/{fs → fjs}/sul/id/proof.f.d.ts +0 -0
- /package/{fs → fjs}/sul/level/hash/module.f.d.ts +0 -0
- /package/{fs → fjs}/sul/level/hash/proof.f.d.ts +0 -0
- /package/{fs → fjs}/sul/level/literal/module.f.d.ts +0 -0
- /package/{fs → fjs}/sul/level/literal/proof.f.d.ts +0 -0
- /package/{fs → fjs}/sul/module.f.d.ts +0 -0
- /package/{fs → fjs}/sul/proof.f.d.ts +0 -0
- /package/{fs → fjs}/text/ascii/module.f.d.ts +0 -0
- /package/{fs → fjs}/text/ascii/module.f.js +0 -0
- /package/{fs → fjs}/text/code_point/module.f.d.ts +0 -0
- /package/{fs → fjs}/text/code_point/proof.f.d.ts +0 -0
- /package/{fs → fjs}/text/module.f.d.ts +0 -0
- /package/{fs → fjs}/text/proof.f.d.ts +0 -0
- /package/{fs → fjs}/text/sgr/module.f.d.ts +0 -0
- /package/{fs → fjs}/text/sgr/proof.f.d.ts +0 -0
- /package/{fs → fjs}/text/utf16/module.f.d.ts +0 -0
- /package/{fs → fjs}/text/utf16/proof.f.d.ts +0 -0
- /package/{fs → fjs}/text/utf8/module.f.d.ts +0 -0
- /package/{fs → fjs}/text/utf8/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/array/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/array/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/bigfloat/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/bigfloat/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/bigint/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/bigint/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/bit_vec/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/bit_vec/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/btree/find/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/btree/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/btree/remove/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/btree/set/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/btree/set/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/btree/types/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/btree/types/module.f.js +0 -0
- /package/{fs → fjs}/types/byte_set/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/byte_set/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/function/compare/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/function/compare/module.f.js +0 -0
- /package/{fs/types/btree/find → fjs/types/function/compare}/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/function/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/function/module.f.js +0 -0
- /package/{fs → fjs}/types/function/operator/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/function/operator/module.f.js +0 -0
- /package/{fs/types/function/compare → fjs/types/function}/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/list/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/map/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/map/module.f.js +0 -0
- /package/{fs → fjs}/types/map/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/nibble_set/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/nibble_set/module.f.js +0 -0
- /package/{fs → fjs}/types/nibble_set/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/nominal/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/nominal/module.f.js +0 -0
- /package/{fs → fjs}/types/nominal/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/nullable/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/nullable/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/number/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/number/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/object/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/object/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/option/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/option/module.f.js +0 -0
- /package/{fs → fjs}/types/ordered_map/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/ordered_map/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/patricia_trie/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/patricia_trie/module.f.js +0 -0
- /package/{fs → fjs}/types/phantom/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/phantom/module.f.js +0 -0
- /package/{fs → fjs}/types/prime_field/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/prime_field/proof.f.d.ts +0 -0
- /package/{fs/types/function → fjs/types/range}/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/range_map/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/range_map/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/result/module.d.ts +0 -0
- /package/{fs → fjs}/types/result/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/result/module.f.js +0 -0
- /package/{fs → fjs}/types/rtti/parse/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/rtti/parse/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/rtti/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/rtti/proof.f.js +0 -0
- /package/{fs → fjs}/types/rtti/ts/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/rtti/validate/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/rtti/validate/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/sorted_list/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/sorted_list/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/sorted_set/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/sorted_set/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/string/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/string/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/string_set/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/string_set/proof.f.d.ts +0 -0
- /package/{fs → fjs}/types/ts/module.f.d.ts +0 -0
- /package/{fs → fjs}/types/ts/module.f.js +0 -0
- /package/{fs → fjs}/types/uint8array/module.f.d.ts +0 -0
- /package/{fs → fjs}/website/module.f.d.ts +0 -0
- /package/{fs → fjs}/website/proof.f.d.ts +0 -0
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Experimental DJS parser implementation.
|
|
3
|
-
*
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import { descentParser } from "../../bnf/descent/module.f.js";
|
|
7
|
-
import { eof, join0Plus, max, none, not, notSet, oneEncode, option, range, remove, repeat, repeat0Plus, repeat1Plus, set, unicodeRange } from "../../bnf/module.f.js";
|
|
8
|
-
import { todo } from "../../asserts/module.f.js";
|
|
9
|
-
export const parse = (input) => {
|
|
10
|
-
const m = descentParser(jsGrammar());
|
|
11
|
-
return todo();
|
|
12
|
-
};
|
|
13
|
-
export const jsGrammar = () => {
|
|
14
|
-
const onenine = range('19');
|
|
15
|
-
const digit = range('09');
|
|
16
|
-
const string = [
|
|
17
|
-
'"',
|
|
18
|
-
repeat0Plus({
|
|
19
|
-
...remove(range(` ${max}`), set('"\\')),
|
|
20
|
-
escape: [
|
|
21
|
-
'\\',
|
|
22
|
-
{
|
|
23
|
-
...set('"\\bfnrt'),
|
|
24
|
-
solidus: '/',
|
|
25
|
-
u: [
|
|
26
|
-
'u',
|
|
27
|
-
...repeat(4)({
|
|
28
|
-
digit,
|
|
29
|
-
AF: range('AF'),
|
|
30
|
-
af: range('af'),
|
|
31
|
-
})
|
|
32
|
-
],
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
}),
|
|
36
|
-
'"'
|
|
37
|
-
];
|
|
38
|
-
const digits0 = repeat0Plus(digit);
|
|
39
|
-
const digits = [digit, digits0];
|
|
40
|
-
const number = [
|
|
41
|
-
{
|
|
42
|
-
0: '0',
|
|
43
|
-
onenine: [onenine, digits0],
|
|
44
|
-
},
|
|
45
|
-
option({
|
|
46
|
-
bigint: 'n',
|
|
47
|
-
frac: [
|
|
48
|
-
option(['.', digits]),
|
|
49
|
-
option([set('Ee'), option(set('+-')), digits])
|
|
50
|
-
]
|
|
51
|
-
})
|
|
52
|
-
];
|
|
53
|
-
const ws = set(' \t');
|
|
54
|
-
const newLine = set('\n\r');
|
|
55
|
-
const idStart = {
|
|
56
|
-
smallLetter: range('az'),
|
|
57
|
-
bigLetter: range('AZ'),
|
|
58
|
-
lowLine: '_',
|
|
59
|
-
dollarSign: '$'
|
|
60
|
-
};
|
|
61
|
-
const idChar = {
|
|
62
|
-
...idStart,
|
|
63
|
-
digit
|
|
64
|
-
};
|
|
65
|
-
const id = [idStart, repeat0Plus(idChar)];
|
|
66
|
-
const operator = {
|
|
67
|
-
'.': '.',
|
|
68
|
-
'=>': '=>',
|
|
69
|
-
'===': '===',
|
|
70
|
-
'==': '==',
|
|
71
|
-
'=': '=',
|
|
72
|
-
'!==': '!==',
|
|
73
|
-
'!=': '!=',
|
|
74
|
-
'!': '!',
|
|
75
|
-
'>>>=': '>>>=',
|
|
76
|
-
'>>>': '>>>',
|
|
77
|
-
'>>=': '>>=',
|
|
78
|
-
'>>': '>>',
|
|
79
|
-
'>=': '>=',
|
|
80
|
-
'>': '>',
|
|
81
|
-
'<<<<=': '<<<=',
|
|
82
|
-
'<<<': '<<<',
|
|
83
|
-
'<<=': '<<=',
|
|
84
|
-
'<<': '<<',
|
|
85
|
-
'<=': '<=',
|
|
86
|
-
'<': '<',
|
|
87
|
-
'+=': '+=',
|
|
88
|
-
'++': '++',
|
|
89
|
-
'+': '+',
|
|
90
|
-
'-=': '-=',
|
|
91
|
-
'--': '--',
|
|
92
|
-
'-': '-',
|
|
93
|
-
'**=': '**=',
|
|
94
|
-
'**': '**',
|
|
95
|
-
'*=': '*=',
|
|
96
|
-
'*': '*',
|
|
97
|
-
'/=': '/=',
|
|
98
|
-
'/': '/',
|
|
99
|
-
'%=': '%=',
|
|
100
|
-
'%': '%',
|
|
101
|
-
'&&=': '&&=',
|
|
102
|
-
'&&': '&&',
|
|
103
|
-
'&=': '&=',
|
|
104
|
-
'&': '&',
|
|
105
|
-
'||=': '||=',
|
|
106
|
-
'||': '||',
|
|
107
|
-
'|=': '|=',
|
|
108
|
-
'|': '|',
|
|
109
|
-
'^=': '^=',
|
|
110
|
-
'^': '^',
|
|
111
|
-
'~': '~',
|
|
112
|
-
'??=': '??=',
|
|
113
|
-
'??': '??',
|
|
114
|
-
'?.': '?.',
|
|
115
|
-
'?': '?',
|
|
116
|
-
'[': '[',
|
|
117
|
-
']': ']',
|
|
118
|
-
'{': '{',
|
|
119
|
-
'}': '}',
|
|
120
|
-
'(': '(',
|
|
121
|
-
')': ')',
|
|
122
|
-
',': ',',
|
|
123
|
-
':': ':'
|
|
124
|
-
};
|
|
125
|
-
const commentEnd = {
|
|
126
|
-
...newLine,
|
|
127
|
-
eof
|
|
128
|
-
};
|
|
129
|
-
const comment = ['/', {
|
|
130
|
-
// TODO: investigate why `not(commentEnd)` instead of `remove(unicodeRange, newLine)` fail tests.
|
|
131
|
-
// TODO: should it be `repeat0Plus(not(commentEnd))` instead of `option(remove(unicodeRange, newLine))`.
|
|
132
|
-
oneline: ['/', option(remove(unicodeRange, newLine)), commentEnd],
|
|
133
|
-
multiline: [
|
|
134
|
-
'*',
|
|
135
|
-
repeat0Plus({
|
|
136
|
-
na: notSet('*'),
|
|
137
|
-
a: ['*', notSet('/')]
|
|
138
|
-
}),
|
|
139
|
-
'*/'
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
];
|
|
143
|
-
const token = {
|
|
144
|
-
number,
|
|
145
|
-
string,
|
|
146
|
-
id,
|
|
147
|
-
comment,
|
|
148
|
-
operator,
|
|
149
|
-
ws,
|
|
150
|
-
newLine,
|
|
151
|
-
eof
|
|
152
|
-
};
|
|
153
|
-
const tokens = repeat0Plus(token);
|
|
154
|
-
return tokens;
|
|
155
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { sort } from "../../types/object/module.f.js";
|
|
2
|
-
import { transpile } from "./module.f.js";
|
|
3
|
-
import { stringifyAsTree } from "../serializer/module.f.js";
|
|
4
|
-
import { virtual, emptyState } from "../../effects/node/virtual/module.f.js";
|
|
5
|
-
import { utf8 } from "../../text/module.f.js";
|
|
6
|
-
const run = (root) => (path) => {
|
|
7
|
-
const [_, result] = virtual({ ...emptyState, root })(transpile(path));
|
|
8
|
-
return result;
|
|
9
|
-
};
|
|
10
|
-
export const proof = {
|
|
11
|
-
parse: () => {
|
|
12
|
-
const result = run({ a: [utf8('export default 1')] })('a');
|
|
13
|
-
if (result[0] === 'error') {
|
|
14
|
-
throw result[1];
|
|
15
|
-
}
|
|
16
|
-
const s = stringifyAsTree(sort)(result[1]);
|
|
17
|
-
if (s !== '1') {
|
|
18
|
-
throw s;
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
parseWithSubModule: () => {
|
|
22
|
-
const result = run({ a: { b: [utf8('import c from "c"\nexport default c')], c: [utf8('export default 2')] } })('a/b');
|
|
23
|
-
if (result[0] === 'error') {
|
|
24
|
-
throw result[1];
|
|
25
|
-
}
|
|
26
|
-
const s = stringifyAsTree(sort)(result[1]);
|
|
27
|
-
if (s !== '2') {
|
|
28
|
-
throw s;
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
parseWithSubModules: () => {
|
|
32
|
-
const result = run({
|
|
33
|
-
a: [utf8('import b from "b"\nimport c from "c"\nexport default [b,c,b]')],
|
|
34
|
-
b: [utf8('import d from "d"\nexport default [0,d]')],
|
|
35
|
-
c: [utf8('import d from "d"\nexport default [1,d]')],
|
|
36
|
-
d: [utf8('export default 2')],
|
|
37
|
-
})('a');
|
|
38
|
-
if (result[0] === 'error') {
|
|
39
|
-
throw result[1];
|
|
40
|
-
}
|
|
41
|
-
const s = stringifyAsTree(sort)(result[1]);
|
|
42
|
-
if (s !== '[[0,2],[1,2],[0,2]]') {
|
|
43
|
-
throw s;
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
parseWithFileNotFoundError: () => {
|
|
47
|
-
const result = run({ a: [utf8('import b from "b"\nexport default b')] })('a');
|
|
48
|
-
if (result[0] !== 'error') {
|
|
49
|
-
throw result;
|
|
50
|
-
}
|
|
51
|
-
if (result[1].message !== 'file not found') {
|
|
52
|
-
throw result;
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
parseWithCycleError: () => {
|
|
56
|
-
const result = run({
|
|
57
|
-
a: [utf8('import b from "b"\nimport c from "c"\nexport default [b,c,b]')],
|
|
58
|
-
b: [utf8('import c from "c"\nexport default c')],
|
|
59
|
-
c: [utf8('import b from "b"\nexport default b')],
|
|
60
|
-
})('a');
|
|
61
|
-
if (result[0] !== 'error') {
|
|
62
|
-
throw result;
|
|
63
|
-
}
|
|
64
|
-
if (result[1].message !== 'circular dependency') {
|
|
65
|
-
throw result;
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../all.test.js";
|
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 {};
|
package/fs/text/ascii/proof.f.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { one, range } from "./module.f.js";
|
|
2
|
-
import { stringify as jsonStringify } from "../../json/module.f.js";
|
|
3
|
-
import { sort } from "../../types/object/module.f.js";
|
|
4
|
-
const stringify = jsonStringify(sort);
|
|
5
|
-
export const proof = {
|
|
6
|
-
range: () => {
|
|
7
|
-
const r = stringify(range("A"));
|
|
8
|
-
if (r !== '[65,65]') {
|
|
9
|
-
throw r;
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
oneThrowsOnEmpty: () => {
|
|
13
|
-
let threw = false;
|
|
14
|
-
try {
|
|
15
|
-
one('');
|
|
16
|
-
}
|
|
17
|
-
catch (_) {
|
|
18
|
-
threw = true;
|
|
19
|
-
}
|
|
20
|
-
if (!threw) {
|
|
21
|
-
throw 'expected throw';
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
};
|