@nlozgachev/pipelined 0.12.0 → 0.13.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 (205) 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-BB8Wmc1J.d.ts +677 -0
  6. package/dist/Task-ChKyH0pF.d.mts +677 -0
  7. package/dist/chunk-DBIC62UV.mjs +6 -0
  8. package/dist/chunk-QPTGO5AS.mjs +150 -0
  9. package/dist/composition.d.mts +495 -0
  10. package/dist/composition.d.ts +495 -0
  11. package/dist/composition.js +188 -0
  12. package/dist/composition.mjs +135 -0
  13. package/dist/core.d.mts +2170 -0
  14. package/dist/core.d.ts +2170 -0
  15. package/dist/core.js +698 -0
  16. package/dist/core.mjs +517 -0
  17. package/dist/types.d.mts +54 -0
  18. package/{types/src/Types/Brand.d.ts → dist/types.d.ts} +6 -4
  19. package/dist/types.js +41 -0
  20. package/dist/types.mjs +14 -0
  21. package/dist/utils.d.mts +1285 -0
  22. package/dist/utils.d.ts +1285 -0
  23. package/dist/utils.js +722 -0
  24. package/dist/utils.mjs +553 -0
  25. package/package.json +63 -69
  26. package/esm/mod.js +0 -3
  27. package/esm/package.json +0 -3
  28. package/esm/src/Composition/compose.js +0 -3
  29. package/esm/src/Composition/converge.js +0 -3
  30. package/esm/src/Composition/curry.js +0 -42
  31. package/esm/src/Composition/flip.js +0 -20
  32. package/esm/src/Composition/flow.js +0 -8
  33. package/esm/src/Composition/fn.js +0 -85
  34. package/esm/src/Composition/index.js +0 -13
  35. package/esm/src/Composition/juxt.js +0 -3
  36. package/esm/src/Composition/memoize.js +0 -66
  37. package/esm/src/Composition/not.js +0 -25
  38. package/esm/src/Composition/on.js +0 -12
  39. package/esm/src/Composition/pipe.js +0 -3
  40. package/esm/src/Composition/tap.js +0 -33
  41. package/esm/src/Composition/uncurry.js +0 -32
  42. package/esm/src/Core/Deferred.js +0 -30
  43. package/esm/src/Core/InternalTypes.js +0 -1
  44. package/esm/src/Core/Lens.js +0 -98
  45. package/esm/src/Core/Logged.js +0 -111
  46. package/esm/src/Core/Option.js +0 -191
  47. package/esm/src/Core/Optional.js +0 -160
  48. package/esm/src/Core/Predicate.js +0 -133
  49. package/esm/src/Core/Reader.js +0 -134
  50. package/esm/src/Core/Refinement.js +0 -115
  51. package/esm/src/Core/RemoteData.js +0 -211
  52. package/esm/src/Core/Result.js +0 -170
  53. package/esm/src/Core/State.js +0 -181
  54. package/esm/src/Core/Task.js +0 -223
  55. package/esm/src/Core/TaskOption.js +0 -106
  56. package/esm/src/Core/TaskResult.js +0 -127
  57. package/esm/src/Core/TaskValidation.js +0 -128
  58. package/esm/src/Core/These.js +0 -245
  59. package/esm/src/Core/Tuple.js +0 -112
  60. package/esm/src/Core/Validation.js +0 -212
  61. package/esm/src/Core/index.js +0 -18
  62. package/esm/src/Types/Brand.js +0 -28
  63. package/esm/src/Types/NonEmptyList.js +0 -14
  64. package/esm/src/Types/index.js +0 -2
  65. package/esm/src/Utils/Arr.js +0 -570
  66. package/esm/src/Utils/Dict.js +0 -421
  67. package/esm/src/Utils/Num.js +0 -124
  68. package/esm/src/Utils/Rec.js +0 -241
  69. package/esm/src/Utils/Str.js +0 -134
  70. package/esm/src/Utils/Uniq.js +0 -265
  71. package/esm/src/Utils/index.js +0 -6
  72. package/script/mod.js +0 -19
  73. package/script/package.json +0 -3
  74. package/script/src/Composition/compose.js +0 -6
  75. package/script/src/Composition/converge.js +0 -6
  76. package/script/src/Composition/curry.js +0 -48
  77. package/script/src/Composition/flip.js +0 -24
  78. package/script/src/Composition/flow.js +0 -11
  79. package/script/src/Composition/fn.js +0 -98
  80. package/script/src/Composition/index.js +0 -29
  81. package/script/src/Composition/juxt.js +0 -6
  82. package/script/src/Composition/memoize.js +0 -71
  83. package/script/src/Composition/not.js +0 -29
  84. package/script/src/Composition/on.js +0 -16
  85. package/script/src/Composition/pipe.js +0 -6
  86. package/script/src/Composition/tap.js +0 -37
  87. package/script/src/Composition/uncurry.js +0 -38
  88. package/script/src/Core/Deferred.js +0 -33
  89. package/script/src/Core/InternalTypes.js +0 -2
  90. package/script/src/Core/Lens.js +0 -101
  91. package/script/src/Core/Logged.js +0 -114
  92. package/script/src/Core/Option.js +0 -194
  93. package/script/src/Core/Optional.js +0 -163
  94. package/script/src/Core/Predicate.js +0 -136
  95. package/script/src/Core/Reader.js +0 -137
  96. package/script/src/Core/Refinement.js +0 -118
  97. package/script/src/Core/RemoteData.js +0 -214
  98. package/script/src/Core/Result.js +0 -173
  99. package/script/src/Core/State.js +0 -184
  100. package/script/src/Core/Task.js +0 -226
  101. package/script/src/Core/TaskOption.js +0 -109
  102. package/script/src/Core/TaskResult.js +0 -130
  103. package/script/src/Core/TaskValidation.js +0 -131
  104. package/script/src/Core/These.js +0 -248
  105. package/script/src/Core/Tuple.js +0 -115
  106. package/script/src/Core/Validation.js +0 -215
  107. package/script/src/Core/index.js +0 -34
  108. package/script/src/Types/Brand.js +0 -31
  109. package/script/src/Types/NonEmptyList.js +0 -18
  110. package/script/src/Types/index.js +0 -18
  111. package/script/src/Utils/Arr.js +0 -573
  112. package/script/src/Utils/Dict.js +0 -424
  113. package/script/src/Utils/Num.js +0 -127
  114. package/script/src/Utils/Rec.js +0 -244
  115. package/script/src/Utils/Str.js +0 -137
  116. package/script/src/Utils/Uniq.js +0 -268
  117. package/script/src/Utils/index.js +0 -22
  118. package/types/mod.d.ts +0 -4
  119. package/types/mod.d.ts.map +0 -1
  120. package/types/src/Composition/compose.d.ts +0 -33
  121. package/types/src/Composition/compose.d.ts.map +0 -1
  122. package/types/src/Composition/converge.d.ts +0 -21
  123. package/types/src/Composition/converge.d.ts.map +0 -1
  124. package/types/src/Composition/curry.d.ts +0 -43
  125. package/types/src/Composition/curry.d.ts.map +0 -1
  126. package/types/src/Composition/flip.d.ts +0 -21
  127. package/types/src/Composition/flip.d.ts.map +0 -1
  128. package/types/src/Composition/flow.d.ts +0 -56
  129. package/types/src/Composition/flow.d.ts.map +0 -1
  130. package/types/src/Composition/fn.d.ts +0 -76
  131. package/types/src/Composition/fn.d.ts.map +0 -1
  132. package/types/src/Composition/index.d.ts +0 -14
  133. package/types/src/Composition/index.d.ts.map +0 -1
  134. package/types/src/Composition/juxt.d.ts +0 -18
  135. package/types/src/Composition/juxt.d.ts.map +0 -1
  136. package/types/src/Composition/memoize.d.ts +0 -46
  137. package/types/src/Composition/memoize.d.ts.map +0 -1
  138. package/types/src/Composition/not.d.ts +0 -26
  139. package/types/src/Composition/not.d.ts.map +0 -1
  140. package/types/src/Composition/on.d.ts +0 -13
  141. package/types/src/Composition/on.d.ts.map +0 -1
  142. package/types/src/Composition/pipe.d.ts +0 -56
  143. package/types/src/Composition/pipe.d.ts.map +0 -1
  144. package/types/src/Composition/tap.d.ts +0 -31
  145. package/types/src/Composition/tap.d.ts.map +0 -1
  146. package/types/src/Composition/uncurry.d.ts +0 -54
  147. package/types/src/Composition/uncurry.d.ts.map +0 -1
  148. package/types/src/Core/Deferred.d.ts +0 -49
  149. package/types/src/Core/Deferred.d.ts.map +0 -1
  150. package/types/src/Core/InternalTypes.d.ts +0 -23
  151. package/types/src/Core/InternalTypes.d.ts.map +0 -1
  152. package/types/src/Core/Lens.d.ts +0 -118
  153. package/types/src/Core/Lens.d.ts.map +0 -1
  154. package/types/src/Core/Logged.d.ts +0 -126
  155. package/types/src/Core/Logged.d.ts.map +0 -1
  156. package/types/src/Core/Option.d.ts +0 -209
  157. package/types/src/Core/Option.d.ts.map +0 -1
  158. package/types/src/Core/Optional.d.ts +0 -158
  159. package/types/src/Core/Optional.d.ts.map +0 -1
  160. package/types/src/Core/Predicate.d.ts +0 -161
  161. package/types/src/Core/Predicate.d.ts.map +0 -1
  162. package/types/src/Core/Reader.d.ts +0 -156
  163. package/types/src/Core/Reader.d.ts.map +0 -1
  164. package/types/src/Core/Refinement.d.ts +0 -138
  165. package/types/src/Core/Refinement.d.ts.map +0 -1
  166. package/types/src/Core/RemoteData.d.ts +0 -197
  167. package/types/src/Core/RemoteData.d.ts.map +0 -1
  168. package/types/src/Core/Result.d.ts +0 -182
  169. package/types/src/Core/Result.d.ts.map +0 -1
  170. package/types/src/Core/State.d.ts +0 -192
  171. package/types/src/Core/State.d.ts.map +0 -1
  172. package/types/src/Core/Task.d.ts +0 -219
  173. package/types/src/Core/Task.d.ts.map +0 -1
  174. package/types/src/Core/TaskOption.d.ts +0 -121
  175. package/types/src/Core/TaskOption.d.ts.map +0 -1
  176. package/types/src/Core/TaskResult.d.ts +0 -119
  177. package/types/src/Core/TaskResult.d.ts.map +0 -1
  178. package/types/src/Core/TaskValidation.d.ts +0 -144
  179. package/types/src/Core/TaskValidation.d.ts.map +0 -1
  180. package/types/src/Core/These.d.ts +0 -225
  181. package/types/src/Core/These.d.ts.map +0 -1
  182. package/types/src/Core/Tuple.d.ts +0 -129
  183. package/types/src/Core/Tuple.d.ts.map +0 -1
  184. package/types/src/Core/Validation.d.ts +0 -203
  185. package/types/src/Core/Validation.d.ts.map +0 -1
  186. package/types/src/Core/index.d.ts +0 -19
  187. package/types/src/Core/index.d.ts.map +0 -1
  188. package/types/src/Types/Brand.d.ts.map +0 -1
  189. package/types/src/Types/NonEmptyList.d.ts.map +0 -1
  190. package/types/src/Types/index.d.ts +0 -3
  191. package/types/src/Types/index.d.ts.map +0 -1
  192. package/types/src/Utils/Arr.d.ts +0 -403
  193. package/types/src/Utils/Arr.d.ts.map +0 -1
  194. package/types/src/Utils/Dict.d.ts +0 -310
  195. package/types/src/Utils/Dict.d.ts.map +0 -1
  196. package/types/src/Utils/Num.d.ts +0 -110
  197. package/types/src/Utils/Num.d.ts.map +0 -1
  198. package/types/src/Utils/Rec.d.ts +0 -159
  199. package/types/src/Utils/Rec.d.ts.map +0 -1
  200. package/types/src/Utils/Str.d.ts +0 -128
  201. package/types/src/Utils/Str.d.ts.map +0 -1
  202. package/types/src/Utils/Uniq.d.ts +0 -179
  203. package/types/src/Utils/Uniq.d.ts.map +0 -1
  204. package/types/src/Utils/index.d.ts +0 -7
  205. 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 @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./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"}