functionalscript 0.1.594 → 0.1.597

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 (167) hide show
  1. package/.github/workflows/npm-publish.yml +2 -1
  2. package/com/cpp/module.f.d.mts +8 -0
  3. package/com/cpp/module.f.mjs +18 -18
  4. package/com/cpp/test.f.d.mts +2 -0
  5. package/com/cpp/testlib.f.d.mts +2 -0
  6. package/com/cs/module.f.d.mts +8 -0
  7. package/com/cs/module.f.mjs +1 -1
  8. package/com/cs/test.f.d.mts +2 -0
  9. package/com/cs/testlib.f.d.mts +2 -0
  10. package/com/rust/module.f.d.mts +28 -0
  11. package/com/rust/module.f.mjs +30 -30
  12. package/com/rust/test.f.d.mts +2 -0
  13. package/com/rust/testlib.f.d.mts +2 -0
  14. package/com/test/build.d.mts +1 -0
  15. package/com/test/build.f.d.mts +26 -0
  16. package/com/test/build.mjs +2 -2
  17. package/com/types/module.f.d.mts +28 -0
  18. package/com/types/module.f.mjs +1 -1
  19. package/com/types/testlib.f.d.mts +44 -0
  20. package/commonjs/build/module.f.d.mts +24 -0
  21. package/commonjs/build/test.f.d.mts +3 -0
  22. package/commonjs/module/function/module.f.d.mts +7 -0
  23. package/commonjs/module/module.f.d.mts +57 -0
  24. package/commonjs/module/module.f.mjs +1 -1
  25. package/commonjs/module.d.mts +7 -0
  26. package/commonjs/module.f.d.mts +4 -0
  27. package/commonjs/package/dependencies/module.f.d.mts +10 -0
  28. package/commonjs/package/dependencies/module.f.mjs +3 -3
  29. package/commonjs/package/dependencies/test.f.d.mts +2 -0
  30. package/commonjs/package/module.f.d.mts +27 -0
  31. package/commonjs/package/module.f.mjs +4 -4
  32. package/commonjs/package/test.f.d.mts +2 -0
  33. package/commonjs/path/module.f.d.mts +67 -0
  34. package/commonjs/path/module.f.mjs +5 -5
  35. package/commonjs/path/test.f.d.mts +25 -0
  36. package/commonjs/path/test.f.mjs +7 -7
  37. package/commonjs/test.d.mts +8 -0
  38. package/commonjs/test.mjs +2 -2
  39. package/dev/index.d.mts +1 -0
  40. package/dev/module.d.mts +26 -0
  41. package/dev/module.f.d.mts +4 -0
  42. package/dev/test/module.f.d.mts +26 -0
  43. package/dev/test.d.mts +3 -0
  44. package/dev/test.f.d.mts +9 -0
  45. package/djs/module.f.d.mts +25 -0
  46. package/djs/module.f.mjs +1 -1
  47. package/djs/parser/module.f.d.mts +40 -0
  48. package/djs/parser/test.f.d.mts +8 -0
  49. package/djs/test.f.d.mts +12 -0
  50. package/djs/tokenizer/module.f.d.mts +17 -0
  51. package/djs/tokenizer/module.f.mjs +1 -1
  52. package/djs/tokenizer/test.f.d.mts +6 -0
  53. package/djs/tokenizer/test.f.mjs +1 -1
  54. package/fsc/module.f.d.mts +12 -0
  55. package/fsc/test.f.d.mts +4 -0
  56. package/fsm/module.f.d.mts +21 -0
  57. package/fsm/test.f.d.mts +5 -0
  58. package/html/module.f.d.mts +20 -0
  59. package/html/module.f.mjs +1 -1
  60. package/html/test.f.d.mts +10 -0
  61. package/index.f.d.mts +83 -0
  62. package/js/tokenizer/module.f.d.mts +150 -0
  63. package/js/tokenizer/test.f.d.mts +8 -0
  64. package/js/tokenizer/test.f.mjs +3 -3
  65. package/json/module.f.d.mts +41 -0
  66. package/json/parser/module.f.d.mts +36 -0
  67. package/json/parser/module.f.mjs +12 -12
  68. package/json/parser/test.f.d.mts +5 -0
  69. package/json/parser/test.f.mjs +2 -2
  70. package/json/serializer/module.f.d.mts +45 -0
  71. package/json/serializer/module.f.mjs +2 -2
  72. package/json/serializer/test.f.d.mts +8 -0
  73. package/json/test.f.d.mts +8 -0
  74. package/json/tokenizer/module.f.d.mts +17 -0
  75. package/json/tokenizer/module.f.mjs +7 -7
  76. package/json/tokenizer/test.f.d.mts +6 -0
  77. package/json/tokenizer/test.f.mjs +3 -3
  78. package/jsr.json +1 -1
  79. package/nodejs/version/main.d.mts +1 -0
  80. package/nodejs/version/module.f.d.mts +18 -0
  81. package/nodejs/version/test.f.d.mts +2 -0
  82. package/package.json +2 -1
  83. package/prime_field/module.f.d.mts +44 -0
  84. package/prime_field/test.f.d.mts +12 -0
  85. package/secp/module.f.d.mts +49 -0
  86. package/secp/module.f.mjs +6 -6
  87. package/secp/test.f.d.mts +4 -0
  88. package/secp/test.f.mjs +5 -5
  89. package/sha2/module.f.d.mts +23 -0
  90. package/sha2/module.f.mjs +1 -1
  91. package/sha2/test.f.d.mts +10 -0
  92. package/sha2/test.f.mjs +0 -1
  93. package/text/ascii/module.f.d.mts +73 -0
  94. package/text/ascii/test.f.d.mts +4 -0
  95. package/text/module.f.d.mts +18 -0
  96. package/text/sgr/module.f.d.mts +14 -0
  97. package/text/test.f.d.mts +2 -0
  98. package/text/utf16/module.f.d.mts +19 -0
  99. package/text/utf16/test.f.d.mts +6 -0
  100. package/text/utf16/test.f.mjs +2 -2
  101. package/text/utf8/module.f.d.mts +15 -0
  102. package/text/utf8/module.f.mjs +2 -2
  103. package/text/utf8/test.f.d.mts +6 -0
  104. package/types/array/module.f.d.mts +41 -0
  105. package/types/array/test.f.d.mts +10 -0
  106. package/types/bigfloat/module.f.d.mts +11 -0
  107. package/types/bigfloat/test.f.d.mts +6 -0
  108. package/types/bigint/module.f.d.mts +77 -0
  109. package/types/bigint/module.f.mjs +5 -5
  110. package/types/bigint/test.f.d.mts +16 -0
  111. package/types/btree/find/module.f.d.mts +42 -0
  112. package/types/btree/find/module.f.mjs +4 -4
  113. package/types/btree/find/test.f.d.mts +2 -0
  114. package/types/btree/find/test.f.mjs +2 -2
  115. package/types/btree/module.f.d.mts +9 -0
  116. package/types/btree/remove/module.f.d.mts +19 -0
  117. package/types/btree/remove/module.f.mjs +12 -12
  118. package/types/btree/remove/test.f.d.mts +7 -0
  119. package/types/btree/remove/test.f.mjs +5 -5
  120. package/types/btree/set/module.f.d.mts +9 -0
  121. package/types/btree/set/module.f.mjs +6 -6
  122. package/types/btree/set/test.f.d.mts +2 -0
  123. package/types/btree/set/test.f.mjs +32 -32
  124. package/types/btree/test.f.d.mts +13 -0
  125. package/types/btree/test.f.mjs +7 -11
  126. package/types/btree/types/module.f.d.mts +16 -0
  127. package/types/byte_set/module.f.d.mts +38 -0
  128. package/types/byte_set/module.f.mjs +2 -2
  129. package/types/byte_set/test.f.d.mts +13 -0
  130. package/types/byte_set/test.f.mjs +3 -3
  131. package/types/function/compare/module.f.d.mts +29 -0
  132. package/types/function/compare/module.f.mjs +4 -4
  133. package/types/function/compare/test.f.d.mts +2 -0
  134. package/types/function/module.f.d.mts +36 -0
  135. package/types/function/operator/module.f.d.mts +75 -0
  136. package/types/function/test.f.d.mts +2 -0
  137. package/types/list/module.f.d.mts +117 -0
  138. package/types/list/test.f.d.mts +38 -0
  139. package/types/map/module.f.d.mts +30 -0
  140. package/types/map/module.f.mjs +4 -4
  141. package/types/map/test.f.d.mts +5 -0
  142. package/types/nibble_set/module.f.d.mts +26 -0
  143. package/types/nibble_set/test.f.d.mts +13 -0
  144. package/types/nullable/module.f.d.mts +14 -0
  145. package/types/nullable/test.f.d.mts +2 -0
  146. package/types/number/module.f.d.mts +13 -0
  147. package/types/number/test.f.d.mts +11 -0
  148. package/types/object/module.f.d.mts +29 -0
  149. package/types/object/test.f.d.mts +5 -0
  150. package/types/range/module.f.d.mts +11 -0
  151. package/types/range/test.f.d.mts +2 -0
  152. package/types/range_map/module.f.d.mts +25 -0
  153. package/types/range_map/module.f.mjs +5 -5
  154. package/types/range_map/test.f.d.mts +6 -0
  155. package/types/range_map/test.f.mjs +2 -2
  156. package/types/result/module.d.mts +7 -0
  157. package/types/result/module.f.d.mts +28 -0
  158. package/types/sorted_list/module.f.d.mts +59 -0
  159. package/types/sorted_list/test.f.d.mts +5 -0
  160. package/types/sorted_list/test.f.mjs +2 -2
  161. package/types/sorted_set/module.f.d.mts +25 -0
  162. package/types/sorted_set/test.f.d.mts +6 -0
  163. package/types/sorted_set/test.f.mjs +1 -1
  164. package/types/string/module.f.d.mts +15 -0
  165. package/types/string/test.f.d.mts +15 -0
  166. package/types/string_set/module.f.d.mts +21 -0
  167. package/types/string_set/test.f.d.mts +5 -0
@@ -1,4 +1,4 @@
1
- import sortedList, * as SL from '../sorted_list/module.f.mjs'
1
+ import sortedList, * as SortedList from '../sorted_list/module.f.mjs'
2
2
  const { genericMerge } = sortedList
3
3
  import list from '../list/module.f.mjs'
4
4
  const { next } = list
@@ -6,7 +6,7 @@ import * as Option from '../nullable/module.f.mjs'
6
6
  import number from '../number/module.f.mjs'
7
7
  const { cmp } = number
8
8
  import * as O from '../function/operator/module.f.mjs'
9
- import _range, * as Range from '../range/module.f.mjs'
9
+ import * as Range from '../range/module.f.mjs'
10
10
 
11
11
  /**
12
12
  * @template T
@@ -15,7 +15,7 @@ import _range, * as Range from '../range/module.f.mjs'
15
15
 
16
16
  /**
17
17
  * @template T
18
- * @typedef {SL.SortedList<Entry<T>>} RangeMap
18
+ * @typedef {SortedList.SortedList<Entry<T>>} RangeMap
19
19
  */
20
20
 
21
21
  /**
@@ -41,7 +41,7 @@ import _range, * as Range from '../range/module.f.mjs'
41
41
  * @typedef {O.Reduce<RangeMap<T>>} RangeMerge
42
42
  */
43
43
 
44
- /** @type {<T>(union: O.Reduce<T>) => (equal: O.Equal<T>) => SL.ReduceOp<Entry<T>, RangeState<T>>} */
44
+ /** @type {<T>(union: O.Reduce<T>) => (equal: O.Equal<T>) => SortedList.ReduceOp<Entry<T>, RangeState<T>>} */
45
45
  const reduceOp = union => equal => state => ([aItem, aMax]) => ([bItem, bMax]) => {
46
46
  const sign = cmp(aMax)(bMax)
47
47
  const min = sign === 1 ? bMax : aMax
@@ -50,7 +50,7 @@ const reduceOp = union => equal => state => ([aItem, aMax]) => ([bItem, bMax]) =
50
50
  return [newState, sign, [u, min]]
51
51
  }
52
52
 
53
- /** @type {<T>(equal: O.Equal<T>) => SL.TailReduce<Entry<T>, RangeState<T>>} */
53
+ /** @type {<T>(equal: O.Equal<T>) => SortedList.TailReduce<Entry<T>, RangeState<T>>} */
54
54
  const tailReduce = equal => state => tail => {
55
55
  if (state === null) { return tail }
56
56
  const tailResult = next(tail)
@@ -0,0 +1,6 @@
1
+ declare namespace _default {
2
+ let merge: (() => void)[];
3
+ function get(): (() => void)[];
4
+ function fromRange(): (() => void)[];
5
+ }
6
+ export default _default;
@@ -1,14 +1,14 @@
1
1
  import _, * as T from './module.f.mjs'
2
2
  import compare from '../function/compare/module.f.mjs'
3
3
  const { unsafeCmp } = compare
4
- import json, * as jsonT from '../../json/module.f.mjs'
4
+ import json, * as Json from '../../json/module.f.mjs'
5
5
  import object from '../object/module.f.mjs'
6
6
  const { sort } = object
7
7
  import sortedSet, * as SortedSet from '../sorted_set/module.f.mjs'
8
8
  import list from '../list/module.f.mjs'
9
9
  import operator from '../function/operator/module.f.mjs'
10
10
 
11
- /** @type {(a: readonly jsonT.Unknown[]) => string} */
11
+ /** @type {(a: readonly Json.Unknown[]) => string} */
12
12
  const stringify = json.stringify(sort)
13
13
 
14
14
  /** @type {T.Operators<SortedSet.SortedSet<string>>} */
@@ -0,0 +1,7 @@
1
+ declare namespace _default {
2
+ export { tryCatch };
3
+ }
4
+ export default _default;
5
+ /** @type {<T>(f: () => T) => Result.Result<T, unknown>} */
6
+ declare const tryCatch: <T>(f: () => T) => Result.Result<T, unknown>;
7
+ import * as Result from './module.f.mjs';
@@ -0,0 +1,28 @@
1
+ declare namespace _default {
2
+ export { ok };
3
+ export { error };
4
+ export { unwrap };
5
+ }
6
+ export default _default;
7
+ export type Ok<T> = readonly ["ok", T];
8
+ export type Error<E> = readonly ["error", E];
9
+ export type Result<T, E> = Ok<T> | Error<E>;
10
+ /**
11
+ * @template T
12
+ * @typedef {readonly['ok', T]} Ok
13
+ */
14
+ /**
15
+ * @template E
16
+ * @typedef {readonly['error', E]} Error
17
+ */
18
+ /**
19
+ * @template T
20
+ * @template E
21
+ * @typedef {Ok<T>|Error<E>} Result
22
+ */
23
+ /** @type {<T>(value: T) => Ok<T>} */
24
+ declare const ok: <T>(value: T) => Ok<T>;
25
+ /** @type {<E>(e: E) => Error<E>} */
26
+ declare const error: <E>(e: E) => Error<E>;
27
+ /** @type {<T, E>(r: Result<T, E>) => T} */
28
+ declare const unwrap: <T, E>(r: Result<T, E>) => T;
@@ -0,0 +1,59 @@
1
+ declare namespace _default {
2
+ export { merge };
3
+ export { genericMerge };
4
+ export { find };
5
+ }
6
+ export default _default;
7
+ export type SortedList<T> = List.List<T>;
8
+ export type SortedArray<T> = readonly T[];
9
+ export type Cmp<T> = (a: T) => (b: T) => compare.Sign;
10
+ export type ReduceOp<T, S> = (state: S) => (a: T) => (b: T) => readonly [option.Nullable<T>, compare.Sign, S];
11
+ export type TailReduce<T, S> = (state: S) => (tail: List.List<T>) => List.List<T>;
12
+ export type MergeReduce<T, S> = {
13
+ readonly reduceOp: ReduceOp<T, S>;
14
+ readonly tailReduce: TailReduce<T, S>;
15
+ };
16
+ export type CmpReduceOp<T> = ReduceOp<T, null>;
17
+ /**
18
+ * @template T
19
+ * @typedef {ReduceOp<T, null>} CmpReduceOp
20
+ */
21
+ /** @type {<T>(cmp: Cmp<T>) => (a: SortedList<T>) => (b: SortedList<T>) => SortedList<T>} */
22
+ declare const merge: <T>(cmp: Cmp<T>) => (a: SortedList<T>) => (b: SortedList<T>) => SortedList<T>;
23
+ /**
24
+ * @template T
25
+ * @typedef {List.List<T>} SortedList
26
+ */
27
+ /**
28
+ * @template T
29
+ * @typedef {readonly T[]} SortedArray
30
+ */
31
+ /**
32
+ * @template T
33
+ * @typedef {(a: T) => (b: T) => compare.Sign} Cmp
34
+ */
35
+ /**
36
+ * @template T
37
+ * @template S
38
+ * @typedef {(state: S) => (a: T) => (b: T) => readonly[option.Nullable<T>, compare.Sign, S]} ReduceOp
39
+ */
40
+ /**
41
+ * @template T
42
+ * @template S
43
+ * @typedef {(state: S) => (tail: List.List<T>) => List.List<T>} TailReduce
44
+ */
45
+ /**
46
+ * @template T
47
+ * @template S
48
+ * @typedef {{
49
+ * readonly reduceOp: ReduceOp<T,S>
50
+ * readonly tailReduce: TailReduce<T,S>
51
+ * }} MergeReduce
52
+ */
53
+ /** @type {<T,S>(reduce: MergeReduce<T,S>) => (state: S) => (a: List.List<T>) => (b: List.List<T>) => List.List<T>} */
54
+ declare const genericMerge: <T, S>(reduce: MergeReduce<T, S>) => (state: S) => (a: List.List<T>) => (b: List.List<T>) => List.List<T>;
55
+ /** @type {<T>(cmp: Cmp<T>) => (value: T) => (array: SortedArray<T>) => T|null} */
56
+ declare const find: <T>(cmp: Cmp<T>) => (value: T) => (array: SortedArray<T>) => T | null;
57
+ import * as List from '../list/module.f.mjs';
58
+ import * as compare from '../function/compare/module.f.mjs';
59
+ import * as option from '../nullable/module.f.mjs';
@@ -0,0 +1,5 @@
1
+ declare namespace _default {
2
+ let sortedMergre: (() => void)[];
3
+ let find: (() => void)[];
4
+ }
5
+ export default _default;
@@ -6,12 +6,12 @@ import object from '../object/module.f.mjs'
6
6
  const { sort } = object
7
7
  import list from '../list/module.f.mjs'
8
8
  const { toArray, countdown, length } = list
9
- import map, * as Map from '../map/module.f.mjs'
9
+ import * as Map from '../map/module.f.mjs'
10
10
  import f from '../function/module.f.mjs'
11
11
  const { flip } = f
12
12
 
13
13
  /** @type {(a: readonly Json.Unknown[]) => string} */
14
- const stringify = a => json.stringify(sort)(a)
14
+ const stringify = json.stringify(sort)
15
15
 
16
16
  /** @type {<T>(a: T) => (b: T) => Map.Sign} */
17
17
  const reverseCmp = flip(unsafeCmp)
@@ -0,0 +1,25 @@
1
+ declare namespace _default {
2
+ export { union };
3
+ export { intersect };
4
+ export { has };
5
+ }
6
+ export default _default;
7
+ export type SortedSet<T> = readonly T[];
8
+ export type Cmp<T> = (a: T) => (b: T) => Compare.Sign;
9
+ export type Byte = number;
10
+ /**
11
+ * @template T
12
+ * @typedef {readonly T[]} SortedSet
13
+ */
14
+ /**
15
+ * @template T
16
+ * @typedef {(a: T) => (b: T) => Compare.Sign} Cmp
17
+ */
18
+ /** @typedef {number} Byte */
19
+ /** @type {<T>(cmp: Cmp<T>) => (a: SortedSet<T>) => (b: SortedSet<T>) => SortedSet<T>} */
20
+ declare const union: <T>(cmp: Cmp<T>) => (a: SortedSet<T>) => (b: SortedSet<T>) => SortedSet<T>;
21
+ /** @type {<T>(cmp: Cmp<T>) => (a: SortedSet<T>) => (b: SortedSet<T>) => SortedSet<T>} */
22
+ declare const intersect: <T>(cmp: Cmp<T>) => (a: SortedSet<T>) => (b: SortedSet<T>) => SortedSet<T>;
23
+ /** @type {<T>(cmp: Cmp<T>) => (value: T) => (set: SortedSet<T>) => boolean} */
24
+ declare const has: <T>(cmp: Cmp<T>) => (value: T) => (set: SortedSet<T>) => boolean;
25
+ import * as Compare from '../function/compare/module.f.mjs';
@@ -0,0 +1,6 @@
1
+ declare namespace _default {
2
+ let union: (() => void)[];
3
+ let intersect: (() => void)[];
4
+ let has: (() => void)[];
5
+ }
6
+ export default _default;
@@ -6,7 +6,7 @@ import object from '../object/module.f.mjs'
6
6
  const { sort } = object
7
7
  import list from '../list/module.f.mjs'
8
8
  const { toArray, countdown, length } = list
9
- import map, * as Map from '../map/module.f.mjs'
9
+ import * as Map from '../map/module.f.mjs'
10
10
  import f from '../function/module.f.mjs'
11
11
  const { flip } = f
12
12
 
@@ -0,0 +1,15 @@
1
+ declare namespace _default {
2
+ export { join };
3
+ export { concat };
4
+ export { repeat };
5
+ export { cmp };
6
+ }
7
+ export default _default;
8
+ declare const join: import("../function/module.f.mjs").Func<string, (input: List.List<string>) => string>;
9
+ declare const concat: (input: List.List<string>) => string;
10
+ /** @type {(n: string) => (v: number) => string} */
11
+ declare const repeat: (n: string) => (v: number) => string;
12
+ /** @type {(a: string) => (b: string) => Compare.Sign} */
13
+ declare const cmp: (a: string) => (b: string) => Compare.Sign;
14
+ import * as List from '../list/module.f.mjs';
15
+ import * as Compare from '../function/compare/module.f.mjs';
@@ -0,0 +1,15 @@
1
+ declare namespace _default {
2
+ let join: {
3
+ 0: () => void;
4
+ 1: () => void;
5
+ 3: () => void;
6
+ };
7
+ function concat(): void;
8
+ let repeatList: {
9
+ 0: () => void;
10
+ 5: () => void;
11
+ };
12
+ function repeat(): void;
13
+ function cmp(): void;
14
+ }
15
+ export default _default;
@@ -0,0 +1,21 @@
1
+ declare namespace _default {
2
+ export { empty };
3
+ export { contains };
4
+ export { set };
5
+ export { values };
6
+ export { fromValues };
7
+ export { remove };
8
+ }
9
+ export default _default;
10
+ export type StringSet = BtreeTypes.Tree<string>;
11
+ declare const empty: null;
12
+ /** @typedef {BtreeTypes.Tree<string>} StringSet */
13
+ /** @type {(value: string) => (set: StringSet) => boolean} */
14
+ declare const contains: (value: string) => (set: StringSet) => boolean;
15
+ /** @type {(value: string) => (s: StringSet) => StringSet} */
16
+ declare const set: (value: string) => (s: StringSet) => StringSet;
17
+ declare const values: <T>(tree: BtreeTypes.Tree<T>) => import("../list/module.f.mjs").List<T>;
18
+ declare const fromValues: (input: import("../list/module.f.mjs").List<string>) => StringSet;
19
+ /** @type {(value: string) => (s: StringSet) => StringSet} */
20
+ declare const remove: (value: string) => (s: StringSet) => StringSet;
21
+ import * as BtreeTypes from '../btree/types/module.f.mjs';
@@ -0,0 +1,5 @@
1
+ declare namespace _default {
2
+ function contains(): void;
3
+ function remove(): void;
4
+ }
5
+ export default _default;