@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.
- package/LICENCE +28 -0
- package/README.md +1 -1
- package/{types/src/Types/NonEmptyList.d.ts → dist/NonEmptyList-BlGFjor5.d.mts} +4 -3
- package/dist/NonEmptyList-BlGFjor5.d.ts +30 -0
- package/dist/Task-BB8Wmc1J.d.ts +677 -0
- package/dist/Task-ChKyH0pF.d.mts +677 -0
- package/dist/chunk-DBIC62UV.mjs +6 -0
- package/dist/chunk-QPTGO5AS.mjs +150 -0
- package/dist/composition.d.mts +495 -0
- package/dist/composition.d.ts +495 -0
- package/dist/composition.js +188 -0
- package/dist/composition.mjs +135 -0
- package/dist/core.d.mts +2170 -0
- package/dist/core.d.ts +2170 -0
- package/dist/core.js +698 -0
- package/dist/core.mjs +517 -0
- package/dist/types.d.mts +54 -0
- package/{types/src/Types/Brand.d.ts → dist/types.d.ts} +6 -4
- package/dist/types.js +41 -0
- package/dist/types.mjs +14 -0
- package/dist/utils.d.mts +1285 -0
- package/dist/utils.d.ts +1285 -0
- package/dist/utils.js +722 -0
- package/dist/utils.mjs +553 -0
- package/package.json +63 -69
- package/esm/mod.js +0 -3
- package/esm/package.json +0 -3
- package/esm/src/Composition/compose.js +0 -3
- package/esm/src/Composition/converge.js +0 -3
- package/esm/src/Composition/curry.js +0 -42
- package/esm/src/Composition/flip.js +0 -20
- package/esm/src/Composition/flow.js +0 -8
- package/esm/src/Composition/fn.js +0 -85
- package/esm/src/Composition/index.js +0 -13
- package/esm/src/Composition/juxt.js +0 -3
- package/esm/src/Composition/memoize.js +0 -66
- package/esm/src/Composition/not.js +0 -25
- package/esm/src/Composition/on.js +0 -12
- package/esm/src/Composition/pipe.js +0 -3
- package/esm/src/Composition/tap.js +0 -33
- package/esm/src/Composition/uncurry.js +0 -32
- package/esm/src/Core/Deferred.js +0 -30
- package/esm/src/Core/InternalTypes.js +0 -1
- package/esm/src/Core/Lens.js +0 -98
- package/esm/src/Core/Logged.js +0 -111
- package/esm/src/Core/Option.js +0 -191
- package/esm/src/Core/Optional.js +0 -160
- package/esm/src/Core/Predicate.js +0 -133
- package/esm/src/Core/Reader.js +0 -134
- package/esm/src/Core/Refinement.js +0 -115
- package/esm/src/Core/RemoteData.js +0 -211
- package/esm/src/Core/Result.js +0 -170
- package/esm/src/Core/State.js +0 -181
- package/esm/src/Core/Task.js +0 -223
- package/esm/src/Core/TaskOption.js +0 -106
- package/esm/src/Core/TaskResult.js +0 -127
- package/esm/src/Core/TaskValidation.js +0 -128
- package/esm/src/Core/These.js +0 -245
- package/esm/src/Core/Tuple.js +0 -112
- package/esm/src/Core/Validation.js +0 -212
- package/esm/src/Core/index.js +0 -18
- package/esm/src/Types/Brand.js +0 -28
- package/esm/src/Types/NonEmptyList.js +0 -14
- package/esm/src/Types/index.js +0 -2
- package/esm/src/Utils/Arr.js +0 -570
- package/esm/src/Utils/Dict.js +0 -421
- package/esm/src/Utils/Num.js +0 -124
- package/esm/src/Utils/Rec.js +0 -241
- package/esm/src/Utils/Str.js +0 -134
- package/esm/src/Utils/Uniq.js +0 -265
- package/esm/src/Utils/index.js +0 -6
- package/script/mod.js +0 -19
- package/script/package.json +0 -3
- package/script/src/Composition/compose.js +0 -6
- package/script/src/Composition/converge.js +0 -6
- package/script/src/Composition/curry.js +0 -48
- package/script/src/Composition/flip.js +0 -24
- package/script/src/Composition/flow.js +0 -11
- package/script/src/Composition/fn.js +0 -98
- package/script/src/Composition/index.js +0 -29
- package/script/src/Composition/juxt.js +0 -6
- package/script/src/Composition/memoize.js +0 -71
- package/script/src/Composition/not.js +0 -29
- package/script/src/Composition/on.js +0 -16
- package/script/src/Composition/pipe.js +0 -6
- package/script/src/Composition/tap.js +0 -37
- package/script/src/Composition/uncurry.js +0 -38
- package/script/src/Core/Deferred.js +0 -33
- package/script/src/Core/InternalTypes.js +0 -2
- package/script/src/Core/Lens.js +0 -101
- package/script/src/Core/Logged.js +0 -114
- package/script/src/Core/Option.js +0 -194
- package/script/src/Core/Optional.js +0 -163
- package/script/src/Core/Predicate.js +0 -136
- package/script/src/Core/Reader.js +0 -137
- package/script/src/Core/Refinement.js +0 -118
- package/script/src/Core/RemoteData.js +0 -214
- package/script/src/Core/Result.js +0 -173
- package/script/src/Core/State.js +0 -184
- package/script/src/Core/Task.js +0 -226
- package/script/src/Core/TaskOption.js +0 -109
- package/script/src/Core/TaskResult.js +0 -130
- package/script/src/Core/TaskValidation.js +0 -131
- package/script/src/Core/These.js +0 -248
- package/script/src/Core/Tuple.js +0 -115
- package/script/src/Core/Validation.js +0 -215
- package/script/src/Core/index.js +0 -34
- package/script/src/Types/Brand.js +0 -31
- package/script/src/Types/NonEmptyList.js +0 -18
- package/script/src/Types/index.js +0 -18
- package/script/src/Utils/Arr.js +0 -573
- package/script/src/Utils/Dict.js +0 -424
- package/script/src/Utils/Num.js +0 -127
- package/script/src/Utils/Rec.js +0 -244
- package/script/src/Utils/Str.js +0 -137
- package/script/src/Utils/Uniq.js +0 -268
- package/script/src/Utils/index.js +0 -22
- package/types/mod.d.ts +0 -4
- package/types/mod.d.ts.map +0 -1
- package/types/src/Composition/compose.d.ts +0 -33
- package/types/src/Composition/compose.d.ts.map +0 -1
- package/types/src/Composition/converge.d.ts +0 -21
- package/types/src/Composition/converge.d.ts.map +0 -1
- package/types/src/Composition/curry.d.ts +0 -43
- package/types/src/Composition/curry.d.ts.map +0 -1
- package/types/src/Composition/flip.d.ts +0 -21
- package/types/src/Composition/flip.d.ts.map +0 -1
- package/types/src/Composition/flow.d.ts +0 -56
- package/types/src/Composition/flow.d.ts.map +0 -1
- package/types/src/Composition/fn.d.ts +0 -76
- package/types/src/Composition/fn.d.ts.map +0 -1
- package/types/src/Composition/index.d.ts +0 -14
- package/types/src/Composition/index.d.ts.map +0 -1
- package/types/src/Composition/juxt.d.ts +0 -18
- package/types/src/Composition/juxt.d.ts.map +0 -1
- package/types/src/Composition/memoize.d.ts +0 -46
- package/types/src/Composition/memoize.d.ts.map +0 -1
- package/types/src/Composition/not.d.ts +0 -26
- package/types/src/Composition/not.d.ts.map +0 -1
- package/types/src/Composition/on.d.ts +0 -13
- package/types/src/Composition/on.d.ts.map +0 -1
- package/types/src/Composition/pipe.d.ts +0 -56
- package/types/src/Composition/pipe.d.ts.map +0 -1
- package/types/src/Composition/tap.d.ts +0 -31
- package/types/src/Composition/tap.d.ts.map +0 -1
- package/types/src/Composition/uncurry.d.ts +0 -54
- package/types/src/Composition/uncurry.d.ts.map +0 -1
- package/types/src/Core/Deferred.d.ts +0 -49
- package/types/src/Core/Deferred.d.ts.map +0 -1
- package/types/src/Core/InternalTypes.d.ts +0 -23
- package/types/src/Core/InternalTypes.d.ts.map +0 -1
- package/types/src/Core/Lens.d.ts +0 -118
- package/types/src/Core/Lens.d.ts.map +0 -1
- package/types/src/Core/Logged.d.ts +0 -126
- package/types/src/Core/Logged.d.ts.map +0 -1
- package/types/src/Core/Option.d.ts +0 -209
- package/types/src/Core/Option.d.ts.map +0 -1
- package/types/src/Core/Optional.d.ts +0 -158
- package/types/src/Core/Optional.d.ts.map +0 -1
- package/types/src/Core/Predicate.d.ts +0 -161
- package/types/src/Core/Predicate.d.ts.map +0 -1
- package/types/src/Core/Reader.d.ts +0 -156
- package/types/src/Core/Reader.d.ts.map +0 -1
- package/types/src/Core/Refinement.d.ts +0 -138
- package/types/src/Core/Refinement.d.ts.map +0 -1
- package/types/src/Core/RemoteData.d.ts +0 -197
- package/types/src/Core/RemoteData.d.ts.map +0 -1
- package/types/src/Core/Result.d.ts +0 -182
- package/types/src/Core/Result.d.ts.map +0 -1
- package/types/src/Core/State.d.ts +0 -192
- package/types/src/Core/State.d.ts.map +0 -1
- package/types/src/Core/Task.d.ts +0 -219
- package/types/src/Core/Task.d.ts.map +0 -1
- package/types/src/Core/TaskOption.d.ts +0 -121
- package/types/src/Core/TaskOption.d.ts.map +0 -1
- package/types/src/Core/TaskResult.d.ts +0 -119
- package/types/src/Core/TaskResult.d.ts.map +0 -1
- package/types/src/Core/TaskValidation.d.ts +0 -144
- package/types/src/Core/TaskValidation.d.ts.map +0 -1
- package/types/src/Core/These.d.ts +0 -225
- package/types/src/Core/These.d.ts.map +0 -1
- package/types/src/Core/Tuple.d.ts +0 -129
- package/types/src/Core/Tuple.d.ts.map +0 -1
- package/types/src/Core/Validation.d.ts +0 -203
- package/types/src/Core/Validation.d.ts.map +0 -1
- package/types/src/Core/index.d.ts +0 -19
- package/types/src/Core/index.d.ts.map +0 -1
- package/types/src/Types/Brand.d.ts.map +0 -1
- package/types/src/Types/NonEmptyList.d.ts.map +0 -1
- package/types/src/Types/index.d.ts +0 -3
- package/types/src/Types/index.d.ts.map +0 -1
- package/types/src/Utils/Arr.d.ts +0 -403
- package/types/src/Utils/Arr.d.ts.map +0 -1
- package/types/src/Utils/Dict.d.ts +0 -310
- package/types/src/Utils/Dict.d.ts.map +0 -1
- package/types/src/Utils/Num.d.ts +0 -110
- package/types/src/Utils/Num.d.ts.map +0 -1
- package/types/src/Utils/Rec.d.ts +0 -159
- package/types/src/Utils/Rec.d.ts.map +0 -1
- package/types/src/Utils/Str.d.ts +0 -128
- package/types/src/Utils/Str.d.ts.map +0 -1
- package/types/src/Utils/Uniq.d.ts +0 -179
- package/types/src/Utils/Uniq.d.ts.map +0 -1
- package/types/src/Utils/index.d.ts +0 -7
- package/types/src/Utils/index.d.ts.map +0 -1
package/types/src/Utils/Str.d.ts
DELETED
|
@@ -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,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