functionalscript 0.1.609 → 0.2.1
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/com/cpp/module.f.mjs +20 -25
- package/com/cpp/testlib.f.mjs +3 -4
- package/com/cs/module.f.mjs +18 -23
- package/com/cs/testlib.f.mjs +3 -5
- package/com/rust/module.f.mjs +25 -30
- package/com/rust/testlib.f.mjs +3 -5
- package/com/test/build.f.mjs +2 -2
- package/com/test/build.mjs +4 -4
- package/com/types/module.f.mjs +5 -12
- package/commonjs/build/module.f.mjs +23 -28
- package/commonjs/build/test.f.mjs +4 -4
- package/commonjs/module/function/module.f.mjs +0 -2
- package/commonjs/module/module.f.mjs +2 -9
- package/commonjs/module.f.mjs +0 -2
- package/commonjs/module.mjs +2 -7
- package/commonjs/package/dependencies/module.f.mjs +5 -10
- package/commonjs/package/dependencies/test.f.mjs +1 -1
- package/commonjs/package/module.f.mjs +6 -13
- package/commonjs/package/test.f.mjs +1 -1
- package/commonjs/path/module.f.mjs +12 -23
- package/commonjs/path/test.f.mjs +11 -11
- package/commonjs/test.mjs +1 -1
- package/dev/module.f.mjs +1 -4
- package/dev/module.mjs +1 -1
- package/dev/test/module.f.mjs +4 -6
- package/djs/module.f.mjs +12 -19
- package/djs/parser/module.f.mjs +18 -24
- package/djs/parser/test.f.mjs +9 -9
- package/djs/test.f.mjs +4 -4
- package/djs/tokenizer/module.f.mjs +18 -23
- package/djs/tokenizer/test.f.mjs +6 -6
- package/fsc/module.f.mjs +17 -24
- package/fsc/test.f.mjs +3 -3
- package/fsm/module.f.mjs +27 -38
- package/fsm/test.f.mjs +8 -8
- package/html/module.f.mjs +14 -23
- package/html/test.f.mjs +4 -4
- package/js/tokenizer/module.f.mjs +55 -62
- package/js/tokenizer/test.f.mjs +6 -6
- package/json/module.f.mjs +18 -31
- package/json/parser/module.f.mjs +9 -14
- package/json/parser/test.f.mjs +7 -7
- package/json/serializer/module.f.mjs +14 -29
- package/json/serializer/test.f.mjs +2 -2
- package/json/test.f.mjs +3 -3
- package/json/tokenizer/module.f.mjs +14 -19
- package/json/tokenizer/test.f.mjs +6 -6
- package/jsr.json +59 -59
- package/nodejs/version/main.mjs +1 -1
- package/nodejs/version/module.f.mjs +2 -7
- package/nodejs/version/test.f.mjs +3 -3
- package/out/com/cpp/module.f.d.mts +4 -0
- package/out/com/cpp/module.f.mjs +123 -0
- package/out/com/cpp/test.f.mjs +40 -0
- package/out/com/cpp/testlib.f.mjs +7 -0
- package/out/com/cs/module.f.d.mts +4 -0
- package/out/com/cs/module.f.mjs +95 -0
- package/out/com/cs/test.f.mjs +43 -0
- package/out/com/cs/testlib.f.mjs +7 -0
- package/{com → out/com}/rust/module.f.d.mts +3 -7
- package/out/com/rust/module.f.mjs +213 -0
- package/out/com/rust/test.f.mjs +123 -0
- package/out/com/rust/testlib.f.mjs +7 -0
- package/{com → out/com}/test/build.f.d.mts +2 -2
- package/out/com/test/build.f.mjs +98 -0
- package/out/com/test/build.mjs +40 -0
- package/{com → out/com}/types/module.f.d.mts +5 -10
- package/out/com/types/module.f.mjs +51 -0
- package/out/com/types/testlib.f.mjs +30 -0
- package/out/commonjs/build/module.f.d.mts +20 -0
- package/out/commonjs/build/module.f.mjs +107 -0
- package/out/commonjs/build/test.f.mjs +102 -0
- package/{commonjs → out/commonjs}/module/function/module.f.d.mts +0 -2
- package/out/commonjs/module/function/module.f.mjs +15 -0
- package/{commonjs → out/commonjs}/module/module.f.d.mts +16 -21
- package/out/commonjs/module/module.f.mjs +48 -0
- package/out/commonjs/module.d.mts +3 -0
- package/{commonjs → out/commonjs}/module.f.d.mts +0 -2
- package/out/commonjs/module.f.mjs +10 -0
- package/out/commonjs/module.mjs +26 -0
- package/out/commonjs/package/dependencies/module.f.d.mts +6 -0
- package/out/commonjs/package/dependencies/module.f.mjs +21 -0
- package/out/commonjs/package/dependencies/test.f.mjs +15 -0
- package/out/commonjs/package/module.f.d.mts +21 -0
- package/out/commonjs/package/module.f.mjs +40 -0
- package/out/commonjs/package/test.f.mjs +27 -0
- package/{commonjs → out/commonjs}/path/module.f.d.mts +25 -32
- package/out/commonjs/path/module.f.mjs +171 -0
- package/out/commonjs/path/test.f.mjs +231 -0
- package/out/commonjs/test.mjs +87 -0
- package/out/dev/index.mjs +2 -0
- package/out/dev/module.f.d.mts +1 -0
- package/out/dev/module.f.mjs +2 -0
- package/out/dev/module.mjs +167 -0
- package/{dev → out/dev}/test/module.f.d.mts +2 -3
- package/out/dev/test/module.f.mjs +134 -0
- package/out/dev/test.f.mjs +58 -0
- package/out/dev/test.mjs +52 -0
- package/{djs → out/djs}/module.f.d.mts +13 -18
- package/out/djs/module.f.mjs +75 -0
- package/{djs → out/djs}/parser/module.f.d.mts +11 -15
- package/out/djs/parser/module.f.mjs +432 -0
- package/out/djs/parser/test.f.mjs +535 -0
- package/out/djs/test.f.mjs +84 -0
- package/out/djs/tokenizer/module.f.d.mts +13 -0
- package/out/djs/tokenizer/module.f.mjs +87 -0
- package/out/djs/tokenizer/test.f.mjs +480 -0
- package/out/fsc/module.f.d.mts +7 -0
- package/out/fsc/module.f.mjs +105 -0
- package/out/fsc/test.f.mjs +19 -0
- package/out/fsm/module.f.d.mts +14 -0
- package/out/fsm/module.f.mjs +80 -0
- package/out/fsm/test.f.mjs +138 -0
- package/out/html/module.f.d.mts +15 -0
- package/out/html/module.f.mjs +94 -0
- package/out/html/test.f.mjs +45 -0
- package/out/issues/test.f.mjs +66 -0
- package/{js → out/js}/tokenizer/module.f.d.mts +10 -15
- package/out/js/tokenizer/module.f.mjs +686 -0
- package/out/js/tokenizer/test.f.mjs +844 -0
- package/out/json/module.f.d.mts +33 -0
- package/out/json/module.f.mjs +89 -0
- package/{json → out/json}/parser/module.f.d.mts +9 -13
- package/out/json/parser/module.f.mjs +224 -0
- package/out/json/parser/test.f.mjs +321 -0
- package/out/json/serializer/module.f.d.mts +36 -0
- package/out/json/serializer/module.f.mjs +67 -0
- package/out/json/serializer/test.f.mjs +87 -0
- package/out/json/test.f.mjs +61 -0
- package/out/json/tokenizer/module.f.d.mts +13 -0
- package/out/json/tokenizer/module.f.mjs +78 -0
- package/out/json/tokenizer/test.f.mjs +420 -0
- package/out/nanvm-lib/tests/test.f.mjs +87 -0
- package/out/nodejs/version/main.mjs +3 -0
- package/{nodejs → out/nodejs}/version/module.f.d.mts +4 -9
- package/out/nodejs/version/module.f.mjs +34 -0
- package/out/nodejs/version/test.f.mjs +97 -0
- package/{prime_field → out/prime_field}/module.f.d.mts +20 -23
- package/out/prime_field/module.f.mjs +87 -0
- package/out/prime_field/test.f.mjs +145 -0
- package/{secp → out/secp}/module.f.d.mts +27 -28
- package/out/secp/module.f.mjs +113 -0
- package/out/secp/test.f.mjs +63 -0
- package/out/sha2/module.f.d.mts +15 -0
- package/out/sha2/module.f.mjs +172 -0
- package/out/sha2/test.f.mjs +86 -0
- package/out/text/ascii/module.f.d.mts +70 -0
- package/out/text/ascii/module.f.mjs +154 -0
- package/out/text/ascii/test.f.mjs +14 -0
- package/out/text/module.f.d.mts +13 -0
- package/out/text/module.f.mjs +19 -0
- package/out/text/sgr/module.f.d.mts +12 -0
- package/out/text/sgr/module.f.mjs +17 -0
- package/out/text/test.f.mjs +19 -0
- package/out/text/utf16/module.f.d.mts +12 -0
- package/out/text/utf16/module.f.mjs +86 -0
- package/out/text/utf16/test.f.mjs +145 -0
- package/out/text/utf8/module.f.d.mts +10 -0
- package/out/text/utf8/module.f.mjs +126 -0
- package/out/text/utf8/test.f.mjs +175 -0
- package/{types → out/types}/array/module.f.d.mts +14 -24
- package/out/types/array/module.f.mjs +95 -0
- package/out/types/array/test.f.mjs +116 -0
- package/out/types/bigfloat/module.f.d.mts +6 -0
- package/out/types/bigfloat/module.f.mjs +77 -0
- package/out/types/bigfloat/test.f.mjs +349 -0
- package/out/types/bigint/module.f.d.mts +29 -0
- package/{types/bigint/module.f.d.mts → out/types/bigint/module.f.mjs} +64 -27
- package/out/types/bigint/test.f.mjs +192 -0
- package/{types → out/types}/btree/find/module.f.d.mts +20 -26
- package/out/types/btree/find/module.f.mjs +137 -0
- package/out/types/btree/find/test.f.mjs +156 -0
- package/out/types/btree/module.f.d.mts +5 -0
- package/out/types/btree/module.f.mjs +34 -0
- package/{types → out/types}/btree/remove/module.f.d.mts +7 -12
- package/out/types/btree/remove/module.f.mjs +209 -0
- package/out/types/btree/remove/test.f.mjs +638 -0
- package/{types → out/types}/btree/set/module.f.d.mts +3 -7
- package/out/types/btree/set/module.f.mjs +114 -0
- package/out/types/btree/set/test.f.mjs +390 -0
- package/out/types/btree/test.f.mjs +83 -0
- package/{types → out/types}/btree/types/module.f.d.mts +0 -2
- package/out/types/btree/types/module.f.mjs +50 -0
- package/out/types/byte_set/module.f.d.mts +25 -0
- package/out/types/byte_set/module.f.mjs +42 -0
- package/out/types/byte_set/test.f.mjs +123 -0
- package/{types → out/types}/function/compare/module.f.d.mts +9 -15
- package/out/types/function/compare/module.f.mjs +22 -0
- package/out/types/function/compare/test.f.mjs +8 -0
- package/{types → out/types}/function/module.f.d.mts +20 -27
- package/out/types/function/module.f.mjs +44 -0
- package/{types → out/types}/function/operator/module.f.d.mts +28 -43
- package/out/types/function/operator/module.f.mjs +60 -0
- package/out/types/function/test.f.mjs +15 -0
- package/out/types/list/module.f.d.mts +82 -0
- package/out/types/list/module.f.mjs +269 -0
- package/out/types/list/test.f.mjs +401 -0
- package/out/types/map/module.f.d.mts +21 -0
- package/out/types/map/module.f.mjs +54 -0
- package/out/types/map/test.f.mjs +115 -0
- package/out/types/nibble_set/module.f.d.mts +16 -0
- package/out/types/nibble_set/module.f.mjs +19 -0
- package/out/types/nibble_set/test.f.mjs +90 -0
- package/out/types/nullable/module.f.d.mts +9 -0
- package/out/types/nullable/module.f.mjs +9 -0
- package/out/types/nullable/test.f.mjs +12 -0
- package/out/types/number/module.f.d.mts +7 -0
- package/out/types/number/module.f.mjs +12 -0
- package/out/types/number/test.f.mjs +126 -0
- package/out/types/object/module.f.d.mts +22 -0
- package/out/types/object/module.f.mjs +27 -0
- package/out/types/object/test.f.mjs +17 -0
- package/out/types/range/module.f.d.mts +6 -0
- package/out/types/range/module.f.mjs +6 -0
- package/out/types/range/test.f.mjs +18 -0
- package/{types → out/types}/range_map/module.f.d.mts +9 -15
- package/out/types/range_map/module.f.mjs +84 -0
- package/out/types/range_map/test.f.mjs +201 -0
- package/out/types/result/module.d.mts +7 -0
- package/{types → out/types}/result/module.f.d.mts +6 -12
- package/out/types/result/module.f.mjs +25 -0
- package/out/types/result/module.mjs +16 -0
- package/{types → out/types}/sorted_list/module.f.d.mts +22 -28
- package/out/types/sorted_list/module.f.mjs +102 -0
- package/out/types/sorted_list/test.f.mjs +66 -0
- package/{types → out/types}/sorted_set/module.f.d.mts +6 -12
- package/out/types/sorted_set/module.f.mjs +29 -0
- package/out/types/sorted_set/test.f.mjs +80 -0
- package/out/types/string/module.f.d.mts +9 -0
- package/out/types/string/module.f.mjs +17 -0
- package/out/types/string/test.f.mjs +58 -0
- package/out/types/string_set/module.f.d.mts +13 -0
- package/out/types/string_set/module.f.mjs +29 -0
- package/out/types/string_set/test.f.mjs +65 -0
- package/package.json +5 -4
- package/prime_field/module.f.mjs +9 -12
- package/prime_field/test.f.mjs +1 -1
- package/secp/module.f.mjs +38 -39
- package/secp/test.f.mjs +4 -4
- package/sha2/module.f.mjs +7 -20
- package/sha2/test.f.mjs +4 -4
- package/text/ascii/module.f.mjs +5 -10
- package/text/ascii/test.f.mjs +3 -3
- package/text/module.f.mjs +7 -14
- package/text/sgr/module.f.mjs +2 -4
- package/text/test.f.mjs +3 -3
- package/text/utf16/module.f.mjs +17 -28
- package/text/utf16/test.f.mjs +5 -5
- package/text/utf8/module.f.mjs +9 -16
- package/text/utf8/test.f.mjs +4 -4
- package/tsconfig.json +2 -2
- package/types/array/module.f.mjs +8 -25
- package/types/array/test.f.mjs +3 -3
- package/types/bigfloat/module.f.mjs +3 -10
- package/types/bigfloat/test.f.mjs +1 -1
- package/types/bigint/module.f.mjs +11 -30
- package/types/bigint/test.f.mjs +1 -1
- package/types/btree/find/module.f.mjs +8 -17
- package/types/btree/find/test.f.mjs +7 -7
- package/types/btree/module.f.mjs +6 -11
- package/types/btree/remove/module.f.mjs +10 -17
- package/types/btree/remove/test.f.mjs +5 -5
- package/types/btree/set/module.f.mjs +4 -9
- package/types/btree/set/test.f.mjs +4 -4
- package/types/btree/test.f.mjs +9 -9
- package/types/btree/types/module.f.mjs +0 -2
- package/types/byte_set/module.f.mjs +14 -39
- package/types/byte_set/test.f.mjs +5 -5
- package/types/function/compare/module.f.mjs +3 -12
- package/types/function/compare/test.f.mjs +1 -1
- package/types/function/module.f.mjs +4 -15
- package/types/function/operator/module.f.mjs +14 -41
- package/types/function/test.f.mjs +1 -1
- package/types/list/module.f.mjs +45 -114
- package/types/list/test.f.mjs +10 -10
- package/types/map/module.f.mjs +15 -30
- package/types/map/test.f.mjs +2 -2
- package/types/nibble_set/module.f.mjs +7 -24
- package/types/nibble_set/test.f.mjs +2 -2
- package/types/nullable/module.f.mjs +2 -9
- package/types/nullable/test.f.mjs +1 -1
- package/types/number/module.f.mjs +8 -19
- package/types/number/test.f.mjs +1 -1
- package/types/object/module.f.mjs +9 -20
- package/types/object/test.f.mjs +1 -1
- package/types/range/module.f.mjs +2 -9
- package/types/range/test.f.mjs +1 -1
- package/types/range_map/module.f.mjs +9 -18
- package/types/range_map/test.f.mjs +32 -32
- package/types/result/module.f.mjs +3 -12
- package/types/result/module.mjs +2 -2
- package/types/sorted_list/module.f.mjs +10 -19
- package/types/sorted_list/test.f.mjs +7 -7
- package/types/sorted_set/module.f.mjs +7 -16
- package/types/sorted_set/test.f.mjs +7 -7
- package/types/string/module.f.mjs +10 -21
- package/types/string/test.f.mjs +2 -2
- package/types/string_set/module.f.mjs +12 -27
- package/types/string_set/test.f.mjs +1 -1
- package/com/cpp/module.f.d.mts +0 -8
- package/com/cs/module.f.d.mts +0 -8
- package/commonjs/build/module.f.d.mts +0 -24
- package/commonjs/module.d.mts +0 -7
- package/commonjs/package/dependencies/module.f.d.mts +0 -10
- package/commonjs/package/module.f.d.mts +0 -27
- package/dev/module.f.d.mts +0 -4
- package/djs/tokenizer/module.f.d.mts +0 -17
- package/fsc/module.f.d.mts +0 -12
- package/fsm/module.f.d.mts +0 -21
- package/html/module.f.d.mts +0 -20
- package/json/module.f.d.mts +0 -41
- package/json/serializer/module.f.d.mts +0 -45
- package/json/tokenizer/module.f.d.mts +0 -17
- package/sha2/module.f.d.mts +0 -23
- package/text/ascii/module.f.d.mts +0 -73
- package/text/module.f.d.mts +0 -18
- package/text/sgr/module.f.d.mts +0 -14
- package/text/utf16/module.f.d.mts +0 -19
- package/text/utf8/module.f.d.mts +0 -15
- package/types/bigfloat/module.f.d.mts +0 -11
- package/types/btree/module.f.d.mts +0 -9
- package/types/byte_set/module.f.d.mts +0 -38
- package/types/list/module.f.d.mts +0 -117
- package/types/map/module.f.d.mts +0 -30
- package/types/nibble_set/module.f.d.mts +0 -26
- package/types/nullable/module.f.d.mts +0 -14
- package/types/number/module.f.d.mts +0 -13
- package/types/object/module.f.d.mts +0 -29
- package/types/range/module.f.d.mts +0 -11
- package/types/result/module.d.mts +0 -7
- package/types/string/module.f.d.mts +0 -15
- package/types/string_set/module.f.d.mts +0 -21
- /package/{com → out/com}/cpp/test.f.d.mts +0 -0
- /package/{com → out/com}/cpp/testlib.f.d.mts +0 -0
- /package/{com → out/com}/cs/test.f.d.mts +0 -0
- /package/{com → out/com}/cs/testlib.f.d.mts +0 -0
- /package/{com → out/com}/rust/test.f.d.mts +0 -0
- /package/{com → out/com}/rust/testlib.f.d.mts +0 -0
- /package/{com → out/com}/test/build.d.mts +0 -0
- /package/{com → out/com}/types/testlib.f.d.mts +0 -0
- /package/{commonjs → out/commonjs}/build/test.f.d.mts +0 -0
- /package/{commonjs → out/commonjs}/package/dependencies/test.f.d.mts +0 -0
- /package/{commonjs → out/commonjs}/package/test.f.d.mts +0 -0
- /package/{commonjs → out/commonjs}/path/test.f.d.mts +0 -0
- /package/{commonjs → out/commonjs}/test.d.mts +0 -0
- /package/{dev → out/dev}/index.d.mts +0 -0
- /package/{dev → out/dev}/module.d.mts +0 -0
- /package/{dev → out/dev}/test.d.mts +0 -0
- /package/{dev → out/dev}/test.f.d.mts +0 -0
- /package/{djs → out/djs}/parser/test.f.d.mts +0 -0
- /package/{djs → out/djs}/test.f.d.mts +0 -0
- /package/{djs → out/djs}/tokenizer/test.f.d.mts +0 -0
- /package/{fsc → out/fsc}/test.f.d.mts +0 -0
- /package/{fsm → out/fsm}/test.f.d.mts +0 -0
- /package/{html → out/html}/test.f.d.mts +0 -0
- /package/{issues → out/issues}/test.f.d.mts +0 -0
- /package/{js → out/js}/tokenizer/test.f.d.mts +0 -0
- /package/{json → out/json}/parser/test.f.d.mts +0 -0
- /package/{json → out/json}/serializer/test.f.d.mts +0 -0
- /package/{json → out/json}/test.f.d.mts +0 -0
- /package/{json → out/json}/tokenizer/test.f.d.mts +0 -0
- /package/{nanvm-lib → out/nanvm-lib}/tests/test.f.d.mts +0 -0
- /package/{nodejs → out/nodejs}/version/main.d.mts +0 -0
- /package/{nodejs → out/nodejs}/version/test.f.d.mts +0 -0
- /package/{prime_field → out/prime_field}/test.f.d.mts +0 -0
- /package/{secp → out/secp}/test.f.d.mts +0 -0
- /package/{sha2 → out/sha2}/test.f.d.mts +0 -0
- /package/{text → out/text}/ascii/test.f.d.mts +0 -0
- /package/{text → out/text}/test.f.d.mts +0 -0
- /package/{text → out/text}/utf16/test.f.d.mts +0 -0
- /package/{text → out/text}/utf8/test.f.d.mts +0 -0
- /package/{types → out/types}/array/test.f.d.mts +0 -0
- /package/{types → out/types}/bigfloat/test.f.d.mts +0 -0
- /package/{types → out/types}/bigint/test.f.d.mts +0 -0
- /package/{types → out/types}/btree/find/test.f.d.mts +0 -0
- /package/{types → out/types}/btree/remove/test.f.d.mts +0 -0
- /package/{types → out/types}/btree/set/test.f.d.mts +0 -0
- /package/{types → out/types}/btree/test.f.d.mts +0 -0
- /package/{types → out/types}/byte_set/test.f.d.mts +0 -0
- /package/{types → out/types}/function/compare/test.f.d.mts +0 -0
- /package/{types → out/types}/function/test.f.d.mts +0 -0
- /package/{types → out/types}/list/test.f.d.mts +0 -0
- /package/{types → out/types}/map/test.f.d.mts +0 -0
- /package/{types → out/types}/nibble_set/test.f.d.mts +0 -0
- /package/{types → out/types}/nullable/test.f.d.mts +0 -0
- /package/{types → out/types}/number/test.f.d.mts +0 -0
- /package/{types → out/types}/object/test.f.d.mts +0 -0
- /package/{types → out/types}/range/test.f.d.mts +0 -0
- /package/{types → out/types}/range_map/test.f.d.mts +0 -0
- /package/{types → out/types}/sorted_list/test.f.d.mts +0 -0
- /package/{types → out/types}/sorted_set/test.f.d.mts +0 -0
- /package/{types → out/types}/string/test.f.d.mts +0 -0
- /package/{types → out/types}/string_set/test.f.d.mts +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
// @ts-self-types="./module.f.d.mts"
|
|
2
2
|
|
|
3
3
|
import * as Operator from '../../types/function/operator/module.f.mjs'
|
|
4
|
-
import
|
|
4
|
+
import * as list from '../../types/list/module.f.mjs'
|
|
5
5
|
const { empty, flat, stateScan } = list
|
|
6
|
-
import bf from '../../types/bigfloat/module.f.mjs'
|
|
6
|
+
import * as bf from '../../types/bigfloat/module.f.mjs'
|
|
7
7
|
const { multiply } = bf
|
|
8
|
-
import
|
|
8
|
+
import * as jsTokenizer from '../../js/tokenizer/module.f.mjs'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @typedef {|
|
|
12
12
|
* {readonly kind: 'true' | 'false' | 'null'} |
|
|
13
13
|
* {readonly kind: '{' | '}' | ':' | ',' | '[' | ']' | '.' | '=' } |
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
14
|
+
* jsTokenizer.StringToken |
|
|
15
|
+
* jsTokenizer.NumberToken |
|
|
16
|
+
* jsTokenizer.ErrorToken |
|
|
17
|
+
* jsTokenizer.IdToken |
|
|
18
|
+
* jsTokenizer.BigIntToken |
|
|
19
|
+
* jsTokenizer.WhitespaceToken |
|
|
20
|
+
* jsTokenizer.NewLineToken
|
|
21
21
|
* } DjsToken
|
|
22
22
|
*/
|
|
23
23
|
|
|
@@ -29,11 +29,11 @@ import jsTokenizer, * as jsTokenizerT from '../../js/tokenizer/module.f.mjs'
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* @typedef {|
|
|
32
|
-
*
|
|
32
|
+
* jsTokenizer.JsToken | null
|
|
33
33
|
* } ScanInput
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
|
-
/** @type {(input:
|
|
36
|
+
/** @type {(input: jsTokenizer.JsToken) => list.List<DjsToken>} */
|
|
37
37
|
const mapToken = input =>
|
|
38
38
|
{
|
|
39
39
|
switch(input.kind)
|
|
@@ -60,7 +60,7 @@ const mapToken = input =>
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/** @type {(input: ScanInput) => readonly [
|
|
63
|
+
/** @type {(input: ScanInput) => readonly [list.List<DjsToken>, ScanState]} */
|
|
64
64
|
const parseDefaultState = input =>
|
|
65
65
|
{
|
|
66
66
|
if (input === null) return [empty, { kind: 'def'}]
|
|
@@ -71,7 +71,7 @@ const parseDefaultState = input =>
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
/** @type {(input: ScanInput) => readonly [
|
|
74
|
+
/** @type {(input: ScanInput) => readonly [list.List<DjsToken>, ScanState]} */
|
|
75
75
|
const parseMinusState = input =>
|
|
76
76
|
{
|
|
77
77
|
if (input === null) return [[{ kind: 'error', message: 'invalid token' }], { kind: 'def'}]
|
|
@@ -84,7 +84,7 @@ const parseMinusState = input =>
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
/** @type {Operator.StateScan<ScanInput, ScanState,
|
|
87
|
+
/** @type {Operator.StateScan<ScanInput, ScanState, list.List<DjsToken>>} */
|
|
88
88
|
const scanToken = state => input => {
|
|
89
89
|
switch(state.kind)
|
|
90
90
|
{
|
|
@@ -93,15 +93,10 @@ const scanToken = state => input => {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
/** @type {(input:
|
|
97
|
-
const tokenize = input =>
|
|
96
|
+
/** @type {(input: list.List<number>) => list.List<DjsToken>} */
|
|
97
|
+
export const tokenize = input =>
|
|
98
98
|
{
|
|
99
|
-
/** @type {
|
|
99
|
+
/** @type {list.List<ScanInput>} */
|
|
100
100
|
const jsTokens = jsTokenizer.tokenize(input)
|
|
101
101
|
return flat(stateScan(scanToken)({ kind: 'def' })(list.concat(jsTokens)([null])))
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
export default {
|
|
105
|
-
/** @readonly */
|
|
106
|
-
tokenize
|
|
107
|
-
}
|
package/djs/tokenizer/test.f.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import list from '../../types/list/module.f.mjs'
|
|
1
|
+
import * as tokenizer from './module.f.mjs'
|
|
2
|
+
import * as list from '../../types/list/module.f.mjs'
|
|
3
3
|
const { toArray } = list
|
|
4
|
-
import djs from '../module.f.mjs'
|
|
5
|
-
import o from '../../types/object/module.f.mjs'
|
|
4
|
+
import * as djs from '../module.f.mjs'
|
|
5
|
+
import * as o from '../../types/object/module.f.mjs'
|
|
6
6
|
const { sort } = o
|
|
7
|
-
import encoding from '../../text/utf16/module.f.mjs'
|
|
7
|
+
import * as encoding from '../../text/utf16/module.f.mjs'
|
|
8
8
|
|
|
9
|
-
/** @type {(s: string) => readonly
|
|
9
|
+
/** @type {(s: string) => readonly tokenizer.DjsToken[]} */
|
|
10
10
|
const tokenizeString = s => toArray(tokenizer.tokenize(encoding.stringToList(s)))
|
|
11
11
|
|
|
12
12
|
const stringify = djs.stringify(sort)
|
package/fsc/module.f.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @ts-self-types="./module.f.d.mts"
|
|
2
|
-
import operator from '../types/function/operator/module.f.mjs'
|
|
3
|
-
import
|
|
4
|
-
const { merge: rangeMapMerge, fromRange, get } =
|
|
5
|
-
import
|
|
2
|
+
import * as operator from '../types/function/operator/module.f.mjs'
|
|
3
|
+
import * as rangeMap from '../types/range_map/module.f.mjs'
|
|
4
|
+
const { merge: rangeMapMerge, fromRange, get } = rangeMap
|
|
5
|
+
import * as list from '../types/list/module.f.mjs'
|
|
6
6
|
const { reduce: listReduce } = list
|
|
7
|
-
import ascii from '../text/ascii/module.f.mjs'
|
|
7
|
+
import * as ascii from '../text/ascii/module.f.mjs'
|
|
8
8
|
const { range: asciiRange } = ascii
|
|
9
9
|
const { fromCharCode } = String
|
|
10
|
-
import f from '../types/function/module.f.mjs'
|
|
10
|
+
import * as f from '../types/function/module.f.mjs'
|
|
11
11
|
const { fn } = f
|
|
12
|
-
import
|
|
12
|
+
import * as _range from '../types/range/module.f.mjs'
|
|
13
13
|
const { one } = _range
|
|
14
14
|
const { toArray, map } = list
|
|
15
15
|
|
|
@@ -24,7 +24,7 @@ const { toArray, map } = list
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @template T
|
|
27
|
-
* @typedef {
|
|
27
|
+
* @typedef {rangeMap.RangeMapArray<CreateToResult<T>>} State
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
/** @type {ToResult} */
|
|
@@ -43,10 +43,10 @@ const union = a => b => {
|
|
|
43
43
|
/** @type {readonly never[]} */
|
|
44
44
|
const empty = []
|
|
45
45
|
|
|
46
|
-
/** @type {<T>(a:
|
|
46
|
+
/** @type {<T>(a: list.List<State<T>>) => State<T>} */
|
|
47
47
|
const reduce = a => {
|
|
48
|
-
/** @typedef {typeof a extends
|
|
49
|
-
/** @type {
|
|
48
|
+
/** @typedef {typeof a extends list.List<State<infer T>> ? T : never} T */
|
|
49
|
+
/** @type {rangeMap.RangeMerge<CreateToResult<T>>} */
|
|
50
50
|
const merge = rangeMapMerge({
|
|
51
51
|
union,
|
|
52
52
|
equal: operator.strictEqual,
|
|
@@ -61,28 +61,28 @@ const range = fn(asciiRange).then(codePointRange).result
|
|
|
61
61
|
/** @type {(l: readonly string[]) => <T>(f: CreateToResult<T>) => State<T>} */
|
|
62
62
|
const rangeSet = l => f => {
|
|
63
63
|
/** @typedef {typeof f extends CreateToResult<infer T> ? T : never} T */
|
|
64
|
-
/** @type {(a:
|
|
64
|
+
/** @type {(a: _range.Range) => (f: CreateToResult<T>) => State<T>} */
|
|
65
65
|
const codePointRange = fromRange(def)
|
|
66
66
|
/** @type {(r: string) => State<T>} */
|
|
67
67
|
const g = r => codePointRange(asciiRange(r))(f)
|
|
68
68
|
return reduce(map(g)(l))
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
/** @type {<T>(a:
|
|
71
|
+
/** @type {<T>(a: list.List<State<T>>) => CreateToResult<T>} */
|
|
72
72
|
const create = a => {
|
|
73
|
-
/** @typedef {typeof a extends
|
|
73
|
+
/** @typedef {typeof a extends list.List<State<infer T>> ? T : never} T */
|
|
74
74
|
const i = reduce(a)
|
|
75
75
|
/** @type {(v: number) => (i: State<T>) => (v: T) => ToResult} */
|
|
76
76
|
const x = get(def)
|
|
77
77
|
return v => c => x(c)(i)(v)(c)
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
const terminal = -1
|
|
80
|
+
export const terminal = -1
|
|
81
81
|
|
|
82
82
|
/** @type {() => ToResult} */
|
|
83
83
|
const toInit = () => () => [[], init]
|
|
84
84
|
|
|
85
|
-
const init = create([
|
|
85
|
+
export const init = create([
|
|
86
86
|
codePointRange(one(terminal))(toInit),
|
|
87
87
|
rangeSet(['\t', ' ', '\n', '\r'])(toInit),
|
|
88
88
|
range('!')(() => () => [['!'], unexpectedSymbol]),
|
|
@@ -114,11 +114,4 @@ const init = create([
|
|
|
114
114
|
range('|')(() => () => [['|'], unexpectedSymbol]),
|
|
115
115
|
range('}')(() => () => [['}'], unexpectedSymbol]),
|
|
116
116
|
range('~')(() => () => [['~'], unexpectedSymbol]),
|
|
117
|
-
])(
|
|
118
|
-
|
|
119
|
-
export default {
|
|
120
|
-
/** @readonly */
|
|
121
|
-
terminal,
|
|
122
|
-
/** @readonly */
|
|
123
|
-
init,
|
|
124
|
-
}
|
|
117
|
+
])(undefined)
|
package/fsc/test.f.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _ from './module.f.mjs'
|
|
2
|
-
import ascii from '../text/ascii/module.f.mjs'
|
|
1
|
+
import * as _ from './module.f.mjs'
|
|
2
|
+
import * as ascii from '../text/ascii/module.f.mjs'
|
|
3
3
|
const { one } = ascii
|
|
4
|
-
import j from '../json/module.f.mjs'
|
|
4
|
+
import * as j from '../json/module.f.mjs'
|
|
5
5
|
const { stringify } = j
|
|
6
6
|
const s = stringify(i => i)
|
|
7
7
|
|
package/fsm/module.f.mjs
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
// @ts-self-types="./module.f.d.mts"
|
|
2
|
-
import
|
|
2
|
+
import * as list from '../types/list/module.f.mjs'
|
|
3
3
|
const { equal, isEmpty, fold, toArray, scan, foldScan, empty: emptyList } = list
|
|
4
|
-
import
|
|
4
|
+
import * as byteSet from '../types/byte_set/module.f.mjs'
|
|
5
5
|
const { toRangeMap, union: byteSetUnion, one, empty } = byteSet
|
|
6
|
-
import
|
|
6
|
+
import * as sortedSet from '../types/sorted_set/module.f.mjs'
|
|
7
7
|
const { intersect, union: sortedSetUnion } = sortedSet
|
|
8
|
-
import
|
|
8
|
+
import * as rangeMap from '../types/range_map/module.f.mjs'
|
|
9
9
|
const { merge } = rangeMap
|
|
10
|
-
import cmp from '../types/function/compare/module.f.mjs'
|
|
10
|
+
import * as cmp from '../types/function/compare/module.f.mjs'
|
|
11
11
|
const { unsafeCmp } = cmp
|
|
12
|
-
import
|
|
12
|
+
import * as operator from '../types/function/operator/module.f.mjs'
|
|
13
13
|
const { strictEqual } = operator
|
|
14
|
-
import j from '../json/module.f.mjs'
|
|
14
|
+
import * as j from '../json/module.f.mjs'
|
|
15
15
|
const { stringify } = j
|
|
16
|
-
import f from '../types/function/module.f.mjs'
|
|
16
|
+
import * as f from '../types/function/module.f.mjs'
|
|
17
17
|
const { identity } = f
|
|
18
|
-
import utf16 from '../text/utf16/module.f.mjs'
|
|
18
|
+
import * as utf16 from '../text/utf16/module.f.mjs'
|
|
19
19
|
const { stringToList } = utf16
|
|
20
20
|
|
|
21
|
-
/** @typedef {readonly[string,
|
|
21
|
+
/** @typedef {readonly[string, byteSet.ByteSet, string]} Rule */
|
|
22
22
|
|
|
23
|
-
/** @typedef {
|
|
23
|
+
/** @typedef {list.List<Rule>} Grammar */
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @typedef {{
|
|
27
|
-
* readonly[state in string]:
|
|
27
|
+
* readonly[state in string]: rangeMap.RangeMapArray<string>
|
|
28
28
|
* }} Dfa
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
const stringifyIdentity = stringify(identity)
|
|
32
32
|
|
|
33
|
-
/** @type {(s: string) =>
|
|
34
|
-
const toRange = s => {
|
|
33
|
+
/** @type {(s: string) => byteSet.ByteSet} */
|
|
34
|
+
export const toRange = s => {
|
|
35
35
|
const [b, e] = toArray(stringToList(s))
|
|
36
36
|
return byteSet.range([b, e])
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
/** @type {
|
|
39
|
+
/** @type {operator.Fold<number, byteSet.ByteSet>} */
|
|
40
40
|
const toUnionOp = i => bs => byteSetUnion(bs)(one(i))
|
|
41
41
|
|
|
42
|
-
/** @type {(s: string) =>
|
|
43
|
-
const toUnion = s => {
|
|
42
|
+
/** @type {(s: string) => byteSet.ByteSet} */
|
|
43
|
+
export const toUnion = s => {
|
|
44
44
|
const codePoints = stringToList(s)
|
|
45
45
|
return fold(toUnionOp)(empty)(codePoints)
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
/** @type {
|
|
48
|
+
/** @type {rangeMap.Operators<sortedSet.SortedSet<string>>} */
|
|
49
49
|
const mergeOp = { union: sortedSetUnion(unsafeCmp), equal: equal(strictEqual) }
|
|
50
50
|
|
|
51
|
-
/** @type {(s: string) => (set:
|
|
51
|
+
/** @type {(s: string) => (set: sortedSet.SortedSet<string>) => boolean} */
|
|
52
52
|
const hasState = s => set => !isEmpty(intersect(unsafeCmp)([s])(set))
|
|
53
53
|
|
|
54
|
-
/** @type {(set:
|
|
54
|
+
/** @type {(set: sortedSet.SortedSet<string>) => operator.Fold<Rule, rangeMap.RangeMap<sortedSet.SortedSet<string>>>} */
|
|
55
55
|
const foldOp = set => ([ruleIn, bs, ruleOut]) => rm => {
|
|
56
56
|
if (hasState(ruleIn)(set)) { return merge(mergeOp)(rm)(toRangeMap(bs)(ruleOut)) }
|
|
57
57
|
return rm
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
/** @type {
|
|
60
|
+
/** @type {operator.Scan<rangeMap.Entry<sortedSet.SortedSet<string>>, rangeMap.Entry<string>>} */
|
|
61
61
|
const stringifyOp = ([sortedSet, max]) => [[stringifyIdentity(sortedSet), max], stringifyOp]
|
|
62
62
|
|
|
63
63
|
const scanStringify = scan(stringifyOp)
|
|
64
64
|
|
|
65
|
-
/** @type {
|
|
65
|
+
/** @type {operator.Scan<rangeMap.Entry<sortedSet.SortedSet<string>>, sortedSet.SortedSet<string>>} */
|
|
66
66
|
const fetchOp = ([item, _]) => [item, fetchOp]
|
|
67
67
|
|
|
68
68
|
const scanFetch = scan(fetchOp)
|
|
69
69
|
|
|
70
|
-
/** @type {(grammar: Grammar) =>
|
|
70
|
+
/** @type {(grammar: Grammar) => operator.Fold<sortedSet.SortedSet<string>, Dfa>} */
|
|
71
71
|
const addEntry = grammar => set => dfa => {
|
|
72
72
|
const s = stringifyIdentity(set)
|
|
73
73
|
if (s in dfa) { return dfa }
|
|
@@ -88,23 +88,12 @@ const initialState = ['']
|
|
|
88
88
|
const initialStateStringify = stringifyIdentity(initialState)
|
|
89
89
|
|
|
90
90
|
/** @type {(grammar: Grammar) => Dfa} */
|
|
91
|
-
const dfa = grammar => addEntry(grammar)(initialState)({})
|
|
91
|
+
export const dfa = grammar => addEntry(grammar)(initialState)({})
|
|
92
92
|
|
|
93
93
|
const get = rangeMap.get(emptyStateStringify)
|
|
94
94
|
|
|
95
|
-
/** @type {(dfa: Dfa) =>
|
|
95
|
+
/** @type {(dfa: Dfa) => operator.Fold<number, string>} */
|
|
96
96
|
const runOp = dfa => input => s => get(input)(dfa[s])
|
|
97
97
|
|
|
98
|
-
/** @type {(dfa: Dfa) => (input:
|
|
99
|
-
const run = dfa => input => foldScan(runOp(dfa))(initialStateStringify)(input)
|
|
100
|
-
|
|
101
|
-
export default {
|
|
102
|
-
/** @readonly */
|
|
103
|
-
dfa,
|
|
104
|
-
/** @readonly */
|
|
105
|
-
run,
|
|
106
|
-
/** @readonly */
|
|
107
|
-
toRange,
|
|
108
|
-
/** @readonly */
|
|
109
|
-
toUnion
|
|
110
|
-
}
|
|
98
|
+
/** @type {(dfa: Dfa) => (input: list.List<number>) => list.List<string>} */
|
|
99
|
+
export const run = dfa => input => foldScan(runOp(dfa))(initialStateStringify)(input)
|
package/fsm/test.f.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import byteSet from '../types/byte_set/module.f.mjs'
|
|
3
|
-
import o from '../types/object/module.f.mjs'
|
|
1
|
+
import * as _ from './module.f.mjs'
|
|
2
|
+
import * as byteSet from '../types/byte_set/module.f.mjs'
|
|
3
|
+
import * as o from '../types/object/module.f.mjs'
|
|
4
4
|
const { sort, fromEntries } = o
|
|
5
|
-
import json from '../json/module.f.mjs'
|
|
6
|
-
import f from '../types/function/module.f.mjs'
|
|
5
|
+
import * as json from '../json/module.f.mjs'
|
|
6
|
+
import * as f from '../types/function/module.f.mjs'
|
|
7
7
|
const { identity } = f
|
|
8
|
-
import list from '../types/list/module.f.mjs'
|
|
8
|
+
import * as list from '../types/list/module.f.mjs'
|
|
9
9
|
const { toArray } = list
|
|
10
|
-
import utf16 from '../text/utf16/module.f.mjs'
|
|
10
|
+
import * as utf16 from '../text/utf16/module.f.mjs'
|
|
11
11
|
const { stringToList } = utf16
|
|
12
12
|
|
|
13
13
|
const stringifyIdentity = json.stringify(identity)
|
|
@@ -22,7 +22,7 @@ const buildDfa = () => {
|
|
|
22
22
|
const idNext = byteSet.union(idBegin)(digit)
|
|
23
23
|
const dot = _.toUnion('.')
|
|
24
24
|
|
|
25
|
-
/** @type {
|
|
25
|
+
/** @type {_.Grammar} */
|
|
26
26
|
const grammar = [
|
|
27
27
|
['', digit, 'int'],
|
|
28
28
|
['int', digit, 'int'],
|
package/html/module.f.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @ts-self-types="./module.f.d.mts"
|
|
2
|
-
import
|
|
2
|
+
import * as list from '../types/list/module.f.mjs'
|
|
3
3
|
const { map, flatMap, flat, concat: listConcat } = list
|
|
4
|
-
import s from '../types/string/module.f.mjs'
|
|
4
|
+
import * as s from '../types/string/module.f.mjs'
|
|
5
5
|
const { concat: stringConcat } = s
|
|
6
6
|
import * as O from '../types/object/module.f.mjs'
|
|
7
|
-
import f from '../types/function/module.f.mjs'
|
|
7
|
+
import * as f from '../types/function/module.f.mjs'
|
|
8
8
|
const { compose } = f
|
|
9
|
-
import utf16 from '../text/utf16/module.f.mjs'
|
|
9
|
+
import * as utf16 from '../text/utf16/module.f.mjs'
|
|
10
10
|
const { stringToList } = utf16
|
|
11
11
|
const { fromCharCode } = String
|
|
12
12
|
const { entries } = Object
|
|
@@ -50,7 +50,7 @@ const isVoid = tag => voidTagList.includes(tag)
|
|
|
50
50
|
* }} Attributes
|
|
51
51
|
*/
|
|
52
52
|
|
|
53
|
-
/** @typedef {
|
|
53
|
+
/** @typedef {list.List<Node>} Nodes */
|
|
54
54
|
|
|
55
55
|
/** @typedef {Element | string} Node */
|
|
56
56
|
|
|
@@ -71,33 +71,33 @@ const escapeCharCode = code => {
|
|
|
71
71
|
|
|
72
72
|
const escape = compose(stringToList)(map(escapeCharCode))
|
|
73
73
|
|
|
74
|
-
/** @type {(n: Node) =>
|
|
74
|
+
/** @type {(n: Node) => list.List<string>} */
|
|
75
75
|
const node = n => typeof n === 'string' ? escape(n) : element(n)
|
|
76
76
|
|
|
77
77
|
const nodes = flatMap(node)
|
|
78
78
|
|
|
79
|
-
/** @type {(a: O.Entry<string>) =>
|
|
79
|
+
/** @type {(a: O.Entry<string>) => list.List<string>} */
|
|
80
80
|
const attribute = ([name, value]) => flat([[' ', name, '="'], escape(value), ['"']])
|
|
81
81
|
|
|
82
|
-
/** @type {(a: Attributes) =>
|
|
82
|
+
/** @type {(a: Attributes) => list.List<string>} */
|
|
83
83
|
const attributes = compose(entries)(flatMap(attribute))
|
|
84
84
|
|
|
85
85
|
const open = (/** @type {Element2A} */[tag, a]) => flat([[`<`, tag], attributes(a), [`>`]])
|
|
86
86
|
|
|
87
87
|
const close = (/** @type {string}*/tag) => ['</', tag, '>']
|
|
88
88
|
|
|
89
|
-
/** @type {(_: Element3) =>
|
|
89
|
+
/** @type {(_: Element3) => list.List<string>} */
|
|
90
90
|
const element3 = ([tag, a, ns]) =>
|
|
91
91
|
flat([open([tag, a]), nodes(ns), close(tag)])
|
|
92
92
|
|
|
93
|
-
/** @type {(_: Element2A) =>
|
|
93
|
+
/** @type {(_: Element2A) => list.List<string>} */
|
|
94
94
|
const element2a = e => {
|
|
95
95
|
const [tag] = e
|
|
96
96
|
return flat([open(e), isVoid(tag) ? [] : close(tag)])
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
/** @type {(element: Element) =>
|
|
100
|
-
const element = e => {
|
|
99
|
+
/** @type {(element: Element) => list.List<string>} */
|
|
100
|
+
export const element = e => {
|
|
101
101
|
switch (e.length) {
|
|
102
102
|
case 1: { return element2a([e[0], {}]) }
|
|
103
103
|
case 2: {
|
|
@@ -112,15 +112,6 @@ const element = e => {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
const html = compose(element)(listConcat(['<!DOCTYPE html>']))
|
|
115
|
+
export const html = compose(element)(listConcat(['<!DOCTYPE html>']))
|
|
116
116
|
|
|
117
|
-
const htmlToString = compose(html)(stringConcat)
|
|
118
|
-
|
|
119
|
-
export default {
|
|
120
|
-
/** @readonly */
|
|
121
|
-
element,
|
|
122
|
-
/** @readonly */
|
|
123
|
-
html,
|
|
124
|
-
/** @readonly */
|
|
125
|
-
htmlToString,
|
|
126
|
-
}
|
|
117
|
+
export const htmlToString = compose(html)(stringConcat)
|
package/html/test.f.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _ from './module.f.mjs'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
empty: () => {
|
|
@@ -14,19 +14,19 @@ export default {
|
|
|
14
14
|
if (r !== '<!DOCTYPE html><area>') { throw r }
|
|
15
15
|
},
|
|
16
16
|
some: () => {
|
|
17
|
-
/** @type {
|
|
17
|
+
/** @type {_.Element} */
|
|
18
18
|
const x = ['div', {}, ['<div>&</div>', ['a', { href: 'hello"' }, []]]]
|
|
19
19
|
const s = _.htmlToString(x)
|
|
20
20
|
if (s !== '<!DOCTYPE html><div><div>&amp;</div><a href="hello""></a></div>') { throw s }
|
|
21
21
|
},
|
|
22
22
|
some2: () => {
|
|
23
|
-
/** @type {
|
|
23
|
+
/** @type {_.Element} */
|
|
24
24
|
const x = ['div', ['<div>&</div>', ['a', { href: 'hello"' }, []]]]
|
|
25
25
|
const s = _.htmlToString(x)
|
|
26
26
|
if (s !== '<!DOCTYPE html><div><div>&amp;</div><a href="hello""></a></div>') { throw s }
|
|
27
27
|
},
|
|
28
28
|
someVoid: () => {
|
|
29
|
-
/** @type {
|
|
29
|
+
/** @type {_.Element} */
|
|
30
30
|
const x = ['div', [['br', {id: '5'}], '<div>&</div>', ['a', { href: 'hello"' }, []]]]
|
|
31
31
|
const s = _.htmlToString(x)
|
|
32
32
|
if (s !== '<!DOCTYPE html><div><br id="5"><div>&amp;</div><a href="hello""></a></div>') { throw s }
|