functionalscript 0.35.2 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fs/asn.1/module.f.js +1 -1
- package/fs/asserts/proof.f.js +1 -1
- package/fs/base_n/module.f.js +3 -3
- package/fs/base_n/proof.f.js +3 -3
- package/fs/{base128 → basen/base128}/module.f.d.ts +1 -1
- package/fs/{base128 → basen/base128}/module.f.js +1 -1
- package/fs/{base128 → basen/base128}/proof.f.js +3 -3
- package/fs/{base64 → basen/base64}/module.f.d.ts +2 -2
- package/fs/basen/base64/module.f.js +71 -0
- package/fs/{base64 → basen/base64}/proof.f.d.ts +2 -0
- package/fs/{base64 → basen/base64}/proof.f.js +17 -2
- package/fs/{cbase32 → basen/cbase32}/module.f.d.ts +2 -2
- package/fs/{cbase32 → basen/cbase32}/module.f.js +2 -2
- package/fs/{cbase32 → basen/cbase32}/proof.f.js +1 -1
- package/fs/bnf/data/module.f.js +4 -4
- package/fs/bnf/data/proof.f.js +6 -6
- package/fs/bnf/descent/module.f.js +6 -6
- package/fs/bnf/descent/proof.f.js +6 -6
- package/fs/bnf/ll1/module.f.js +9 -9
- package/fs/bnf/ll1/proof.f.js +6 -6
- package/fs/bnf/module.f.js +4 -4
- package/fs/bnf/proof.f.js +2 -2
- package/fs/bnf/testlib.f.js +1 -1
- package/fs/cas/cli/module.f.js +7 -7
- package/fs/cas/cli/proof.f.js +8 -8
- package/fs/cas/mcp/module.f.d.ts +8 -4
- package/fs/cas/mcp/module.f.js +124 -72
- package/fs/cas/mcp/proof.f.d.ts +3 -8
- package/fs/cas/mcp/proof.f.js +122 -186
- package/fs/cas/module.f.js +12 -19
- package/fs/cas/proof.f.d.ts +4 -2
- package/fs/cas/proof.f.js +10 -10
- package/fs/ci/bun/module.f.js +2 -2
- package/fs/ci/common/module.f.d.ts +2 -2
- package/fs/ci/common/module.f.js +4 -4
- package/fs/ci/config/module.f.d.ts +20 -21
- package/fs/ci/config/module.f.js +8 -10
- package/fs/ci/deno/module.f.js +8 -4
- package/fs/ci/module.f.js +9 -9
- package/fs/ci/node/module.f.d.ts +1 -1
- package/fs/ci/node/module.f.js +3 -5
- package/fs/ci/playwright/module.f.js +3 -3
- package/fs/ci/proof.f.js +14 -14
- package/fs/ci/rust/module.f.js +2 -2
- package/fs/cli/module.f.js +3 -3
- package/fs/cli/proof.f.js +3 -3
- package/fs/{types → common}/monoid/module.f.d.ts +1 -1
- package/fs/crypto/hmac/module.f.js +2 -2
- package/fs/crypto/hmac/proof.f.js +5 -5
- package/fs/crypto/pow/module.f.js +3 -3
- package/fs/crypto/pow/proof.f.js +4 -4
- package/fs/crypto/secp/module.f.js +2 -2
- package/fs/crypto/secp/proof.f.js +3 -3
- package/fs/crypto/sha2/module.f.js +2 -2
- package/fs/crypto/sha2/proof.f.js +6 -6
- package/fs/crypto/sign/module.f.js +4 -4
- package/fs/crypto/vdf/module.f.js +1 -1
- package/fs/crypto/vdf/proof.f.js +1 -1
- package/fs/dev/module.f.js +6 -6
- package/fs/dev/package_json/module.f.js +6 -6
- package/fs/dev/package_json/proof.f.js +3 -3
- package/fs/dev/proof.f.js +2 -2
- package/fs/djs/ast/module.f.js +2 -2
- package/fs/djs/ast/proof.f.js +4 -4
- package/fs/djs/examples/m.f.d.ts +1 -1
- package/fs/djs/module.f.d.ts +1 -1
- package/fs/djs/module.f.js +5 -5
- package/fs/djs/parser/module.f.js +4 -4
- package/fs/djs/parser/proof.f.js +19 -7
- package/fs/djs/proof.f.js +3 -3
- package/fs/djs/serializer/module.f.js +6 -6
- package/fs/djs/serializer/proof.f.js +4 -4
- package/fs/djs/tokenizer/module.f.js +3 -3
- package/fs/djs/tokenizer/proof.f.js +5 -5
- package/fs/djs/tokenizer-new/proof.f.js +6 -6
- package/fs/djs/transpiler/module.f.d.ts +5 -0
- package/fs/djs/transpiler/module.f.js +21 -11
- package/fs/djs/transpiler/proof.f.js +5 -5
- package/fs/effects/memory/module.f.js +4 -4
- package/fs/effects/memory/proof.f.js +3 -3
- package/fs/effects/module.f.d.ts +15 -0
- package/fs/effects/module.f.js +15 -1
- package/fs/effects/node/memory/module.js +2 -2
- package/fs/effects/node/memory/proof.js +3 -3
- package/fs/effects/node/module.f.js +10 -20
- package/fs/effects/node/module.js +13 -11
- package/fs/effects/node/proof.f.d.ts +3 -0
- package/fs/effects/node/proof.f.js +19 -1
- package/fs/effects/node/virtual/module.f.js +7 -8
- package/fs/effects/node/virtual/proof.f.d.ts +1 -0
- package/fs/effects/node/virtual/proof.f.js +11 -4
- package/fs/effects/proof.f.d.ts +5 -0
- package/fs/effects/proof.f.js +22 -1
- package/fs/emergent_testing/all.test.js +2 -2
- package/fs/emergent_testing/example.f.d.ts +1 -1
- package/fs/emergent_testing/module.f.js +6 -6
- package/fs/emergent_testing/proof.f.d.ts +19 -17
- package/fs/emergent_testing/proof.f.js +7 -7
- package/fs/emergent_testing/scenarios/all.js +1 -1
- package/fs/fsc/bnf.f.js +2 -2
- package/fs/fsc/json.f.js +1 -1
- package/fs/fsc/module.f.d.ts +1 -0
- package/fs/fsc/module.f.js +11 -7
- package/fs/fsc/proof.f.js +4 -4
- package/fs/fsm/module.f.js +9 -9
- package/fs/fsm/proof.f.js +7 -7
- package/fs/js/tokenizer/module.f.d.ts +1 -1
- package/fs/js/tokenizer/module.f.js +14 -8
- package/fs/js/tokenizer/proof.f.js +64 -5
- package/fs/mcp/module.f.d.ts +13 -13
- package/fs/mcp/module.f.js +8 -8
- package/fs/mcp/proof.f.js +5 -5
- package/fs/mcp/stdio/module.f.d.ts +2 -2
- package/fs/mcp/stdio/module.f.js +10 -10
- package/fs/mcp/stdio/proof.f.js +10 -10
- package/fs/{html → media/html}/module.f.d.ts +3 -3
- package/fs/{html → media/html}/module.f.js +9 -9
- package/fs/media/json/module.f.d.ts +50 -0
- package/fs/{json → media/json}/module.f.js +7 -7
- package/fs/{json → media/json}/parser/module.f.d.ts +2 -2
- package/fs/{json → media/json}/parser/module.f.js +7 -7
- package/fs/{json → media/json}/parser/proof.f.js +24 -6
- package/fs/{json → media/json}/proof.f.js +4 -4
- package/fs/media/json/rpc/module.f.d.ts +114 -0
- package/fs/{json → media/json}/rpc/module.f.js +3 -3
- package/fs/{json → media/json}/rpc/proof.f.js +4 -4
- package/fs/media/json/schema/module.f.d.ts +78 -0
- package/fs/{json → media/json}/schema/module.f.js +2 -2
- package/fs/{json → media/json}/schema/proof.f.js +3 -3
- package/fs/{json → media/json}/serializer/module.f.d.ts +1 -1
- package/fs/{json → media/json}/serializer/module.f.js +2 -2
- package/fs/{json → media/json}/serializer/proof.f.js +2 -2
- package/fs/{json → media/json}/tokenizer/module.f.d.ts +2 -2
- package/fs/{json → media/json}/tokenizer/module.f.js +4 -4
- package/fs/{json → media/json}/tokenizer/proof.f.js +5 -5
- package/fs/media/module.f.d.ts +37 -0
- package/fs/media/module.f.js +24 -0
- package/fs/media/proof.f.d.ts +9 -0
- package/fs/media/proof.f.js +57 -0
- package/fs/media/revision/module.f.d.ts +51 -0
- package/fs/media/revision/module.f.js +110 -0
- package/fs/media/revision/proof.f.d.ts +29 -0
- package/fs/media/revision/proof.f.js +119 -0
- package/fs/{mime → media/type}/module.f.d.ts +6 -6
- package/fs/{mime → media/type}/module.f.js +6 -6
- package/fs/{mime → media/type}/proof.f.js +6 -6
- package/fs/module.f.d.ts +2 -0
- package/fs/{fjs/module.f.js → module.f.js} +8 -8
- package/fs/module.js +4 -0
- package/fs/path/module.f.d.ts +6 -0
- package/fs/path/module.f.js +8 -2
- package/fs/path/proof.f.d.ts +1 -0
- package/fs/path/proof.f.js +40 -2
- package/fs/{fjs/proof.f.d.ts → proof.f.d.ts} +1 -0
- package/fs/{fjs/proof.f.js → proof.f.js} +10 -4
- package/fs/sul/id/module.f.js +9 -9
- package/fs/sul/id/proof.f.js +5 -5
- package/fs/sul/level/hash/module.f.js +3 -3
- package/fs/sul/level/hash/proof.f.js +3 -3
- package/fs/sul/level/literal/module.f.js +5 -5
- package/fs/sul/level/literal/proof.f.js +3 -3
- package/fs/sul/module.f.js +3 -3
- package/fs/sul/proof.f.js +3 -3
- package/fs/text/ascii/proof.f.js +3 -3
- package/fs/text/code_point/module.f.js +2 -2
- package/fs/text/code_point/proof.f.js +1 -1
- package/fs/text/module.f.js +5 -5
- package/fs/text/proof.f.js +4 -4
- package/fs/text/sgr/module.f.js +2 -2
- package/fs/text/sgr/proof.f.js +2 -2
- package/fs/text/utf16/module.f.js +5 -5
- package/fs/text/utf16/proof.f.js +4 -4
- package/fs/text/utf8/module.f.d.ts +6 -0
- package/fs/text/utf8/module.f.js +37 -19
- package/fs/text/utf8/proof.f.js +58 -5
- package/fs/types/array/module.f.js +1 -1
- package/fs/types/array/proof.f.js +3 -3
- package/fs/types/bigfloat/module.f.js +1 -1
- package/fs/types/bigfloat/proof.f.js +1 -1
- package/fs/types/bigint/module.f.js +2 -2
- package/fs/types/bigint/proof.f.js +3 -3
- package/fs/types/bit_vec/module.f.js +8 -8
- package/fs/types/bit_vec/proof.f.js +5 -5
- package/fs/types/btree/find/module.f.js +1 -1
- package/fs/types/btree/find/proof.f.d.ts +3 -1
- package/fs/types/btree/find/proof.f.js +7 -7
- package/fs/types/btree/module.f.js +2 -2
- package/fs/types/btree/proof.f.d.ts +11 -5
- package/fs/types/btree/proof.f.js +7 -7
- package/fs/types/btree/remove/module.f.js +4 -4
- package/fs/types/btree/remove/proof.f.d.ts +5 -2
- package/fs/types/btree/remove/proof.f.js +5 -5
- package/fs/types/btree/set/module.f.js +3 -3
- package/fs/types/btree/set/proof.f.js +4 -4
- package/fs/types/byte_set/module.f.js +2 -2
- package/fs/types/byte_set/proof.f.js +4 -4
- package/fs/types/function/compare/proof.f.js +1 -1
- package/fs/types/function/operator/proof.f.d.ts +21 -10
- package/fs/types/function/operator/proof.f.js +1 -1
- package/fs/types/function/proof.f.js +1 -1
- package/fs/types/list/module.f.js +2 -2
- package/fs/types/list/proof.f.d.ts +15 -7
- package/fs/types/list/proof.f.js +4 -4
- package/fs/types/map/proof.f.js +2 -2
- package/fs/types/nibble_set/proof.f.js +2 -2
- package/fs/types/nullable/module.f.js +2 -2
- package/fs/types/nullable/proof.f.js +1 -1
- package/fs/types/number/module.f.js +5 -5
- package/fs/types/number/proof.f.js +1 -1
- package/fs/types/object/module.f.js +4 -4
- package/fs/types/object/proof.f.js +1 -1
- package/fs/types/ordered_map/module.f.js +6 -6
- package/fs/types/ordered_map/proof.f.js +3 -3
- package/fs/types/patricia_trie/proof.f.d.ts +11 -5
- package/fs/types/patricia_trie/proof.f.js +2 -2
- package/fs/types/prime_field/module.f.js +2 -2
- package/fs/types/prime_field/proof.f.js +2 -2
- package/fs/types/range/proof.f.js +1 -1
- package/fs/types/range_map/module.f.js +4 -4
- package/fs/types/range_map/proof.f.js +7 -7
- package/fs/types/result/module.f.d.ts +4 -0
- package/fs/types/result/module.f.js +4 -0
- package/fs/types/result/module.js +1 -1
- package/fs/types/result/proof.f.d.ts +9 -3
- package/fs/types/result/proof.f.js +12 -2
- package/fs/types/rtti/common/module.f.js +4 -4
- package/fs/types/rtti/module.f.d.ts +2 -2
- package/fs/types/rtti/module.f.js +1 -1
- package/fs/types/rtti/parse/module.f.js +5 -5
- package/fs/types/rtti/parse/proof.f.js +2 -2
- package/fs/types/rtti/ts/module.f.js +1 -1
- package/fs/types/rtti/ts/proof.f.js +2 -2
- package/fs/types/rtti/validate/module.f.js +4 -4
- package/fs/types/rtti/validate/proof.f.js +2 -2
- package/fs/types/sorted_list/module.f.js +3 -3
- package/fs/types/sorted_list/proof.f.js +6 -6
- package/fs/types/sorted_set/module.f.js +1 -1
- package/fs/types/sorted_set/proof.f.js +6 -6
- package/fs/types/string/module.f.js +4 -4
- package/fs/types/string/proof.f.js +2 -2
- package/fs/types/string_set/module.f.js +6 -6
- package/fs/types/string_set/proof.f.js +1 -1
- package/fs/types/ts/proof.f.d.ts +18 -18
- package/fs/types/ts/proof.f.js +1 -1
- package/fs/types/uint8array/module.f.js +4 -4
- package/fs/types/uint8array/proof.f.js +4 -4
- package/fs/website/module.f.js +3 -3
- package/fs/website/proof.f.js +3 -3
- package/package.json +8 -8
- package/fs/base64/module.f.js +0 -60
- package/fs/fjs/module.f.d.ts +0 -2
- package/fs/fjs/module.js +0 -4
- package/fs/json/module.f.d.ts +0 -50
- package/fs/json/rpc/module.f.d.ts +0 -114
- package/fs/json/schema/module.f.d.ts +0 -77
- /package/fs/{base128 → basen/base128}/proof.f.d.ts +0 -0
- /package/fs/{cbase32 → basen/cbase32}/proof.f.d.ts +0 -0
- /package/fs/{types → common}/monoid/module.f.js +0 -0
- /package/fs/{types → common}/monoid/proof.f.d.ts +0 -0
- /package/fs/{types → common}/monoid/proof.f.js +0 -0
- /package/fs/{html → media/html}/proof.f.d.ts +0 -0
- /package/fs/{html → media/html}/proof.f.js +0 -0
- /package/fs/{json → media/json}/parser/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/rpc/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/schema/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/serializer/proof.f.d.ts +0 -0
- /package/fs/{json → media/json}/tokenizer/proof.f.d.ts +0 -0
- /package/fs/{mime → media/type}/proof.f.d.ts +0 -0
- /package/fs/{fjs/module.d.ts → module.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assert, assertEq } from
|
|
2
|
-
import { compress, level3Id } from
|
|
3
|
-
import { emptyEncodeState, encode } from
|
|
1
|
+
import { assert, assertEq } from '../../../asserts/module.f.js';
|
|
2
|
+
import { compress, level3Id } from '../../id/module.f.js';
|
|
3
|
+
import { emptyEncodeState, encode } from './module.f.js';
|
|
4
4
|
const add = (l, r, m, isSymbol, s) => [...s, [l, r, m, isSymbol]];
|
|
5
5
|
const enc = encode(add);
|
|
6
6
|
const initial = emptyEncodeState([]);
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { log2 } from
|
|
8
|
-
import { msb, vec } from
|
|
9
|
-
import { strictEqual } from
|
|
10
|
-
import { equal, map } from
|
|
11
|
-
import { join } from
|
|
7
|
+
import { log2 } from '../../../types/bigint/module.f.js';
|
|
8
|
+
import { msb, vec } from '../../../types/bit_vec/module.f.js';
|
|
9
|
+
import { strictEqual } from '../../../types/function/operator/module.f.js';
|
|
10
|
+
import { equal, map } from '../../../types/list/module.f.js';
|
|
11
|
+
import { join } from '../../../types/string/module.f.js';
|
|
12
12
|
export const symbolToString = (s) => s.toString(16);
|
|
13
13
|
export const wordToString = (word) => join(',')(map(symbolToString)(word));
|
|
14
14
|
export const wordEqual = equal(strictEqual);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { chunkList, msb, vec } from
|
|
2
|
-
import { map, stateScan, toArray } from
|
|
3
|
-
import { emptyEncodeState, emptyPipelineState, level, literal1ToVec, literal2ToVec, literal3ToVec, pipelineStep, symbolToString, wordEqual, wordToString } from
|
|
1
|
+
import { chunkList, msb, vec } from '../../../types/bit_vec/module.f.js';
|
|
2
|
+
import { map, stateScan, toArray } from '../../../types/list/module.f.js';
|
|
3
|
+
import { emptyEncodeState, emptyPipelineState, level, literal1ToVec, literal2ToVec, literal3ToVec, pipelineStep, symbolToString, wordEqual, wordToString } from './module.f.js';
|
|
4
4
|
const tests = (n) => {
|
|
5
5
|
const { sum, decode, encode: push } = level(n);
|
|
6
6
|
return {
|
package/fs/sul/module.f.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { emptyPipelineState, pipelineStep } from
|
|
8
|
-
import { encode as hashEncode } from
|
|
9
|
-
import { level3Id } from
|
|
7
|
+
import { emptyPipelineState, pipelineStep } from './level/literal/module.f.js';
|
|
8
|
+
import { encode as hashEncode } from './level/hash/module.f.js';
|
|
9
|
+
import { level3Id } from './id/module.f.js';
|
|
10
10
|
export const emptyEncodeState = (storage) => [emptyPipelineState, storage, []];
|
|
11
11
|
export const encode = (add) => {
|
|
12
12
|
const step = hashEncode(add);
|
package/fs/sul/proof.f.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assert, assertEq } from
|
|
2
|
-
import { compress } from
|
|
3
|
-
import { encode, emptyEncodeState } from
|
|
1
|
+
import { assert, assertEq } from '../asserts/module.f.js';
|
|
2
|
+
import { compress } from './id/module.f.js';
|
|
3
|
+
import { encode, emptyEncodeState } from './module.f.js';
|
|
4
4
|
const run = (bits) => {
|
|
5
5
|
const log = [];
|
|
6
6
|
const add = (l, r, m, isSymbol) => { log.push([l, r, m, isSymbol]); return null; };
|
package/fs/text/ascii/proof.f.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { one, range } from
|
|
2
|
-
import { stringify as jsonStringify } from
|
|
3
|
-
import { sort } from
|
|
1
|
+
import { one, range } from './module.f.js';
|
|
2
|
+
import { stringify as jsonStringify } from '../../media/json/module.f.js';
|
|
3
|
+
import { sort } from '../../types/object/module.f.js';
|
|
4
4
|
const stringify = jsonStringify(sort);
|
|
5
5
|
export const proof = {
|
|
6
6
|
range: () => {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
|
-
import { flat, stateScan } from
|
|
12
|
-
import { contains } from
|
|
11
|
+
import { flat, stateScan } from '../../types/list/module.f.js';
|
|
12
|
+
import { contains } from '../../types/range/module.f.js';
|
|
13
13
|
/**
|
|
14
14
|
* Error mask used to tag invalid code points or encoding errors. A decoded
|
|
15
15
|
* value with this bit set represents a malformed unit rather than a valid
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isBmpCodePoint, isHighSurrogate, isLowSurrogate, isSupplementaryPlane, isTextCodePoint, isValidCodePoint, } from
|
|
1
|
+
import { isBmpCodePoint, isHighSurrogate, isLowSurrogate, isSupplementaryPlane, isTextCodePoint, isValidCodePoint, } from './module.f.js';
|
|
2
2
|
const check = (actual, expected) => {
|
|
3
3
|
if (actual !== expected) {
|
|
4
4
|
throw `${actual} !== ${expected}`;
|
package/fs/text/module.f.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import { msb, tryU8ListToVec, u8List } from
|
|
9
|
-
import { flatMap } from
|
|
10
|
-
import { fromCodePointList, toCodePointList } from
|
|
11
|
-
import { stringToCodePointList, codePointListToString } from
|
|
12
|
-
import { mapUnwrap } from
|
|
8
|
+
import { msb, tryU8ListToVec, u8List } from '../types/bit_vec/module.f.js';
|
|
9
|
+
import { flatMap } from '../types/list/module.f.js';
|
|
10
|
+
import { fromCodePointList, toCodePointList } from './utf8/module.f.js';
|
|
11
|
+
import { stringToCodePointList, codePointListToString } from './utf16/module.f.js';
|
|
12
|
+
import { mapUnwrap } from '../types/nullable/module.f.js';
|
|
13
13
|
export const flat = (indent) => {
|
|
14
14
|
const f = (prefix) => {
|
|
15
15
|
const g = (item) => typeof (item) === 'string' ? [`${prefix}${item}`] : f(`${prefix}${indent}`)(item);
|
package/fs/text/proof.f.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { assert, assertEq } from
|
|
2
|
-
import { flat, utf8, utf8ToString, tryUtf8 } from
|
|
3
|
-
import { join } from
|
|
4
|
-
import { empty, maxLengthBytes } from
|
|
1
|
+
import { assert, assertEq } from '../asserts/module.f.js';
|
|
2
|
+
import { flat, utf8, utf8ToString, tryUtf8 } from './module.f.js';
|
|
3
|
+
import { join } from '../types/string/module.f.js';
|
|
4
|
+
import { empty, maxLengthBytes } from '../types/bit_vec/module.f.js';
|
|
5
5
|
const overflowStr = 'a'.repeat(Number(maxLengthBytes) + 1);
|
|
6
6
|
export const proof = {
|
|
7
7
|
block: () => {
|
package/fs/text/sgr/module.f.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
// C0 control codes
|
|
8
8
|
// https://en.wikipedia.org/wiki/ANSI_escape_code#C0_control_codes
|
|
9
|
-
import { write } from
|
|
10
|
-
import {} from
|
|
9
|
+
import { write } from '../../effects/node/module.f.js';
|
|
10
|
+
import {} from '../../effects/module.f.js';
|
|
11
11
|
import { utf8 } from "../module.f.js";
|
|
12
12
|
export const backspace = '\x08';
|
|
13
13
|
const begin = '\x1b[';
|
package/fs/text/sgr/proof.f.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { fgRed, reset, createConsoleText, backspace, csiWrite } from
|
|
2
|
-
import { virtual, emptyState, defaultNodeProgramOptions } from
|
|
1
|
+
import { fgRed, reset, createConsoleText, backspace, csiWrite } from './module.f.js';
|
|
2
|
+
import { virtual, emptyState, defaultNodeProgramOptions } from '../../effects/node/virtual/module.f.js';
|
|
3
3
|
const makeOptions = (isTTY) => ({ ...defaultNodeProgramOptions, std: { stdout: { isTTY }, stderr: { isTTY } } });
|
|
4
4
|
export const proof = [
|
|
5
5
|
() => {
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import { map, reduce, flatMap, empty, } from
|
|
9
|
-
import { concat } from
|
|
10
|
-
import { contains } from
|
|
11
|
-
import { fn } from
|
|
12
|
-
import { decoder, errorMask, isBmpCodePoint, isHighSurrogate, isLowSurrogate, isSupplementaryPlane, } from
|
|
8
|
+
import { map, reduce, flatMap, empty, } from '../../types/list/module.f.js';
|
|
9
|
+
import { concat } from '../../types/function/operator/module.f.js';
|
|
10
|
+
import { contains } from '../../types/range/module.f.js';
|
|
11
|
+
import { fn } from '../../types/function/module.f.js';
|
|
12
|
+
import { decoder, errorMask, isBmpCodePoint, isHighSurrogate, isLowSurrogate, isSupplementaryPlane, } from '../code_point/module.f.js';
|
|
13
13
|
/**
|
|
14
14
|
* The BMP / surrogate / supplementary-plane predicates used below live in
|
|
15
15
|
* `code_point`, the shared Unicode contract; see that module for their ranges.
|
package/fs/text/utf16/proof.f.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { toCodePointList, fromCodePointList, stringToList, listToString, stringToCodePointList, codePointListToString } from
|
|
2
|
-
import { stringify as jsonStringify } from
|
|
3
|
-
import { sort } from
|
|
4
|
-
import { toArray } from
|
|
1
|
+
import { toCodePointList, fromCodePointList, stringToList, listToString, stringToCodePointList, codePointListToString } from './module.f.js';
|
|
2
|
+
import { stringify as jsonStringify } from '../../media/json/module.f.js';
|
|
3
|
+
import { sort } from '../../types/object/module.f.js';
|
|
4
|
+
import { toArray } from '../../types/list/module.f.js';
|
|
5
5
|
const stringify = (a) => jsonStringify(sort)(a);
|
|
6
6
|
export const proof = {
|
|
7
7
|
toCodePointList: [
|
|
@@ -46,6 +46,12 @@ export declare const utf8StateToError: (state: Utf8NonEmptyState) => I32;
|
|
|
46
46
|
/**
|
|
47
47
|
* Decodes a byte into a Unicode code point, using a given UTF-8 state.
|
|
48
48
|
*
|
|
49
|
+
* Rejects overlong 3-/4-byte encodings (Unicode Table 3-7): a lead `E0` must
|
|
50
|
+
* be followed by a continuation `>= 0xA0`, and a lead `F0` by a continuation
|
|
51
|
+
* `>= 0x90`. It does not itself reject surrogates (`ED A0..BF`) or code
|
|
52
|
+
* points above `U+10FFFF` (`F4 90..BF`); {@link fromVec}'s
|
|
53
|
+
* `isValidCodePoint` pass filters those out of the raw code-point stream.
|
|
54
|
+
*
|
|
49
55
|
* @param state - The current UTF-8 decoding state.
|
|
50
56
|
* @param byte - A single byte to decode.
|
|
51
57
|
* @returns A tuple containing:
|
package/fs/text/utf8/module.f.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { flatMap, toArray } from
|
|
7
|
-
import { decoder, errorMask, isValidCodePoint } from
|
|
8
|
-
import { msb, u8List, length } from
|
|
9
|
-
import { codePointListToString } from
|
|
6
|
+
import { flatMap, toArray } from '../../types/list/module.f.js';
|
|
7
|
+
import { decoder, errorMask, isValidCodePoint } from '../code_point/module.f.js';
|
|
8
|
+
import { msb, u8List, length } from '../../types/bit_vec/module.f.js';
|
|
9
|
+
import { codePointListToString } from '../utf16/module.f.js';
|
|
10
10
|
/**
|
|
11
11
|
* UTF-8 byte-format constants. Each byte kind is defined by a tag — the fixed
|
|
12
12
|
* high bits identifying the kind — and a payload mask selecting the code-point
|
|
@@ -36,6 +36,21 @@ const contByte = (x) => x & contMask | contTag;
|
|
|
36
36
|
* Reads the six payload bits of a continuation byte.
|
|
37
37
|
*/
|
|
38
38
|
const contPayload = (b) => b & contMask;
|
|
39
|
+
/**
|
|
40
|
+
* The valid lead-byte range for 2-, 3-, and 4-byte sequences (RFC 3629);
|
|
41
|
+
* excludes overlong 2-byte leads (`C0`, `C1`) and leads above `U+10FFFF` (`F5`-`F7`).
|
|
42
|
+
*/
|
|
43
|
+
const leadMin = 0b1100_0010;
|
|
44
|
+
const leadMax = 0b1111_0100;
|
|
45
|
+
const isLeadByte = (b) => b >= leadMin && b <= leadMax;
|
|
46
|
+
/**
|
|
47
|
+
* Dispatches a fresh-state byte, emitting `prefix` ahead of whatever the byte
|
|
48
|
+
* itself produces. Shared by the `state === null` arm and by error recovery
|
|
49
|
+
* after {@link utf8StateToError}, which differ only in `prefix`.
|
|
50
|
+
*/
|
|
51
|
+
const restart = (prefix) => (byte) => byte < contTag ? [[...prefix, byte], null]
|
|
52
|
+
: isLeadByte(byte) ? [[...prefix], [byte]]
|
|
53
|
+
: [[...prefix, byte | errorMask], null];
|
|
39
54
|
/**
|
|
40
55
|
* Converts a Unicode code point to a sequence of UTF-8 bytes.
|
|
41
56
|
* @param input The Unicode code point to be converted. Valid range:
|
|
@@ -135,6 +150,12 @@ export const utf8StateToError = (state) => {
|
|
|
135
150
|
/**
|
|
136
151
|
* Decodes a byte into a Unicode code point, using a given UTF-8 state.
|
|
137
152
|
*
|
|
153
|
+
* Rejects overlong 3-/4-byte encodings (Unicode Table 3-7): a lead `E0` must
|
|
154
|
+
* be followed by a continuation `>= 0xA0`, and a lead `F0` by a continuation
|
|
155
|
+
* `>= 0x90`. It does not itself reject surrogates (`ED A0..BF`) or code
|
|
156
|
+
* points above `U+10FFFF` (`F4 90..BF`); {@link fromVec}'s
|
|
157
|
+
* `isValidCodePoint` pass filters those out of the raw code-point stream.
|
|
158
|
+
*
|
|
138
159
|
* @param state - The current UTF-8 decoding state.
|
|
139
160
|
* @param byte - A single byte to decode.
|
|
140
161
|
* @returns A tuple containing:
|
|
@@ -145,13 +166,8 @@ export const utf8ByteToCodePointOp = (byte, state) => {
|
|
|
145
166
|
if (byte < 0x00 || byte > 0xff) {
|
|
146
167
|
return [[errorMask], state];
|
|
147
168
|
}
|
|
148
|
-
if (state === null)
|
|
149
|
-
|
|
150
|
-
return [[byte], null];
|
|
151
|
-
if (byte >= 0b1100_0010 && byte <= 0b1111_0100)
|
|
152
|
-
return [[], [byte]];
|
|
153
|
-
return [[byte | errorMask], null];
|
|
154
|
-
}
|
|
169
|
+
if (state === null)
|
|
170
|
+
return restart([])(byte);
|
|
155
171
|
if (byte >= contTag && byte < lead2Tag) {
|
|
156
172
|
switch (state.length) {
|
|
157
173
|
case 1: {
|
|
@@ -159,8 +175,15 @@ export const utf8ByteToCodePointOp = (byte, state) => {
|
|
|
159
175
|
if (s0 < lead3Tag) {
|
|
160
176
|
return [[((s0 & lead2Mask) << 6) + contPayload(byte)], null];
|
|
161
177
|
}
|
|
162
|
-
if (s0 < 0b1111_1000)
|
|
163
|
-
|
|
178
|
+
if (s0 < 0b1111_1000) {
|
|
179
|
+
// Reject overlong 3-/4-byte encodings: after lead `E0` the
|
|
180
|
+
// first continuation must be >= 0xA0, after lead `F0` it
|
|
181
|
+
// must be >= 0x90 (Unicode Table 3-7).
|
|
182
|
+
const overlong = s0 === lead3Tag && byte < 0b1010_0000 ||
|
|
183
|
+
s0 === lead4Tag && byte < 0b1001_0000;
|
|
184
|
+
if (!overlong)
|
|
185
|
+
return [[], [s0, byte]];
|
|
186
|
+
}
|
|
164
187
|
break;
|
|
165
188
|
}
|
|
166
189
|
case 2: {
|
|
@@ -184,12 +207,7 @@ export const utf8ByteToCodePointOp = (byte, state) => {
|
|
|
184
207
|
}
|
|
185
208
|
}
|
|
186
209
|
}
|
|
187
|
-
|
|
188
|
-
if (byte < contTag)
|
|
189
|
-
return [[error, byte], null];
|
|
190
|
-
if (byte >= 0b1100_0010 && byte <= 0b1111_0100)
|
|
191
|
-
return [[error], [byte]];
|
|
192
|
-
return [[error, byte | errorMask], null];
|
|
210
|
+
return restart([utf8StateToError(state)])(byte);
|
|
193
211
|
};
|
|
194
212
|
/**
|
|
195
213
|
* Handles the end-of-file (EOF) case for UTF-8 decoding.
|
package/fs/text/utf8/proof.f.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { toCodePointList, fromCodePointList, fromVec } from
|
|
2
|
-
import { stringify as jsonStringify } from
|
|
3
|
-
import { sort } from
|
|
4
|
-
import { toArray } from
|
|
5
|
-
import { msb, u8ListToVec } from
|
|
1
|
+
import { toCodePointList, fromCodePointList, fromVec } from './module.f.js';
|
|
2
|
+
import { stringify as jsonStringify } from '../../media/json/module.f.js';
|
|
3
|
+
import { sort } from '../../types/object/module.f.js';
|
|
4
|
+
import { toArray } from '../../types/list/module.f.js';
|
|
5
|
+
import { msb, u8ListToVec } from '../../types/bit_vec/module.f.js';
|
|
6
6
|
const stringify = jsonStringify(sort);
|
|
7
7
|
export const proof = {
|
|
8
8
|
toCodePoint: [
|
|
@@ -65,6 +65,45 @@ export const proof = {
|
|
|
65
65
|
if (result !== '[-2147448800,-2147432416]') {
|
|
66
66
|
throw result;
|
|
67
67
|
}
|
|
68
|
+
},
|
|
69
|
+
// Overlong 3-byte encodings (E0 80..9F ..) are rejected, not decoded.
|
|
70
|
+
() => {
|
|
71
|
+
const result = stringify(toArray(toCodePointList([224, 128, 128])));
|
|
72
|
+
if (result !== '[-2147483424,-2147483520,-2147483520]') {
|
|
73
|
+
throw result;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
() => {
|
|
77
|
+
const result = stringify(toArray(toCodePointList([224, 159, 191])));
|
|
78
|
+
if (result !== '[-2147483424,-2147483489,-2147483457]') {
|
|
79
|
+
throw result;
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
// Overlong 4-byte encodings (F0 80..8F .. ..) are rejected, not decoded.
|
|
83
|
+
() => {
|
|
84
|
+
const result = stringify(toArray(toCodePointList([240, 128, 128, 128])));
|
|
85
|
+
if (result !== '[-2147483408,-2147483520,-2147483520,-2147483520]') {
|
|
86
|
+
throw result;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
() => {
|
|
90
|
+
const result = stringify(toArray(toCodePointList([240, 143, 191, 191])));
|
|
91
|
+
if (result !== '[-2147483408,-2147483505,-2147483457,-2147483457]') {
|
|
92
|
+
throw result;
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
// Valid boundary cases still decode: E0 A0 80 -> U+0800, F0 90 80 80 -> U+10000.
|
|
96
|
+
() => {
|
|
97
|
+
const result = stringify(toArray(toCodePointList([224, 160, 128])));
|
|
98
|
+
if (result !== '[2048]') {
|
|
99
|
+
throw result;
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
() => {
|
|
103
|
+
const result = stringify(toArray(toCodePointList([240, 144, 128, 128])));
|
|
104
|
+
if (result !== '[65536]') {
|
|
105
|
+
throw result;
|
|
106
|
+
}
|
|
68
107
|
}
|
|
69
108
|
],
|
|
70
109
|
fromCodePointList: [
|
|
@@ -229,5 +268,19 @@ export const proof = {
|
|
|
229
268
|
throw 'expected empty string';
|
|
230
269
|
}
|
|
231
270
|
},
|
|
271
|
+
// Overlong 3-byte encoding (E0 80 80, would decode to U+0000) → null
|
|
272
|
+
() => {
|
|
273
|
+
const v = u8ListToVec(msb)([0xe0, 0x80, 0x80]);
|
|
274
|
+
if (fromVec(v) !== null) {
|
|
275
|
+
throw 'expected null for overlong 3-byte encoding';
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
// Overlong 4-byte encoding (F0 80 80 80, would decode to U+0000) → null
|
|
279
|
+
() => {
|
|
280
|
+
const v = u8ListToVec(msb)([0xf0, 0x80, 0x80, 0x80]);
|
|
281
|
+
if (fromVec(v) !== null) {
|
|
282
|
+
throw 'expected null for overlong 4-byte encoding';
|
|
283
|
+
}
|
|
284
|
+
},
|
|
232
285
|
]
|
|
233
286
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { fromUndefined, map } from
|
|
6
|
+
import { fromUndefined, map } from '../nullable/module.f.js';
|
|
7
7
|
export const isArray = (value) => value instanceof Array;
|
|
8
8
|
/**
|
|
9
9
|
* Currently, TypeScript can't narrow the type of `readonly T[]` to `Array2<T>`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { at, first, last, head, tail, splitFirst, splitLast, empty } from
|
|
2
|
-
import { stringify as jsonStringify } from
|
|
3
|
-
import { sort } from
|
|
1
|
+
import { at, first, last, head, tail, splitFirst, splitLast, empty } from './module.f.js';
|
|
2
|
+
import { stringify as jsonStringify } from '../../media/json/module.f.js';
|
|
3
|
+
import { sort } from '../object/module.f.js';
|
|
4
4
|
const stringify = jsonStringify(sort);
|
|
5
5
|
export const proof = {
|
|
6
6
|
stringify: () => {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
* const c = combination([3n, 2n, 1n]) // 60n
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
|
-
import { cmp } from
|
|
20
|
-
import { reduce } from
|
|
19
|
+
import { cmp } from '../function/compare/module.f.js';
|
|
20
|
+
import { reduce } from '../list/module.f.js';
|
|
21
21
|
/**
|
|
22
22
|
* Adds two `bigint` values.
|
|
23
23
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { sum, abs, serialize, log2, bitLength, mask, combination, factorial, xor, multiple, product, divUp, roundUp, divUp8, roundUp8 } from
|
|
2
|
-
import { assertEq } from
|
|
3
|
-
import { min } from
|
|
1
|
+
import { sum, abs, serialize, log2, bitLength, mask, combination, factorial, xor, multiple, product, divUp, roundUp, divUp8, roundUp8 } from './module.f.js';
|
|
2
|
+
import { assertEq } from '../../asserts/module.f.js';
|
|
3
|
+
import { min } from '../function/compare/module.f.js';
|
|
4
4
|
const oldLog2 = (v) => {
|
|
5
5
|
if (v <= 0n) {
|
|
6
6
|
return -1n;
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
*
|
|
22
22
|
* @module
|
|
23
23
|
*/
|
|
24
|
-
import { bitLength, divUp, mask, maxLength, xor } from
|
|
25
|
-
import { flip, identity } from
|
|
26
|
-
import { iterable, map } from
|
|
27
|
-
import { asBase, asNominal } from
|
|
28
|
-
import { repeat as mRepeat } from
|
|
29
|
-
import { cmp, max, min } from
|
|
30
|
-
import { mapUnwrap } from
|
|
24
|
+
import { bitLength, divUp, mask, maxLength, xor } from '../bigint/module.f.js';
|
|
25
|
+
import { flip, identity } from '../function/module.f.js';
|
|
26
|
+
import { iterable, map } from '../list/module.f.js';
|
|
27
|
+
import { asBase, asNominal } from '../nominal/module.f.js';
|
|
28
|
+
import { repeat as mRepeat } from '../../common/monoid/module.f.js';
|
|
29
|
+
import { cmp, max, min } from '../function/compare/module.f.js';
|
|
30
|
+
import { mapUnwrap } from '../nullable/module.f.js';
|
|
31
31
|
/**
|
|
32
32
|
* Maximum length of a bit vector in bits (1_048_576 = 0x10_0000).
|
|
33
33
|
* This limit is enforced by Bun's `bigint` size constraint, the minimal limit
|
|
@@ -352,7 +352,7 @@ const mappedChunkList = (g) => (f) => (bo) => (n) => {
|
|
|
352
352
|
* @param u The unpacked vector to be chunked.
|
|
353
353
|
* @returns A thunk that produces a list of unsigned integers, each representing one chunk.
|
|
354
354
|
*/
|
|
355
|
-
export const uintChunkList = mappedChunkList(
|
|
355
|
+
export const uintChunkList = mappedChunkList(identity)(unpackedUint);
|
|
356
356
|
/**
|
|
357
357
|
* Chunks a bit vector into fixed-size pieces of `n` bits using the provided bit order.
|
|
358
358
|
* The last chunk may be smaller than `n` bits if the vector length is not a multiple of `n`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { assertEq } from
|
|
2
|
-
import { mask } from
|
|
3
|
-
import { asBase, asNominal } from
|
|
4
|
-
import { length, empty, uint, vec, lsb, msb, repeat, vec8, maxLength, u8ListToVec, tryU8ListToVec, u8List, chunkList, fromSentinel } from
|
|
5
|
-
import { repeat as listRepeat, toArray } from
|
|
1
|
+
import { assertEq } from '../../asserts/module.f.js';
|
|
2
|
+
import { mask } from '../bigint/module.f.js';
|
|
3
|
+
import { asBase, asNominal } from '../nominal/module.f.js';
|
|
4
|
+
import { length, empty, uint, vec, lsb, msb, repeat, vec8, maxLength, u8ListToVec, tryU8ListToVec, u8List, chunkList, fromSentinel } from './module.f.js';
|
|
5
|
+
import { repeat as listRepeat, toArray } from '../list/module.f.js';
|
|
6
6
|
const unsafeVec = (a) => asNominal(a);
|
|
7
7
|
// 0x8 = 0b1000 = 0 + 8
|
|
8
8
|
// 0x9 = 0b1001 = 1 + 8
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { find as btreeFind } from
|
|
2
|
-
import { map, toArray } from
|
|
3
|
-
import { stringify } from
|
|
4
|
-
import { sort } from
|
|
5
|
-
import {} from
|
|
6
|
-
import { cmp } from
|
|
7
|
-
import { set as setSet } from
|
|
1
|
+
import { find as btreeFind } from './module.f.js';
|
|
2
|
+
import { map, toArray } from '../../list/module.f.js';
|
|
3
|
+
import { stringify } from '../../../media/json/module.f.js';
|
|
4
|
+
import { sort } from '../../object/module.f.js';
|
|
5
|
+
import {} from '../types/module.f.js';
|
|
6
|
+
import { cmp } from '../../string/module.f.js';
|
|
7
|
+
import { set as setSet } from '../set/module.f.js';
|
|
8
8
|
const jsonStr = stringify(sort);
|
|
9
9
|
const set = node => value => setSet(cmp(value))(() => value)(node);
|
|
10
10
|
const str = r => jsonStr(toArray(map((x) => x[0])(r)));
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { flat } from
|
|
7
|
-
import { map } from
|
|
6
|
+
import { flat } from '../list/module.f.js';
|
|
7
|
+
import { map } from '../nullable/module.f.js';
|
|
8
8
|
const nodeValues = node => () => {
|
|
9
9
|
switch (node.length) {
|
|
10
10
|
case 1:
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
declare const valueTest1: () => void;
|
|
2
|
+
declare const valuesTest2: () => void;
|
|
3
|
+
declare const findTrue: () => void;
|
|
4
|
+
declare const find: () => void;
|
|
5
|
+
declare const test: () => void;
|
|
1
6
|
export declare const proof: {
|
|
2
|
-
valueTest1:
|
|
3
|
-
valuesTest2:
|
|
4
|
-
findTrue:
|
|
5
|
-
find:
|
|
6
|
-
test:
|
|
7
|
+
valueTest1: typeof valueTest1;
|
|
8
|
+
valuesTest2: typeof valuesTest2;
|
|
9
|
+
findTrue: typeof findTrue;
|
|
10
|
+
find: typeof find;
|
|
11
|
+
test: typeof test;
|
|
7
12
|
};
|
|
13
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { values } from
|
|
2
|
-
import { stringify as jsonStringify } from
|
|
3
|
-
import { sort } from
|
|
4
|
-
import { cmp } from
|
|
5
|
-
import { next, toArray } from
|
|
6
|
-
import { set as setSet } from
|
|
7
|
-
import { value, find as findFind } from
|
|
1
|
+
import { values } from './module.f.js';
|
|
2
|
+
import { stringify as jsonStringify } from '../../media/json/module.f.js';
|
|
3
|
+
import { sort } from '../object/module.f.js';
|
|
4
|
+
import { cmp } from '../string/module.f.js';
|
|
5
|
+
import { next, toArray } from '../list/module.f.js';
|
|
6
|
+
import { set as setSet } from './set/module.f.js';
|
|
7
|
+
import { value, find as findFind } from './find/module.f.js';
|
|
8
8
|
const jsonStr = jsonStringify(sort);
|
|
9
9
|
const stringify = sequence => jsonStr(toArray(sequence));
|
|
10
10
|
const set = node => value => setSet(cmp(value))(() => value)(node);
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { collapseRoot } from
|
|
7
|
-
import { find } from
|
|
8
|
-
import { fold, concat, next } from
|
|
9
|
-
import { map } from
|
|
6
|
+
import { collapseRoot } from '../types/module.f.js';
|
|
7
|
+
import { find } from '../find/module.f.js';
|
|
8
|
+
import { fold, concat, next } from '../../list/module.f.js';
|
|
9
|
+
import { map } from '../../nullable/module.f.js';
|
|
10
10
|
const path = (tail) => (n) => {
|
|
11
11
|
switch (n.length) {
|
|
12
12
|
case 1: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { nodeRemove } from
|
|
2
|
-
import { set as setSet } from
|
|
3
|
-
import { cmp } from
|
|
4
|
-
import { stringify } from
|
|
5
|
-
import { sort } from
|
|
1
|
+
import { nodeRemove } from './module.f.js';
|
|
2
|
+
import { set as setSet } from '../set/module.f.js';
|
|
3
|
+
import { cmp } from '../../string/module.f.js';
|
|
4
|
+
import { stringify } from '../../../media/json/module.f.js';
|
|
5
|
+
import { sort } from '../../object/module.f.js';
|
|
6
6
|
const set = (node) => (value) => setSet(cmp(value))(() => value)(node);
|
|
7
7
|
const remove = (node) => (value) => nodeRemove(cmp(value))(node);
|
|
8
8
|
const jsonStr = stringify(sort);
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { collapseRoot } from
|
|
7
|
-
import { find } from
|
|
8
|
-
import { fold } from
|
|
6
|
+
import { collapseRoot } from '../types/module.f.js';
|
|
7
|
+
import { find } from '../find/module.f.js';
|
|
8
|
+
import { fold } from '../../list/module.f.js';
|
|
9
9
|
const b57 = b => b.length === 5 ? [b] : [[b[0], b[1], b[2]], b[3], [b[4], b[5], b[6]]];
|
|
10
10
|
const reduceOp = ([i, x]) => a => {
|
|
11
11
|
switch (i) {
|