@nlozgachev/pipelined 0.12.0 → 0.14.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.
Files changed (213) hide show
  1. package/LICENCE +28 -0
  2. package/README.md +1 -1
  3. package/{types/src/Types/NonEmptyList.d.ts → dist/NonEmptyList-BlGFjor5.d.mts} +4 -3
  4. package/dist/NonEmptyList-BlGFjor5.d.ts +30 -0
  5. package/dist/Task-Bd3gXPRQ.d.mts +677 -0
  6. package/dist/Task-BjAkkD6t.d.ts +677 -0
  7. package/dist/chunk-4TXC322E.mjs +136 -0
  8. package/dist/chunk-BYWKZLHM.mjs +10 -0
  9. package/dist/chunk-DBIC62UV.mjs +6 -0
  10. package/dist/chunk-FAZN3IWZ.mjs +554 -0
  11. package/dist/chunk-QPTGO5AS.mjs +150 -0
  12. package/dist/chunk-UV2HMF2A.mjs +514 -0
  13. package/dist/composition.d.mts +495 -0
  14. package/dist/composition.d.ts +495 -0
  15. package/dist/composition.js +188 -0
  16. package/dist/composition.mjs +58 -0
  17. package/dist/core.d.mts +2170 -0
  18. package/dist/core.d.ts +2170 -0
  19. package/dist/core.js +698 -0
  20. package/dist/core.mjs +42 -0
  21. package/dist/index.d.mts +6 -0
  22. package/dist/index.d.ts +6 -0
  23. package/dist/index.js +1421 -0
  24. package/dist/index.mjs +120 -0
  25. package/dist/types.d.mts +54 -0
  26. package/{types/src/Types/Brand.d.ts → dist/types.d.ts} +6 -4
  27. package/dist/types.js +41 -0
  28. package/dist/types.mjs +10 -0
  29. package/dist/utils.d.mts +1285 -0
  30. package/dist/utils.d.ts +1285 -0
  31. package/dist/utils.js +722 -0
  32. package/dist/utils.mjs +18 -0
  33. package/package.json +64 -69
  34. package/esm/mod.js +0 -3
  35. package/esm/package.json +0 -3
  36. package/esm/src/Composition/compose.js +0 -3
  37. package/esm/src/Composition/converge.js +0 -3
  38. package/esm/src/Composition/curry.js +0 -42
  39. package/esm/src/Composition/flip.js +0 -20
  40. package/esm/src/Composition/flow.js +0 -8
  41. package/esm/src/Composition/fn.js +0 -85
  42. package/esm/src/Composition/index.js +0 -13
  43. package/esm/src/Composition/juxt.js +0 -3
  44. package/esm/src/Composition/memoize.js +0 -66
  45. package/esm/src/Composition/not.js +0 -25
  46. package/esm/src/Composition/on.js +0 -12
  47. package/esm/src/Composition/pipe.js +0 -3
  48. package/esm/src/Composition/tap.js +0 -33
  49. package/esm/src/Composition/uncurry.js +0 -32
  50. package/esm/src/Core/Deferred.js +0 -30
  51. package/esm/src/Core/InternalTypes.js +0 -1
  52. package/esm/src/Core/Lens.js +0 -98
  53. package/esm/src/Core/Logged.js +0 -111
  54. package/esm/src/Core/Option.js +0 -191
  55. package/esm/src/Core/Optional.js +0 -160
  56. package/esm/src/Core/Predicate.js +0 -133
  57. package/esm/src/Core/Reader.js +0 -134
  58. package/esm/src/Core/Refinement.js +0 -115
  59. package/esm/src/Core/RemoteData.js +0 -211
  60. package/esm/src/Core/Result.js +0 -170
  61. package/esm/src/Core/State.js +0 -181
  62. package/esm/src/Core/Task.js +0 -223
  63. package/esm/src/Core/TaskOption.js +0 -106
  64. package/esm/src/Core/TaskResult.js +0 -127
  65. package/esm/src/Core/TaskValidation.js +0 -128
  66. package/esm/src/Core/These.js +0 -245
  67. package/esm/src/Core/Tuple.js +0 -112
  68. package/esm/src/Core/Validation.js +0 -212
  69. package/esm/src/Core/index.js +0 -18
  70. package/esm/src/Types/Brand.js +0 -28
  71. package/esm/src/Types/NonEmptyList.js +0 -14
  72. package/esm/src/Types/index.js +0 -2
  73. package/esm/src/Utils/Arr.js +0 -570
  74. package/esm/src/Utils/Dict.js +0 -421
  75. package/esm/src/Utils/Num.js +0 -124
  76. package/esm/src/Utils/Rec.js +0 -241
  77. package/esm/src/Utils/Str.js +0 -134
  78. package/esm/src/Utils/Uniq.js +0 -265
  79. package/esm/src/Utils/index.js +0 -6
  80. package/script/mod.js +0 -19
  81. package/script/package.json +0 -3
  82. package/script/src/Composition/compose.js +0 -6
  83. package/script/src/Composition/converge.js +0 -6
  84. package/script/src/Composition/curry.js +0 -48
  85. package/script/src/Composition/flip.js +0 -24
  86. package/script/src/Composition/flow.js +0 -11
  87. package/script/src/Composition/fn.js +0 -98
  88. package/script/src/Composition/index.js +0 -29
  89. package/script/src/Composition/juxt.js +0 -6
  90. package/script/src/Composition/memoize.js +0 -71
  91. package/script/src/Composition/not.js +0 -29
  92. package/script/src/Composition/on.js +0 -16
  93. package/script/src/Composition/pipe.js +0 -6
  94. package/script/src/Composition/tap.js +0 -37
  95. package/script/src/Composition/uncurry.js +0 -38
  96. package/script/src/Core/Deferred.js +0 -33
  97. package/script/src/Core/InternalTypes.js +0 -2
  98. package/script/src/Core/Lens.js +0 -101
  99. package/script/src/Core/Logged.js +0 -114
  100. package/script/src/Core/Option.js +0 -194
  101. package/script/src/Core/Optional.js +0 -163
  102. package/script/src/Core/Predicate.js +0 -136
  103. package/script/src/Core/Reader.js +0 -137
  104. package/script/src/Core/Refinement.js +0 -118
  105. package/script/src/Core/RemoteData.js +0 -214
  106. package/script/src/Core/Result.js +0 -173
  107. package/script/src/Core/State.js +0 -184
  108. package/script/src/Core/Task.js +0 -226
  109. package/script/src/Core/TaskOption.js +0 -109
  110. package/script/src/Core/TaskResult.js +0 -130
  111. package/script/src/Core/TaskValidation.js +0 -131
  112. package/script/src/Core/These.js +0 -248
  113. package/script/src/Core/Tuple.js +0 -115
  114. package/script/src/Core/Validation.js +0 -215
  115. package/script/src/Core/index.js +0 -34
  116. package/script/src/Types/Brand.js +0 -31
  117. package/script/src/Types/NonEmptyList.js +0 -18
  118. package/script/src/Types/index.js +0 -18
  119. package/script/src/Utils/Arr.js +0 -573
  120. package/script/src/Utils/Dict.js +0 -424
  121. package/script/src/Utils/Num.js +0 -127
  122. package/script/src/Utils/Rec.js +0 -244
  123. package/script/src/Utils/Str.js +0 -137
  124. package/script/src/Utils/Uniq.js +0 -268
  125. package/script/src/Utils/index.js +0 -22
  126. package/types/mod.d.ts +0 -4
  127. package/types/mod.d.ts.map +0 -1
  128. package/types/src/Composition/compose.d.ts +0 -33
  129. package/types/src/Composition/compose.d.ts.map +0 -1
  130. package/types/src/Composition/converge.d.ts +0 -21
  131. package/types/src/Composition/converge.d.ts.map +0 -1
  132. package/types/src/Composition/curry.d.ts +0 -43
  133. package/types/src/Composition/curry.d.ts.map +0 -1
  134. package/types/src/Composition/flip.d.ts +0 -21
  135. package/types/src/Composition/flip.d.ts.map +0 -1
  136. package/types/src/Composition/flow.d.ts +0 -56
  137. package/types/src/Composition/flow.d.ts.map +0 -1
  138. package/types/src/Composition/fn.d.ts +0 -76
  139. package/types/src/Composition/fn.d.ts.map +0 -1
  140. package/types/src/Composition/index.d.ts +0 -14
  141. package/types/src/Composition/index.d.ts.map +0 -1
  142. package/types/src/Composition/juxt.d.ts +0 -18
  143. package/types/src/Composition/juxt.d.ts.map +0 -1
  144. package/types/src/Composition/memoize.d.ts +0 -46
  145. package/types/src/Composition/memoize.d.ts.map +0 -1
  146. package/types/src/Composition/not.d.ts +0 -26
  147. package/types/src/Composition/not.d.ts.map +0 -1
  148. package/types/src/Composition/on.d.ts +0 -13
  149. package/types/src/Composition/on.d.ts.map +0 -1
  150. package/types/src/Composition/pipe.d.ts +0 -56
  151. package/types/src/Composition/pipe.d.ts.map +0 -1
  152. package/types/src/Composition/tap.d.ts +0 -31
  153. package/types/src/Composition/tap.d.ts.map +0 -1
  154. package/types/src/Composition/uncurry.d.ts +0 -54
  155. package/types/src/Composition/uncurry.d.ts.map +0 -1
  156. package/types/src/Core/Deferred.d.ts +0 -49
  157. package/types/src/Core/Deferred.d.ts.map +0 -1
  158. package/types/src/Core/InternalTypes.d.ts +0 -23
  159. package/types/src/Core/InternalTypes.d.ts.map +0 -1
  160. package/types/src/Core/Lens.d.ts +0 -118
  161. package/types/src/Core/Lens.d.ts.map +0 -1
  162. package/types/src/Core/Logged.d.ts +0 -126
  163. package/types/src/Core/Logged.d.ts.map +0 -1
  164. package/types/src/Core/Option.d.ts +0 -209
  165. package/types/src/Core/Option.d.ts.map +0 -1
  166. package/types/src/Core/Optional.d.ts +0 -158
  167. package/types/src/Core/Optional.d.ts.map +0 -1
  168. package/types/src/Core/Predicate.d.ts +0 -161
  169. package/types/src/Core/Predicate.d.ts.map +0 -1
  170. package/types/src/Core/Reader.d.ts +0 -156
  171. package/types/src/Core/Reader.d.ts.map +0 -1
  172. package/types/src/Core/Refinement.d.ts +0 -138
  173. package/types/src/Core/Refinement.d.ts.map +0 -1
  174. package/types/src/Core/RemoteData.d.ts +0 -197
  175. package/types/src/Core/RemoteData.d.ts.map +0 -1
  176. package/types/src/Core/Result.d.ts +0 -182
  177. package/types/src/Core/Result.d.ts.map +0 -1
  178. package/types/src/Core/State.d.ts +0 -192
  179. package/types/src/Core/State.d.ts.map +0 -1
  180. package/types/src/Core/Task.d.ts +0 -219
  181. package/types/src/Core/Task.d.ts.map +0 -1
  182. package/types/src/Core/TaskOption.d.ts +0 -121
  183. package/types/src/Core/TaskOption.d.ts.map +0 -1
  184. package/types/src/Core/TaskResult.d.ts +0 -119
  185. package/types/src/Core/TaskResult.d.ts.map +0 -1
  186. package/types/src/Core/TaskValidation.d.ts +0 -144
  187. package/types/src/Core/TaskValidation.d.ts.map +0 -1
  188. package/types/src/Core/These.d.ts +0 -225
  189. package/types/src/Core/These.d.ts.map +0 -1
  190. package/types/src/Core/Tuple.d.ts +0 -129
  191. package/types/src/Core/Tuple.d.ts.map +0 -1
  192. package/types/src/Core/Validation.d.ts +0 -203
  193. package/types/src/Core/Validation.d.ts.map +0 -1
  194. package/types/src/Core/index.d.ts +0 -19
  195. package/types/src/Core/index.d.ts.map +0 -1
  196. package/types/src/Types/Brand.d.ts.map +0 -1
  197. package/types/src/Types/NonEmptyList.d.ts.map +0 -1
  198. package/types/src/Types/index.d.ts +0 -3
  199. package/types/src/Types/index.d.ts.map +0 -1
  200. package/types/src/Utils/Arr.d.ts +0 -403
  201. package/types/src/Utils/Arr.d.ts.map +0 -1
  202. package/types/src/Utils/Dict.d.ts +0 -310
  203. package/types/src/Utils/Dict.d.ts.map +0 -1
  204. package/types/src/Utils/Num.d.ts +0 -110
  205. package/types/src/Utils/Num.d.ts.map +0 -1
  206. package/types/src/Utils/Rec.d.ts +0 -159
  207. package/types/src/Utils/Rec.d.ts.map +0 -1
  208. package/types/src/Utils/Str.d.ts +0 -128
  209. package/types/src/Utils/Str.d.ts.map +0 -1
  210. package/types/src/Utils/Uniq.d.ts +0 -179
  211. package/types/src/Utils/Uniq.d.ts.map +0 -1
  212. package/types/src/Utils/index.d.ts +0 -7
  213. package/types/src/Utils/index.d.ts.map +0 -1
@@ -1,128 +0,0 @@
1
- import { Option } from "../Core/Option.js";
2
- /**
3
- * String utilities. All transformation functions are data-last and curried so they
4
- * compose naturally with `pipe`. Safe parsers return `Option` instead of `NaN`.
5
- *
6
- * @example
7
- * ```ts
8
- * import { Str } from "@nlozgachev/pipelined/utils";
9
- * import { pipe } from "@nlozgachev/pipelined/composition";
10
- *
11
- * pipe(" Hello, World! ", Str.trim, Str.toLowerCase); // "hello, world!"
12
- * ```
13
- */
14
- export declare namespace Str {
15
- /**
16
- * Splits a string by a separator. Data-last: use in `pipe`.
17
- *
18
- * @example
19
- * ```ts
20
- * pipe("a,b,c", Str.split(",")); // ["a", "b", "c"]
21
- * ```
22
- */
23
- const split: (separator: string | RegExp) => (s: string) => readonly string[];
24
- /**
25
- * Removes leading and trailing whitespace from a string.
26
- *
27
- * @example
28
- * ```ts
29
- * pipe(" hello ", Str.trim); // "hello"
30
- * ```
31
- */
32
- const trim: (s: string) => string;
33
- /**
34
- * Returns `true` when the string contains the given substring.
35
- *
36
- * @example
37
- * ```ts
38
- * pipe("hello world", Str.includes("world")); // true
39
- * pipe("hello world", Str.includes("xyz")); // false
40
- * ```
41
- */
42
- const includes: (substring: string) => (s: string) => boolean;
43
- /**
44
- * Returns `true` when the string starts with the given prefix.
45
- *
46
- * @example
47
- * ```ts
48
- * pipe("hello world", Str.startsWith("hello")); // true
49
- * pipe("hello world", Str.startsWith("world")); // false
50
- * ```
51
- */
52
- const startsWith: (prefix: string) => (s: string) => boolean;
53
- /**
54
- * Returns `true` when the string ends with the given suffix.
55
- *
56
- * @example
57
- * ```ts
58
- * pipe("hello world", Str.endsWith("world")); // true
59
- * pipe("hello world", Str.endsWith("hello")); // false
60
- * ```
61
- */
62
- const endsWith: (suffix: string) => (s: string) => boolean;
63
- /**
64
- * Converts a string to uppercase.
65
- *
66
- * @example
67
- * ```ts
68
- * pipe("hello", Str.toUpperCase); // "HELLO"
69
- * ```
70
- */
71
- const toUpperCase: (s: string) => string;
72
- /**
73
- * Converts a string to lowercase.
74
- *
75
- * @example
76
- * ```ts
77
- * pipe("HELLO", Str.toLowerCase); // "hello"
78
- * ```
79
- */
80
- const toLowerCase: (s: string) => string;
81
- /**
82
- * Splits a string into lines, normalising `\r\n` and `\r` line endings.
83
- *
84
- * @example
85
- * ```ts
86
- * Str.lines("one\ntwo\nthree"); // ["one", "two", "three"]
87
- * Str.lines("a\r\nb"); // ["a", "b"]
88
- * ```
89
- */
90
- const lines: (s: string) => readonly string[];
91
- /**
92
- * Splits a string into words on any whitespace boundary, filtering out empty strings.
93
- *
94
- * @example
95
- * ```ts
96
- * Str.words(" hello world "); // ["hello", "world"]
97
- * ```
98
- */
99
- const words: (s: string) => readonly string[];
100
- /**
101
- * Safe number parsers that return `Option` instead of `NaN`.
102
- */
103
- const parse: {
104
- /**
105
- * Parses a string as an integer (base 10). Returns `None` if the result is `NaN`.
106
- *
107
- * @example
108
- * ```ts
109
- * Str.parse.int("42"); // Some(42)
110
- * Str.parse.int("3.7"); // Some(3)
111
- * Str.parse.int("abc"); // None
112
- * ```
113
- */
114
- int: (s: string) => Option<number>;
115
- /**
116
- * Parses a string as a floating-point number. Returns `None` if the result is `NaN`.
117
- *
118
- * @example
119
- * ```ts
120
- * Str.parse.float("3.14"); // Some(3.14)
121
- * Str.parse.float("42"); // Some(42)
122
- * Str.parse.float("abc"); // None
123
- * ```
124
- */
125
- float: (s: string) => Option<number>;
126
- };
127
- }
128
- //# sourceMappingURL=Str.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Str.d.ts","sourceRoot":"","sources":["../../../src/src/Utils/Str.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;;;;;;;;;;GAWG;AACH,yBAAiB,GAAG,CAAC;IACpB;;;;;;;OAOG;IACI,MAAM,KAAK,GAAI,WAAW,MAAM,GAAG,MAAM,MAAM,GAAG,MAAM,KAAG,SAAS,MAAM,EAAwB,CAAC;IAE1G;;;;;;;OAOG;IACI,MAAM,IAAI,GAAI,GAAG,MAAM,KAAG,MAAkB,CAAC;IAEpD;;;;;;;;OAQG;IACI,MAAM,QAAQ,GAAI,WAAW,MAAM,MAAM,GAAG,MAAM,KAAG,OAAgC,CAAC;IAE7F;;;;;;;;OAQG;IACI,MAAM,UAAU,GAAI,QAAQ,MAAM,MAAM,GAAG,MAAM,KAAG,OAA+B,CAAC;IAE3F;;;;;;;;OAQG;IACI,MAAM,QAAQ,GAAI,QAAQ,MAAM,MAAM,GAAG,MAAM,KAAG,OAA6B,CAAC;IAEvF;;;;;;;OAOG;IACI,MAAM,WAAW,GAAI,GAAG,MAAM,KAAG,MAAyB,CAAC;IAElE;;;;;;;OAOG;IACI,MAAM,WAAW,GAAI,GAAG,MAAM,KAAG,MAAyB,CAAC;IAElE;;;;;;;;OAQG;IACI,MAAM,KAAK,GAAI,GAAG,MAAM,KAAG,SAAS,MAAM,EAAyB,CAAC;IAE3E;;;;;;;OAOG;IACI,MAAM,KAAK,GAAI,GAAG,MAAM,KAAG,SAAS,MAAM,EAA2C,CAAC;IAE7F;;OAEG;IACI,MAAM,KAAK;QACjB;;;;;;;;;WASG;iBACM,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC;QAKhC;;;;;;;;;WASG;mBACQ,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC;KAIlC,CAAC;CACF"}
@@ -1,179 +0,0 @@
1
- /**
2
- * Functional utilities for unique-value collections (`ReadonlySet<A>`). All functions are pure
3
- * and data-last — they compose naturally with `pipe`.
4
- *
5
- * Every "mutating" operation returns a new set; the original is never changed.
6
- *
7
- * @example
8
- * ```ts
9
- * import { Uniq } from "@nlozgachev/pipelined/utils";
10
- * import { pipe } from "@nlozgachev/pipelined/composition";
11
- *
12
- * const active = pipe(
13
- * Uniq.fromArray(["alice", "bob", "alice", "carol"]),
14
- * Uniq.remove("bob"),
15
- * Uniq.map(name => name.toUpperCase()),
16
- * );
17
- * // ReadonlySet { "ALICE", "CAROL" }
18
- * ```
19
- */
20
- export declare namespace Uniq {
21
- /**
22
- * Creates an empty unique collection.
23
- *
24
- * @example
25
- * ```ts
26
- * Uniq.empty<number>(); // ReadonlySet {}
27
- * ```
28
- */
29
- const empty: <A>() => ReadonlySet<A>;
30
- /**
31
- * Creates a unique collection containing a single item.
32
- *
33
- * @example
34
- * ```ts
35
- * Uniq.singleton(42); // ReadonlySet { 42 }
36
- * ```
37
- */
38
- const singleton: <A>(item: A) => ReadonlySet<A>;
39
- /**
40
- * Creates a unique collection from an array, automatically discarding duplicates.
41
- *
42
- * @example
43
- * ```ts
44
- * Uniq.fromArray([1, 2, 2, 3, 3, 3]); // ReadonlySet { 1, 2, 3 }
45
- * Uniq.fromArray([]); // ReadonlySet {}
46
- * ```
47
- */
48
- const fromArray: <A>(arr: readonly A[]) => ReadonlySet<A>;
49
- /**
50
- * Returns `true` if the collection contains the given item.
51
- *
52
- * @example
53
- * ```ts
54
- * pipe(Uniq.fromArray([1, 2, 3]), Uniq.has(2)); // true
55
- * pipe(Uniq.fromArray([1, 2, 3]), Uniq.has(4)); // false
56
- * ```
57
- */
58
- const has: <A>(item: A) => (s: ReadonlySet<A>) => boolean;
59
- /**
60
- * Returns the number of items in the collection.
61
- *
62
- * @example
63
- * ```ts
64
- * Uniq.size(Uniq.fromArray([1, 2, 3])); // 3
65
- * ```
66
- */
67
- const size: <A>(s: ReadonlySet<A>) => number;
68
- /**
69
- * Returns `true` if the collection has no items.
70
- *
71
- * @example
72
- * ```ts
73
- * Uniq.isEmpty(Uniq.empty()); // true
74
- * ```
75
- */
76
- const isEmpty: <A>(s: ReadonlySet<A>) => boolean;
77
- /**
78
- * Returns `true` if every item in `set` also exists in `other`.
79
- *
80
- * @example
81
- * ```ts
82
- * pipe(Uniq.fromArray([1, 2]), Uniq.isSubsetOf(Uniq.fromArray([1, 2, 3]))); // true
83
- * pipe(Uniq.fromArray([1, 4]), Uniq.isSubsetOf(Uniq.fromArray([1, 2, 3]))); // false
84
- * pipe(Uniq.empty<number>(), Uniq.isSubsetOf(Uniq.fromArray([1, 2, 3]))); // true
85
- * ```
86
- */
87
- const isSubsetOf: <A>(other: ReadonlySet<A>) => (s: ReadonlySet<A>) => boolean;
88
- /**
89
- * Returns a new collection with the item added. If the item is already present, returns the
90
- * original collection unchanged.
91
- *
92
- * @example
93
- * ```ts
94
- * pipe(Uniq.fromArray([1, 2]), Uniq.insert(3)); // ReadonlySet { 1, 2, 3 }
95
- * pipe(Uniq.fromArray([1, 2]), Uniq.insert(2)); // ReadonlySet { 1, 2 } — unchanged
96
- * ```
97
- */
98
- const insert: <A>(item: A) => (s: ReadonlySet<A>) => ReadonlySet<A>;
99
- /**
100
- * Returns a new collection with the item removed. If the item is not present, returns the
101
- * original collection unchanged.
102
- *
103
- * @example
104
- * ```ts
105
- * pipe(Uniq.fromArray([1, 2, 3]), Uniq.remove(2)); // ReadonlySet { 1, 3 }
106
- * pipe(Uniq.fromArray([1, 2, 3]), Uniq.remove(4)); // ReadonlySet { 1, 2, 3 } — unchanged
107
- * ```
108
- */
109
- const remove: <A>(item: A) => (s: ReadonlySet<A>) => ReadonlySet<A>;
110
- /**
111
- * Applies `f` to each item, returning a new collection of the results. Duplicate results are
112
- * automatically merged.
113
- *
114
- * @example
115
- * ```ts
116
- * pipe(Uniq.fromArray([1, 2, 3, 4]), Uniq.map(n => n % 3)); // ReadonlySet { 1, 2, 0 }
117
- * ```
118
- */
119
- const map: <A, B>(f: (a: A) => B) => (s: ReadonlySet<A>) => ReadonlySet<B>;
120
- /**
121
- * Returns a new collection containing only the items for which the predicate returns `true`.
122
- *
123
- * @example
124
- * ```ts
125
- * pipe(Uniq.fromArray([1, 2, 3, 4, 5]), Uniq.filter(n => n % 2 === 0));
126
- * // ReadonlySet { 2, 4 }
127
- * ```
128
- */
129
- const filter: <A>(predicate: (a: A) => boolean) => (s: ReadonlySet<A>) => ReadonlySet<A>;
130
- /**
131
- * Returns a new collection containing all items from both collections.
132
- *
133
- * @example
134
- * ```ts
135
- * pipe(Uniq.fromArray([1, 2, 3]), Uniq.union(Uniq.fromArray([2, 3, 4])));
136
- * // ReadonlySet { 1, 2, 3, 4 }
137
- * ```
138
- */
139
- const union: <A>(other: ReadonlySet<A>) => (s: ReadonlySet<A>) => ReadonlySet<A>;
140
- /**
141
- * Returns a new collection containing only the items that appear in both collections.
142
- *
143
- * @example
144
- * ```ts
145
- * pipe(Uniq.fromArray([1, 2, 3]), Uniq.intersection(Uniq.fromArray([2, 3, 4])));
146
- * // ReadonlySet { 2, 3 }
147
- * ```
148
- */
149
- const intersection: <A>(other: ReadonlySet<A>) => (s: ReadonlySet<A>) => ReadonlySet<A>;
150
- /**
151
- * Returns a new collection containing only the items from `set` that do not appear in `other`.
152
- *
153
- * @example
154
- * ```ts
155
- * pipe(Uniq.fromArray([1, 2, 3, 4]), Uniq.difference(Uniq.fromArray([2, 4])));
156
- * // ReadonlySet { 1, 3 }
157
- * ```
158
- */
159
- const difference: <A>(other: ReadonlySet<A>) => (s: ReadonlySet<A>) => ReadonlySet<A>;
160
- /**
161
- * Folds the collection into a single value by applying `f` to each item in insertion order.
162
- *
163
- * @example
164
- * ```ts
165
- * Uniq.reduce(0, (acc, n) => acc + n)(Uniq.fromArray([1, 2, 3])); // 6
166
- * ```
167
- */
168
- const reduce: <A, B>(init: B, f: (acc: B, a: A) => B) => (s: ReadonlySet<A>) => B;
169
- /**
170
- * Converts the collection to a readonly array in insertion order.
171
- *
172
- * @example
173
- * ```ts
174
- * Uniq.toArray(Uniq.fromArray([3, 1, 2])); // [3, 1, 2]
175
- * ```
176
- */
177
- const toArray: <A>(s: ReadonlySet<A>) => readonly A[];
178
- }
179
- //# sourceMappingURL=Uniq.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Uniq.d.ts","sourceRoot":"","sources":["../../../src/src/Utils/Uniq.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,yBAAiB,IAAI,CAAC;IAKrB;;;;;;;OAOG;IACI,MAAM,KAAK,GAAI,CAAC,OAAK,WAAW,CAAC,CAAC,CAA4B,CAAC;IAEtE;;;;;;;OAOG;IACI,MAAM,SAAS,GAAI,CAAC,EAAE,MAAM,CAAC,KAAG,WAAW,CAAC,CAAC,CAA+B,CAAC;IAEpF;;;;;;;;OAQG;IACI,MAAM,SAAS,GAAI,CAAC,EAAE,KAAK,SAAS,CAAC,EAAE,KAAG,WAAW,CAAC,CAAC,CAA4B,CAAC;IAM3F;;;;;;;;OAQG;IACI,MAAM,GAAG,GAAI,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,OAAsB,CAAC;IAE/E;;;;;;;OAOG;IACI,MAAM,IAAI,GAAI,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,MAAgB,CAAC;IAE7D;;;;;;;OAOG;IACI,MAAM,OAAO,GAAI,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,OAAuB,CAAC;IAEvE;;;;;;;;;OASG;IACI,MAAM,UAAU,GAAI,CAAC,EAAE,OAAO,WAAW,CAAC,CAAC,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,OAK5E,CAAC;IAMF;;;;;;;;;OASG;IACI,MAAM,MAAM,GAAI,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAKvE,CAAC;IAEF;;;;;;;;;OASG;IACI,MAAM,MAAM,GAAI,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAKvE,CAAC;IAMF;;;;;;;;OAQG;IACI,MAAM,GAAG,GAAI,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAM9E,CAAC;IAEF;;;;;;;;OAQG;IACI,MAAM,MAAM,GAAI,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAM5F,CAAC;IAMF;;;;;;;;OAQG;IACI,MAAM,KAAK,GAAI,CAAC,EAAE,OAAO,WAAW,CAAC,CAAC,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAMpF,CAAC;IAEF;;;;;;;;OAQG;IACI,MAAM,YAAY,GAAI,CAAC,EAAE,OAAO,WAAW,CAAC,CAAC,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAM3F,CAAC;IAEF;;;;;;;;OAQG;IACI,MAAM,UAAU,GAAI,CAAC,EAAE,OAAO,WAAW,CAAC,CAAC,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAMzF,CAAC;IAMF;;;;;;;OAOG;IACI,MAAM,MAAM,GAAI,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,CAMrF,CAAC;IAMF;;;;;;;OAOG;IACI,MAAM,OAAO,GAAI,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,KAAG,SAAS,CAAC,EAAY,CAAC;CACtE"}
@@ -1,7 +0,0 @@
1
- export * from "./Arr.js";
2
- export * from "./Rec.js";
3
- export * from "./Num.js";
4
- export * from "./Str.js";
5
- export * from "./Dict.js";
6
- export * from "./Uniq.js";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/Utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}