is-kit 1.1.3 → 1.1.4
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/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -136,8 +136,8 @@ declare function equals<const T>(target: T): Predicate<T>;
|
|
|
136
136
|
* @param selector Optional selector to project the comparable key; if omitted, returns a function to supply it later.
|
|
137
137
|
* @returns Function that accepts a target and returns a predicate over the original value.
|
|
138
138
|
*/
|
|
139
|
-
declare function equalsBy<F extends
|
|
140
|
-
declare function equalsBy<F extends
|
|
139
|
+
declare function equalsBy<F extends Predicate<unknown>>(guard: F): <K>(selector: (value: GuardedOf<F>) => K) => <const T extends K>(target: T) => Predicate<GuardedOf<F>>;
|
|
140
|
+
declare function equalsBy<F extends Predicate<unknown>, K>(guard: F, selector: (value: GuardedOf<F>) => K): <const T extends K>(target: T) => Predicate<GuardedOf<F>>;
|
|
141
141
|
/**
|
|
142
142
|
* Creates a guard that matches objects having a key equal to the target value.
|
|
143
143
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -136,8 +136,8 @@ declare function equals<const T>(target: T): Predicate<T>;
|
|
|
136
136
|
* @param selector Optional selector to project the comparable key; if omitted, returns a function to supply it later.
|
|
137
137
|
* @returns Function that accepts a target and returns a predicate over the original value.
|
|
138
138
|
*/
|
|
139
|
-
declare function equalsBy<F extends
|
|
140
|
-
declare function equalsBy<F extends
|
|
139
|
+
declare function equalsBy<F extends Predicate<unknown>>(guard: F): <K>(selector: (value: GuardedOf<F>) => K) => <const T extends K>(target: T) => Predicate<GuardedOf<F>>;
|
|
140
|
+
declare function equalsBy<F extends Predicate<unknown>, K>(guard: F, selector: (value: GuardedOf<F>) => K): <const T extends K>(target: T) => Predicate<GuardedOf<F>>;
|
|
141
141
|
/**
|
|
142
142
|
* Creates a guard that matches objects having a key equal to the target value.
|
|
143
143
|
*
|
package/dist/index.js
CHANGED
|
@@ -85,7 +85,7 @@ function define(fn) {
|
|
|
85
85
|
// src/core/predicate.ts
|
|
86
86
|
var predicateToRefine = (fn) => (value) => fn(value);
|
|
87
87
|
|
|
88
|
-
// src/utils/
|
|
88
|
+
// src/utils/to-boolean-predicates.ts
|
|
89
89
|
var toBooleanPredicates = (guards) => guards;
|
|
90
90
|
|
|
91
91
|
// src/core/logic.ts
|
|
@@ -269,7 +269,7 @@ function tupleOf(...guards) {
|
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
// src/core/combinators/one.ts
|
|
272
|
+
// src/core/combinators/one-of.ts
|
|
273
273
|
function oneOf(...guards) {
|
|
274
274
|
return (input) => guards.some((guard) => guard(input));
|
|
275
275
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ function define(fn) {
|
|
|
6
6
|
// src/core/predicate.ts
|
|
7
7
|
var predicateToRefine = (fn) => (value) => fn(value);
|
|
8
8
|
|
|
9
|
-
// src/utils/
|
|
9
|
+
// src/utils/to-boolean-predicates.ts
|
|
10
10
|
var toBooleanPredicates = (guards) => guards;
|
|
11
11
|
|
|
12
12
|
// src/core/logic.ts
|
|
@@ -190,7 +190,7 @@ function tupleOf(...guards) {
|
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
// src/core/combinators/one.ts
|
|
193
|
+
// src/core/combinators/one-of.ts
|
|
194
194
|
function oneOf(...guards) {
|
|
195
195
|
return (input) => guards.some((guard) => guard(input));
|
|
196
196
|
}
|