functionalscript 0.3.7 → 0.3.9
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.js +0 -1
- package/com/cs/module.f.js +5 -6
- package/com/rust/module.f.d.ts +3 -3
- package/com/rust/module.f.js +24 -29
- package/com/test/build.f.js +2 -2
- package/com/types/module.f.d.ts +1 -1
- package/com/types/module.f.js +1 -2
- package/com/types/testlib.f.js +0 -1
- package/commonjs/build/module.f.d.ts +2 -2
- package/commonjs/build/module.f.js +3 -6
- package/commonjs/build/test.f.js +0 -4
- package/commonjs/module/function/module.f.d.ts +1 -1
- package/commonjs/module/function/module.f.js +1 -1
- package/commonjs/module/module.f.d.ts +1 -1
- package/commonjs/module/module.f.js +2 -3
- package/commonjs/path/module.f.d.ts +5 -5
- package/commonjs/path/module.f.js +6 -8
- package/commonjs/path/test.f.js +1 -2
- package/crypto/prime_field/module.f.d.ts +1 -1
- package/crypto/prime_field/module.f.js +1 -1
- package/crypto/secp/module.f.d.ts +1 -1
- package/crypto/secp/module.f.js +2 -2
- package/crypto/sha2/module.f.d.ts +75 -12
- package/crypto/sha2/module.f.js +246 -139
- package/crypto/sha2/test.f.d.ts +22 -3
- package/crypto/sha2/test.f.js +120 -67
- package/dev/test/module.f.d.ts +1 -1
- package/dev/test/module.f.js +4 -5
- package/dev/test.f.js +0 -4
- package/djs/module.f.d.ts +1 -1
- package/djs/module.f.js +0 -1
- package/djs/parser/module.f.d.ts +1 -1
- package/djs/parser/module.f.js +0 -2
- package/djs/serializer/module.f.d.ts +2 -2
- package/djs/serializer/module.f.js +0 -2
- package/djs/tokenizer/module.f.js +0 -1
- package/fsc/test.f.js +0 -1
- package/js/tokenizer/module.f.d.ts +1 -1
- package/js/tokenizer/module.f.js +1 -1
- package/json/parser/module.f.d.ts +2 -2
- package/json/parser/module.f.js +0 -3
- package/json/serializer/module.f.js +0 -2
- package/json/tokenizer/module.f.js +0 -1
- package/package.json +1 -1
- package/text/ascii/module.f.d.ts +1 -1
- package/text/ascii/module.f.js +2 -3
- package/text/ascii/test.f.js +2 -4
- package/text/module.f.d.ts +18 -3
- package/text/module.f.js +22 -6
- package/text/sgr/module.f.js +1 -1
- package/text/test.f.d.ts +4 -1
- package/text/test.f.js +24 -16
- package/text/utf16/module.f.d.ts +5 -6
- package/text/utf16/module.f.js +9 -10
- package/text/utf16/test.f.js +29 -30
- package/text/utf8/module.f.d.ts +8 -5
- package/text/utf8/module.f.js +3 -5
- package/text/utf8/test.f.js +34 -35
- package/types/bigfloat/module.f.js +1 -1
- package/types/bigint/module.f.d.ts +36 -7
- package/types/bigint/module.f.js +40 -11
- package/types/bigint/test.f.d.ts +8 -0
- package/types/bigint/test.f.js +81 -2
- package/types/bit_vec/module.f.d.ts +103 -83
- package/types/bit_vec/module.f.js +68 -110
- package/types/bit_vec/test.f.d.ts +20 -8
- package/types/bit_vec/test.f.js +110 -117
- package/types/btree/find/module.f.d.ts +11 -10
- package/types/btree/find/module.f.js +1 -5
- package/types/btree/find/test.f.js +4 -6
- package/types/btree/module.f.d.ts +3 -3
- package/types/btree/module.f.js +2 -5
- package/types/btree/remove/module.f.d.ts +2 -2
- package/types/btree/remove/module.f.js +0 -3
- package/types/btree/remove/test.f.js +4 -7
- package/types/btree/set/module.f.d.ts +2 -2
- package/types/btree/set/module.f.js +2 -6
- package/types/btree/set/test.f.js +3 -6
- package/types/btree/test.f.js +9 -13
- package/types/btree/types/module.f.d.ts +1 -3
- package/types/byte_set/module.f.d.ts +3 -3
- package/types/byte_set/module.f.js +1 -4
- package/types/byte_set/test.f.js +2 -4
- package/types/function/compare/module.f.d.ts +1 -5
- package/types/function/compare/module.f.js +0 -1
- package/types/function/compare/test.f.js +1 -2
- package/types/function/module.f.d.ts +1 -1
- package/types/function/module.f.js +1 -1
- package/types/function/operator/module.f.d.ts +2 -3
- package/types/function/operator/module.f.js +5 -5
- package/types/function/test.f.js +1 -2
- package/types/list/module.f.d.ts +1 -1
- package/types/list/module.f.js +9 -9
- package/types/list/test.f.js +2 -4
- package/types/map/module.f.d.ts +7 -9
- package/types/map/module.f.js +6 -15
- package/types/map/test.f.js +3 -4
- package/types/nibble_set/module.f.d.ts +2 -3
- package/types/nibble_set/test.f.js +26 -27
- package/types/nullable/test.f.js +2 -2
- package/types/number/module.f.d.ts +2 -2
- package/types/number/module.f.js +1 -2
- package/types/number/test.f.js +1 -2
- package/types/object/module.f.d.ts +5 -5
- package/types/object/module.f.js +2 -4
- package/types/object/test.f.js +3 -3
- package/types/range/test.f.js +6 -6
- package/types/range_map/module.f.d.ts +8 -8
- package/types/range_map/module.f.js +3 -9
- package/types/range_map/test.f.js +2 -4
- package/types/result/module.f.d.ts +2 -3
- package/types/sorted_list/module.f.d.ts +8 -8
- package/types/sorted_list/module.f.js +2 -6
- package/types/sorted_list/test.f.js +12 -17
- package/types/sorted_set/module.f.d.ts +2 -2
- package/types/sorted_set/module.f.js +2 -5
- package/types/sorted_set/test.f.js +14 -19
- package/types/string/module.f.d.ts +5 -5
- package/types/string/module.f.js +2 -4
- package/types/string/test.f.js +2 -4
- package/types/string_set/module.f.d.ts +2 -2
- package/types/string_set/module.f.js +5 -11
- package/types/string_set/test.f.js +25 -25
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const { unsafeCmp } = compare;
|
|
1
|
+
import { has, intersect, union } from "./module.f.js";
|
|
2
|
+
import { unsafeCmp } from "../function/compare/module.f.js";
|
|
4
3
|
import * as json from "../../json/module.f.js";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
const { toArray, countdown, length } = list;
|
|
9
|
-
import * as Map from "../map/module.f.js";
|
|
10
|
-
import * as f from "../function/module.f.js";
|
|
11
|
-
const { flip } = f;
|
|
4
|
+
import { sort } from "../object/module.f.js";
|
|
5
|
+
import { toArray, countdown, length } from "../list/module.f.js";
|
|
6
|
+
import { flip } from "../function/module.f.js";
|
|
12
7
|
const stringify = a => json.stringify(sort)(a);
|
|
13
8
|
const reverseCmp = flip(unsafeCmp);
|
|
14
9
|
export default {
|
|
15
10
|
union: [
|
|
16
11
|
() => {
|
|
17
|
-
const result = stringify(toArray(
|
|
12
|
+
const result = stringify(toArray(union(unsafeCmp)([2, 3, 4])([1, 3, 5])));
|
|
18
13
|
if (result !== '[1,2,3,4,5]') {
|
|
19
14
|
throw result;
|
|
20
15
|
}
|
|
21
16
|
},
|
|
22
17
|
() => {
|
|
23
|
-
const result = stringify(toArray(
|
|
18
|
+
const result = stringify(toArray(union(unsafeCmp)([1, 2, 3])([])));
|
|
24
19
|
if (result !== '[1,2,3]') {
|
|
25
20
|
throw result;
|
|
26
21
|
}
|
|
@@ -28,7 +23,7 @@ export default {
|
|
|
28
23
|
() => {
|
|
29
24
|
const n = 10_000;
|
|
30
25
|
const sortedSet = toArray(countdown(n));
|
|
31
|
-
const result =
|
|
26
|
+
const result = union(reverseCmp)(sortedSet)(sortedSet);
|
|
32
27
|
const len = length(result);
|
|
33
28
|
if (len != n) {
|
|
34
29
|
throw result;
|
|
@@ -37,13 +32,13 @@ export default {
|
|
|
37
32
|
],
|
|
38
33
|
intersect: [
|
|
39
34
|
() => {
|
|
40
|
-
const result = stringify(toArray(
|
|
35
|
+
const result = stringify(toArray(intersect(unsafeCmp)([2, 3, 4])([1, 3, 5])));
|
|
41
36
|
if (result !== '[3]') {
|
|
42
37
|
throw result;
|
|
43
38
|
}
|
|
44
39
|
},
|
|
45
40
|
() => {
|
|
46
|
-
const result = stringify(toArray(
|
|
41
|
+
const result = stringify(toArray(intersect(unsafeCmp)([1, 2, 3])([])));
|
|
47
42
|
if (result !== '[]') {
|
|
48
43
|
throw result;
|
|
49
44
|
}
|
|
@@ -51,25 +46,25 @@ export default {
|
|
|
51
46
|
],
|
|
52
47
|
has: [
|
|
53
48
|
() => {
|
|
54
|
-
const result =
|
|
49
|
+
const result = has(unsafeCmp)(0)([0, 10, 20, 30, 40, 50, 60, 70, 80, 90]);
|
|
55
50
|
if (!result) {
|
|
56
51
|
throw result;
|
|
57
52
|
}
|
|
58
53
|
},
|
|
59
54
|
() => {
|
|
60
|
-
const result =
|
|
55
|
+
const result = has(unsafeCmp)(3)([0, 10, 20, 30, 40, 50, 60, 70, 80, 90]);
|
|
61
56
|
if (result) {
|
|
62
57
|
throw result;
|
|
63
58
|
}
|
|
64
59
|
},
|
|
65
60
|
() => {
|
|
66
|
-
const result =
|
|
61
|
+
const result = has(unsafeCmp)(77)([0, 10, 20, 30, 40, 50, 60, 70, 80, 90]);
|
|
67
62
|
if (result) {
|
|
68
63
|
throw result;
|
|
69
64
|
}
|
|
70
65
|
},
|
|
71
66
|
() => {
|
|
72
|
-
const result =
|
|
67
|
+
const result = has(unsafeCmp)(80)([0, 10, 20, 30, 40, 50, 60, 70, 80, 90]);
|
|
73
68
|
if (!result) {
|
|
74
69
|
throw result;
|
|
75
70
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export declare const join: (_: string) => (input:
|
|
4
|
-
export declare const concat: (input:
|
|
1
|
+
import { type List } from '../list/module.f.ts';
|
|
2
|
+
import { type Sign } from '../function/compare/module.f.ts';
|
|
3
|
+
export declare const join: (_: string) => (input: List<string>) => string;
|
|
4
|
+
export declare const concat: (input: List<string>) => string;
|
|
5
5
|
export declare const repeat: (n: string) => (v: number) => string;
|
|
6
|
-
export declare const cmp: (a: string) => (b: string) =>
|
|
6
|
+
export declare const cmp: (a: string) => (b: string) => Sign;
|
package/types/string/module.f.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
const { reduce: listReduce, repeat: listRepeat } = list;
|
|
1
|
+
import { reduce as listReduce, repeat as listRepeat } from "../list/module.f.js";
|
|
3
2
|
import { compose } from "../function/module.f.js";
|
|
4
|
-
import
|
|
5
|
-
const { unsafeCmp } = compare;
|
|
3
|
+
import { unsafeCmp } from "../function/compare/module.f.js";
|
|
6
4
|
import { join as joinOp, concat as concatOp } from "../function/operator/module.f.js";
|
|
7
5
|
const reduce = o => listReduce(o)('');
|
|
8
6
|
export const join = compose(joinOp)(reduce);
|
package/types/string/test.f.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import * as list from "../list/module.f.js";
|
|
4
|
-
const { repeat: repeatList } = list;
|
|
1
|
+
import { join, concat, repeat, cmp } from "./module.f.js";
|
|
2
|
+
import { repeat as repeatList } from "../list/module.f.js";
|
|
5
3
|
export default {
|
|
6
4
|
join: {
|
|
7
5
|
0: () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { Tree } from '../btree/types/module.f.ts';
|
|
2
2
|
import { type List } from '../list/module.f.ts';
|
|
3
3
|
export declare const values: (s: StringSet) => List<string>;
|
|
4
4
|
export declare const empty: null;
|
|
5
|
-
export type StringSet =
|
|
5
|
+
export type StringSet = Tree<string>;
|
|
6
6
|
export declare const contains: (value: string) => (set: StringSet) => boolean;
|
|
7
7
|
export declare const set: (value: string) => (s: StringSet) => StringSet;
|
|
8
8
|
export declare const fromValues: (input: List<string>) => StringSet;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import * as BtreeTypes from "../btree/types/module.f.js";
|
|
2
1
|
import * as btree from "../btree/module.f.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import * as bts from "../btree/set/module.f.js";
|
|
8
|
-
const { set: btreeSet } = bts;
|
|
9
|
-
import * as string from "../string/module.f.js";
|
|
10
|
-
const { cmp } = string;
|
|
2
|
+
import { find, isFound } from "../btree/find/module.f.js";
|
|
3
|
+
import { remove as btreeRemove } from "../btree/remove/module.f.js";
|
|
4
|
+
import { set as btreeSet } from "../btree/set/module.f.js";
|
|
5
|
+
import { cmp } from "../string/module.f.js";
|
|
11
6
|
import { fold } from "../list/module.f.js";
|
|
12
|
-
import
|
|
13
|
-
const { compose } = f;
|
|
7
|
+
import { compose } from "../function/module.f.js";
|
|
14
8
|
export const values = btree.values;
|
|
15
9
|
export const empty = btree.empty;
|
|
16
10
|
export const contains = value => {
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { contains, remove, set } from "./module.f.js";
|
|
2
2
|
export default {
|
|
3
3
|
contains: () => {
|
|
4
|
-
const r =
|
|
5
|
-
if (!
|
|
4
|
+
const r = set('hello')(null);
|
|
5
|
+
if (!contains('hello')(r)) {
|
|
6
6
|
throw r;
|
|
7
7
|
}
|
|
8
|
-
if (
|
|
8
|
+
if (contains('hello1')(r)) {
|
|
9
9
|
throw r;
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
remove: () => {
|
|
13
|
-
let r =
|
|
14
|
-
r =
|
|
15
|
-
r =
|
|
16
|
-
r =
|
|
17
|
-
if (!
|
|
13
|
+
let r = set('hello')(null);
|
|
14
|
+
r = set('world')(r);
|
|
15
|
+
r = set('HELLO')(r);
|
|
16
|
+
r = set('WORLD!')(r);
|
|
17
|
+
if (!contains('hello')(r)) {
|
|
18
18
|
throw r;
|
|
19
19
|
}
|
|
20
|
-
if (
|
|
20
|
+
if (contains('hello1')(r)) {
|
|
21
21
|
throw r;
|
|
22
22
|
}
|
|
23
|
-
if (!
|
|
23
|
+
if (!contains('HELLO')(r)) {
|
|
24
24
|
throw r;
|
|
25
25
|
}
|
|
26
|
-
if (
|
|
26
|
+
if (contains('WORLD')(r)) {
|
|
27
27
|
throw r;
|
|
28
28
|
}
|
|
29
|
-
if (!
|
|
29
|
+
if (!contains('world')(r)) {
|
|
30
30
|
throw r;
|
|
31
31
|
}
|
|
32
|
-
if (
|
|
32
|
+
if (contains('world!')(r)) {
|
|
33
33
|
throw r;
|
|
34
34
|
}
|
|
35
|
-
if (!
|
|
35
|
+
if (!contains('WORLD!')(r)) {
|
|
36
36
|
throw r;
|
|
37
37
|
}
|
|
38
38
|
//
|
|
39
|
-
r =
|
|
40
|
-
if (
|
|
39
|
+
r = remove('hello')(r);
|
|
40
|
+
if (contains('hello')(r)) {
|
|
41
41
|
throw r;
|
|
42
42
|
}
|
|
43
|
-
if (!
|
|
43
|
+
if (!contains('world')(r)) {
|
|
44
44
|
throw r;
|
|
45
45
|
}
|
|
46
|
-
r =
|
|
47
|
-
if (
|
|
46
|
+
r = remove('world')(r);
|
|
47
|
+
if (contains('world')(r)) {
|
|
48
48
|
throw r;
|
|
49
49
|
}
|
|
50
|
-
if (!
|
|
50
|
+
if (!contains('HELLO')(r)) {
|
|
51
51
|
throw r;
|
|
52
52
|
}
|
|
53
|
-
r =
|
|
54
|
-
if (
|
|
53
|
+
r = remove('HELLO')(r);
|
|
54
|
+
if (contains('HELLO')(r)) {
|
|
55
55
|
throw r;
|
|
56
56
|
}
|
|
57
|
-
if (!
|
|
57
|
+
if (!contains('WORLD!')(r)) {
|
|
58
58
|
throw r;
|
|
59
59
|
}
|
|
60
|
-
r =
|
|
60
|
+
r = remove('WORLD!')(r);
|
|
61
61
|
if (r !== null) {
|
|
62
62
|
throw r;
|
|
63
63
|
}
|