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.
Files changed (123) hide show
  1. package/com/cpp/module.f.js +0 -1
  2. package/com/cs/module.f.js +5 -6
  3. package/com/rust/module.f.d.ts +3 -3
  4. package/com/rust/module.f.js +24 -29
  5. package/com/test/build.f.js +2 -2
  6. package/com/types/module.f.d.ts +1 -1
  7. package/com/types/module.f.js +1 -2
  8. package/com/types/testlib.f.js +0 -1
  9. package/commonjs/build/module.f.d.ts +2 -2
  10. package/commonjs/build/module.f.js +3 -6
  11. package/commonjs/build/test.f.js +0 -4
  12. package/commonjs/module/function/module.f.d.ts +1 -1
  13. package/commonjs/module/function/module.f.js +1 -1
  14. package/commonjs/module/module.f.d.ts +1 -1
  15. package/commonjs/module/module.f.js +2 -3
  16. package/commonjs/path/module.f.d.ts +5 -5
  17. package/commonjs/path/module.f.js +6 -8
  18. package/commonjs/path/test.f.js +1 -2
  19. package/crypto/prime_field/module.f.d.ts +1 -1
  20. package/crypto/prime_field/module.f.js +1 -1
  21. package/crypto/secp/module.f.d.ts +1 -1
  22. package/crypto/secp/module.f.js +2 -2
  23. package/crypto/sha2/module.f.d.ts +75 -12
  24. package/crypto/sha2/module.f.js +246 -139
  25. package/crypto/sha2/test.f.d.ts +22 -3
  26. package/crypto/sha2/test.f.js +120 -67
  27. package/dev/test/module.f.d.ts +1 -1
  28. package/dev/test/module.f.js +4 -5
  29. package/dev/test.f.js +0 -4
  30. package/djs/module.f.d.ts +1 -1
  31. package/djs/module.f.js +0 -1
  32. package/djs/parser/module.f.d.ts +1 -1
  33. package/djs/parser/module.f.js +0 -2
  34. package/djs/serializer/module.f.d.ts +2 -2
  35. package/djs/serializer/module.f.js +0 -2
  36. package/djs/tokenizer/module.f.js +0 -1
  37. package/fsc/test.f.js +0 -1
  38. package/js/tokenizer/module.f.d.ts +1 -1
  39. package/js/tokenizer/module.f.js +1 -1
  40. package/json/parser/module.f.d.ts +2 -2
  41. package/json/parser/module.f.js +0 -3
  42. package/json/serializer/module.f.js +0 -2
  43. package/json/tokenizer/module.f.js +0 -1
  44. package/package.json +1 -1
  45. package/text/ascii/module.f.d.ts +1 -1
  46. package/text/ascii/module.f.js +2 -3
  47. package/text/ascii/test.f.js +2 -4
  48. package/text/module.f.d.ts +18 -3
  49. package/text/module.f.js +22 -6
  50. package/text/sgr/module.f.js +1 -1
  51. package/text/test.f.d.ts +4 -1
  52. package/text/test.f.js +24 -16
  53. package/text/utf16/module.f.d.ts +5 -6
  54. package/text/utf16/module.f.js +9 -10
  55. package/text/utf16/test.f.js +29 -30
  56. package/text/utf8/module.f.d.ts +8 -5
  57. package/text/utf8/module.f.js +3 -5
  58. package/text/utf8/test.f.js +34 -35
  59. package/types/bigfloat/module.f.js +1 -1
  60. package/types/bigint/module.f.d.ts +36 -7
  61. package/types/bigint/module.f.js +40 -11
  62. package/types/bigint/test.f.d.ts +8 -0
  63. package/types/bigint/test.f.js +81 -2
  64. package/types/bit_vec/module.f.d.ts +103 -83
  65. package/types/bit_vec/module.f.js +68 -110
  66. package/types/bit_vec/test.f.d.ts +20 -8
  67. package/types/bit_vec/test.f.js +110 -117
  68. package/types/btree/find/module.f.d.ts +11 -10
  69. package/types/btree/find/module.f.js +1 -5
  70. package/types/btree/find/test.f.js +4 -6
  71. package/types/btree/module.f.d.ts +3 -3
  72. package/types/btree/module.f.js +2 -5
  73. package/types/btree/remove/module.f.d.ts +2 -2
  74. package/types/btree/remove/module.f.js +0 -3
  75. package/types/btree/remove/test.f.js +4 -7
  76. package/types/btree/set/module.f.d.ts +2 -2
  77. package/types/btree/set/module.f.js +2 -6
  78. package/types/btree/set/test.f.js +3 -6
  79. package/types/btree/test.f.js +9 -13
  80. package/types/btree/types/module.f.d.ts +1 -3
  81. package/types/byte_set/module.f.d.ts +3 -3
  82. package/types/byte_set/module.f.js +1 -4
  83. package/types/byte_set/test.f.js +2 -4
  84. package/types/function/compare/module.f.d.ts +1 -5
  85. package/types/function/compare/module.f.js +0 -1
  86. package/types/function/compare/test.f.js +1 -2
  87. package/types/function/module.f.d.ts +1 -1
  88. package/types/function/module.f.js +1 -1
  89. package/types/function/operator/module.f.d.ts +2 -3
  90. package/types/function/operator/module.f.js +5 -5
  91. package/types/function/test.f.js +1 -2
  92. package/types/list/module.f.d.ts +1 -1
  93. package/types/list/module.f.js +9 -9
  94. package/types/list/test.f.js +2 -4
  95. package/types/map/module.f.d.ts +7 -9
  96. package/types/map/module.f.js +6 -15
  97. package/types/map/test.f.js +3 -4
  98. package/types/nibble_set/module.f.d.ts +2 -3
  99. package/types/nibble_set/test.f.js +26 -27
  100. package/types/nullable/test.f.js +2 -2
  101. package/types/number/module.f.d.ts +2 -2
  102. package/types/number/module.f.js +1 -2
  103. package/types/number/test.f.js +1 -2
  104. package/types/object/module.f.d.ts +5 -5
  105. package/types/object/module.f.js +2 -4
  106. package/types/object/test.f.js +3 -3
  107. package/types/range/test.f.js +6 -6
  108. package/types/range_map/module.f.d.ts +8 -8
  109. package/types/range_map/module.f.js +3 -9
  110. package/types/range_map/test.f.js +2 -4
  111. package/types/result/module.f.d.ts +2 -3
  112. package/types/sorted_list/module.f.d.ts +8 -8
  113. package/types/sorted_list/module.f.js +2 -6
  114. package/types/sorted_list/test.f.js +12 -17
  115. package/types/sorted_set/module.f.d.ts +2 -2
  116. package/types/sorted_set/module.f.js +2 -5
  117. package/types/sorted_set/test.f.js +14 -19
  118. package/types/string/module.f.d.ts +5 -5
  119. package/types/string/module.f.js +2 -4
  120. package/types/string/test.f.js +2 -4
  121. package/types/string_set/module.f.d.ts +2 -2
  122. package/types/string_set/module.f.js +5 -11
  123. package/types/string_set/test.f.js +25 -25
@@ -1,26 +1,21 @@
1
- import * as _ from "./module.f.js";
2
- import * as compare from "../function/compare/module.f.js";
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 * as object from "../object/module.f.js";
6
- const { sort } = object;
7
- import * as list from "../list/module.f.js";
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(_.union(unsafeCmp)([2, 3, 4])([1, 3, 5])));
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(_.union(unsafeCmp)([1, 2, 3])([])));
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 = _.union(reverseCmp)(sortedSet)(sortedSet);
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(_.intersect(unsafeCmp)([2, 3, 4])([1, 3, 5])));
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(_.intersect(unsafeCmp)([1, 2, 3])([])));
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 = _.has(unsafeCmp)(0)([0, 10, 20, 30, 40, 50, 60, 70, 80, 90]);
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 = _.has(unsafeCmp)(3)([0, 10, 20, 30, 40, 50, 60, 70, 80, 90]);
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 = _.has(unsafeCmp)(77)([0, 10, 20, 30, 40, 50, 60, 70, 80, 90]);
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 = _.has(unsafeCmp)(80)([0, 10, 20, 30, 40, 50, 60, 70, 80, 90]);
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 * as list from '../list/module.f.ts';
2
- import * as compare from '../function/compare/module.f.ts';
3
- export declare const join: (_: string) => (input: list.List<string>) => string;
4
- export declare const concat: (input: list.List<string>) => string;
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) => compare.Sign;
6
+ export declare const cmp: (a: string) => (b: string) => Sign;
@@ -1,8 +1,6 @@
1
- import * as list from "../list/module.f.js";
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 * as compare from "../function/compare/module.f.js";
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);
@@ -1,7 +1,5 @@
1
- import * as _ from "./module.f.js";
2
- const { join, concat, repeat, cmp } = _;
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 * as BtreeTypes from '../btree/types/module.f.ts';
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 = BtreeTypes.Tree<string>;
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 * as btf from "../btree/find/module.f.js";
4
- const { find, isFound } = btf;
5
- import * as btr from "../btree/remove/module.f.js";
6
- const { remove: btreeRemove } = btr;
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 * as f from "../function/module.f.js";
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 * as _ from "./module.f.js";
1
+ import { contains, remove, set } from "./module.f.js";
2
2
  export default {
3
3
  contains: () => {
4
- const r = _.set('hello')(null);
5
- if (!_.contains('hello')(r)) {
4
+ const r = set('hello')(null);
5
+ if (!contains('hello')(r)) {
6
6
  throw r;
7
7
  }
8
- if (_.contains('hello1')(r)) {
8
+ if (contains('hello1')(r)) {
9
9
  throw r;
10
10
  }
11
11
  },
12
12
  remove: () => {
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)) {
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 (_.contains('hello1')(r)) {
20
+ if (contains('hello1')(r)) {
21
21
  throw r;
22
22
  }
23
- if (!_.contains('HELLO')(r)) {
23
+ if (!contains('HELLO')(r)) {
24
24
  throw r;
25
25
  }
26
- if (_.contains('WORLD')(r)) {
26
+ if (contains('WORLD')(r)) {
27
27
  throw r;
28
28
  }
29
- if (!_.contains('world')(r)) {
29
+ if (!contains('world')(r)) {
30
30
  throw r;
31
31
  }
32
- if (_.contains('world!')(r)) {
32
+ if (contains('world!')(r)) {
33
33
  throw r;
34
34
  }
35
- if (!_.contains('WORLD!')(r)) {
35
+ if (!contains('WORLD!')(r)) {
36
36
  throw r;
37
37
  }
38
38
  //
39
- r = _.remove('hello')(r);
40
- if (_.contains('hello')(r)) {
39
+ r = remove('hello')(r);
40
+ if (contains('hello')(r)) {
41
41
  throw r;
42
42
  }
43
- if (!_.contains('world')(r)) {
43
+ if (!contains('world')(r)) {
44
44
  throw r;
45
45
  }
46
- r = _.remove('world')(r);
47
- if (_.contains('world')(r)) {
46
+ r = remove('world')(r);
47
+ if (contains('world')(r)) {
48
48
  throw r;
49
49
  }
50
- if (!_.contains('HELLO')(r)) {
50
+ if (!contains('HELLO')(r)) {
51
51
  throw r;
52
52
  }
53
- r = _.remove('HELLO')(r);
54
- if (_.contains('HELLO')(r)) {
53
+ r = remove('HELLO')(r);
54
+ if (contains('HELLO')(r)) {
55
55
  throw r;
56
56
  }
57
- if (!_.contains('WORLD!')(r)) {
57
+ if (!contains('WORLD!')(r)) {
58
58
  throw r;
59
59
  }
60
- r = _.remove('WORLD!')(r);
60
+ r = remove('WORLD!')(r);
61
61
  if (r !== null) {
62
62
  throw r;
63
63
  }