is-kit 1.4.1 → 1.4.2

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.js CHANGED
@@ -219,25 +219,26 @@ var isBlob = typeof Blob !== "undefined" ? define((value) => value instanceof Bl
219
219
  var isInstanceOf = (constructor) => define((value) => value instanceof constructor);
220
220
 
221
221
  // src/core/equals.ts
222
+ var guardedBy = (guard) => define((input) => guard(input));
222
223
  function equals(target) {
223
- return (input) => {
224
- return Object.is(input, target);
225
- };
224
+ return define((input) => Object.is(input, target));
226
225
  }
227
226
  function equalsBy(guard, selector) {
228
- const createComparator = (selectorFn) => (target) => (input) => {
229
- if (!guard(input)) return false;
227
+ const matchesGuard = guardedBy(guard);
228
+ const createComparator = (selectorFn) => (target) => define((input) => {
229
+ if (!matchesGuard(input)) return false;
230
230
  return Object.is(selectorFn(input), target);
231
- };
231
+ });
232
232
  if (selector) {
233
233
  return createComparator(selector);
234
234
  }
235
- return (selector2) => createComparator(selector2);
235
+ return (selectorFn) => createComparator(selectorFn);
236
236
  }
237
237
  function equalsKey(key, target) {
238
- return (input) => {
238
+ const hasMatchingKey = define((input) => {
239
239
  return isObject(input) && Object.prototype.hasOwnProperty.call(input, key) && Object.is(input[key], target);
240
- };
240
+ });
241
+ return (input) => hasMatchingKey(input);
241
242
  }
242
243
 
243
244
  // src/core/parse.ts
package/dist/index.mjs CHANGED
@@ -129,25 +129,26 @@ var isBlob = typeof Blob !== "undefined" ? define((value) => value instanceof Bl
129
129
  var isInstanceOf = (constructor) => define((value) => value instanceof constructor);
130
130
 
131
131
  // src/core/equals.ts
132
+ var guardedBy = (guard) => define((input) => guard(input));
132
133
  function equals(target) {
133
- return (input) => {
134
- return Object.is(input, target);
135
- };
134
+ return define((input) => Object.is(input, target));
136
135
  }
137
136
  function equalsBy(guard, selector) {
138
- const createComparator = (selectorFn) => (target) => (input) => {
139
- if (!guard(input)) return false;
137
+ const matchesGuard = guardedBy(guard);
138
+ const createComparator = (selectorFn) => (target) => define((input) => {
139
+ if (!matchesGuard(input)) return false;
140
140
  return Object.is(selectorFn(input), target);
141
- };
141
+ });
142
142
  if (selector) {
143
143
  return createComparator(selector);
144
144
  }
145
- return (selector2) => createComparator(selector2);
145
+ return (selectorFn) => createComparator(selectorFn);
146
146
  }
147
147
  function equalsKey(key, target) {
148
- return (input) => {
148
+ const hasMatchingKey = define((input) => {
149
149
  return isObject(input) && Object.prototype.hasOwnProperty.call(input, key) && Object.is(input[key], target);
150
- };
150
+ });
151
+ return (input) => hasMatchingKey(input);
151
152
  }
152
153
 
153
154
  // src/core/parse.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "is-kit",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Make 'isXXX' easier. Let's make your code type safe and more readable!",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",