es-toolkit 1.43.0-dev.1717 → 1.43.0-dev.1719
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/array/intersection.js +1 -3
- package/dist/array/intersection.mjs +1 -3
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.mjs +1 -0
- package/dist/predicate/index.d.mts +1 -0
- package/dist/predicate/index.d.ts +1 -0
- package/dist/predicate/index.js +2 -0
- package/dist/predicate/index.mjs +1 -0
- package/dist/predicate/isEmptyObject.d.mts +15 -0
- package/dist/predicate/isEmptyObject.d.ts +15 -0
- package/dist/predicate/isEmptyObject.js +11 -0
- package/dist/predicate/isEmptyObject.mjs +7 -0
- package/package.json +1 -1
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
function intersection(firstArr, secondArr) {
|
|
6
6
|
const secondSet = new Set(secondArr);
|
|
7
|
-
return firstArr.filter(item =>
|
|
8
|
-
return secondSet.has(item);
|
|
9
|
-
});
|
|
7
|
+
return firstArr.filter(item => secondSet.has(item));
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
exports.intersection = intersection;
|
package/dist/index.d.mts
CHANGED
|
@@ -123,6 +123,7 @@ export { isBoolean } from './predicate/isBoolean.mjs';
|
|
|
123
123
|
export { isBrowser } from './predicate/isBrowser.mjs';
|
|
124
124
|
export { isBuffer } from './predicate/isBuffer.mjs';
|
|
125
125
|
export { isDate } from './predicate/isDate.mjs';
|
|
126
|
+
export { isEmptyObject } from './predicate/isEmptyObject.mjs';
|
|
126
127
|
export { isEqual } from './predicate/isEqual.mjs';
|
|
127
128
|
export { isEqualWith } from './predicate/isEqualWith.mjs';
|
|
128
129
|
export { isError } from './predicate/isError.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -123,6 +123,7 @@ export { isBoolean } from './predicate/isBoolean.js';
|
|
|
123
123
|
export { isBrowser } from './predicate/isBrowser.js';
|
|
124
124
|
export { isBuffer } from './predicate/isBuffer.js';
|
|
125
125
|
export { isDate } from './predicate/isDate.js';
|
|
126
|
+
export { isEmptyObject } from './predicate/isEmptyObject.js';
|
|
126
127
|
export { isEqual } from './predicate/isEqual.js';
|
|
127
128
|
export { isEqualWith } from './predicate/isEqualWith.js';
|
|
128
129
|
export { isError } from './predicate/isError.js';
|
package/dist/index.js
CHANGED
|
@@ -127,6 +127,7 @@ const isBoolean = require('./predicate/isBoolean.js');
|
|
|
127
127
|
const isBrowser = require('./predicate/isBrowser.js');
|
|
128
128
|
const isBuffer = require('./predicate/isBuffer.js');
|
|
129
129
|
const isDate = require('./predicate/isDate.js');
|
|
130
|
+
const isEmptyObject = require('./predicate/isEmptyObject.js');
|
|
130
131
|
const isEqual = require('./predicate/isEqual.js');
|
|
131
132
|
const isEqualWith = require('./predicate/isEqualWith.js');
|
|
132
133
|
const isError = require('./predicate/isError.js');
|
|
@@ -309,6 +310,7 @@ exports.isBoolean = isBoolean.isBoolean;
|
|
|
309
310
|
exports.isBrowser = isBrowser.isBrowser;
|
|
310
311
|
exports.isBuffer = isBuffer.isBuffer;
|
|
311
312
|
exports.isDate = isDate.isDate;
|
|
313
|
+
exports.isEmptyObject = isEmptyObject.isEmptyObject;
|
|
312
314
|
exports.isEqual = isEqual.isEqual;
|
|
313
315
|
exports.isEqualWith = isEqualWith.isEqualWith;
|
|
314
316
|
exports.isError = isError.isError;
|
package/dist/index.mjs
CHANGED
|
@@ -123,6 +123,7 @@ export { isBoolean } from './predicate/isBoolean.mjs';
|
|
|
123
123
|
export { isBrowser } from './predicate/isBrowser.mjs';
|
|
124
124
|
export { isBuffer } from './predicate/isBuffer.mjs';
|
|
125
125
|
export { isDate } from './predicate/isDate.mjs';
|
|
126
|
+
export { isEmptyObject } from './predicate/isEmptyObject.mjs';
|
|
126
127
|
export { isEqual } from './predicate/isEqual.mjs';
|
|
127
128
|
export { isEqualWith } from './predicate/isEqualWith.mjs';
|
|
128
129
|
export { isError } from './predicate/isError.mjs';
|
|
@@ -4,6 +4,7 @@ export { isBoolean } from './isBoolean.mjs';
|
|
|
4
4
|
export { isBrowser } from './isBrowser.mjs';
|
|
5
5
|
export { isBuffer } from './isBuffer.mjs';
|
|
6
6
|
export { isDate } from './isDate.mjs';
|
|
7
|
+
export { isEmptyObject } from './isEmptyObject.mjs';
|
|
7
8
|
export { isEqual } from './isEqual.mjs';
|
|
8
9
|
export { isEqualWith } from './isEqualWith.mjs';
|
|
9
10
|
export { isError } from './isError.mjs';
|
|
@@ -4,6 +4,7 @@ export { isBoolean } from './isBoolean.js';
|
|
|
4
4
|
export { isBrowser } from './isBrowser.js';
|
|
5
5
|
export { isBuffer } from './isBuffer.js';
|
|
6
6
|
export { isDate } from './isDate.js';
|
|
7
|
+
export { isEmptyObject } from './isEmptyObject.js';
|
|
7
8
|
export { isEqual } from './isEqual.js';
|
|
8
9
|
export { isEqualWith } from './isEqualWith.js';
|
|
9
10
|
export { isError } from './isError.js';
|
package/dist/predicate/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const isBoolean = require('./isBoolean.js');
|
|
|
8
8
|
const isBrowser = require('./isBrowser.js');
|
|
9
9
|
const isBuffer = require('./isBuffer.js');
|
|
10
10
|
const isDate = require('./isDate.js');
|
|
11
|
+
const isEmptyObject = require('./isEmptyObject.js');
|
|
11
12
|
const isEqual = require('./isEqual.js');
|
|
12
13
|
const isEqualWith = require('./isEqualWith.js');
|
|
13
14
|
const isError = require('./isError.js');
|
|
@@ -42,6 +43,7 @@ exports.isBoolean = isBoolean.isBoolean;
|
|
|
42
43
|
exports.isBrowser = isBrowser.isBrowser;
|
|
43
44
|
exports.isBuffer = isBuffer.isBuffer;
|
|
44
45
|
exports.isDate = isDate.isDate;
|
|
46
|
+
exports.isEmptyObject = isEmptyObject.isEmptyObject;
|
|
45
47
|
exports.isEqual = isEqual.isEqual;
|
|
46
48
|
exports.isEqualWith = isEqualWith.isEqualWith;
|
|
47
49
|
exports.isError = isError.isError;
|
package/dist/predicate/index.mjs
CHANGED
|
@@ -4,6 +4,7 @@ export { isBoolean } from './isBoolean.mjs';
|
|
|
4
4
|
export { isBrowser } from './isBrowser.mjs';
|
|
5
5
|
export { isBuffer } from './isBuffer.mjs';
|
|
6
6
|
export { isDate } from './isDate.mjs';
|
|
7
|
+
export { isEmptyObject } from './isEmptyObject.mjs';
|
|
7
8
|
export { isEqual } from './isEqual.mjs';
|
|
8
9
|
export { isEqualWith } from './isEqualWith.mjs';
|
|
9
10
|
export { isError } from './isError.mjs';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a value is an empty plain object.
|
|
3
|
+
*
|
|
4
|
+
* @param {unknown} value - The value to check.
|
|
5
|
+
* @returns {value is Record<PropertyKey, never>} - True if the value is an empty plain object, otherwise false.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* isEmptyObject({}); // true
|
|
9
|
+
* isEmptyObject({ a: 1 }); // false
|
|
10
|
+
* isEmptyObject([]); // false
|
|
11
|
+
* isEmptyObject(null); // false
|
|
12
|
+
*/
|
|
13
|
+
declare function isEmptyObject(value: unknown): value is Record<PropertyKey, never>;
|
|
14
|
+
|
|
15
|
+
export { isEmptyObject };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a value is an empty plain object.
|
|
3
|
+
*
|
|
4
|
+
* @param {unknown} value - The value to check.
|
|
5
|
+
* @returns {value is Record<PropertyKey, never>} - True if the value is an empty plain object, otherwise false.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* isEmptyObject({}); // true
|
|
9
|
+
* isEmptyObject({ a: 1 }); // false
|
|
10
|
+
* isEmptyObject([]); // false
|
|
11
|
+
* isEmptyObject(null); // false
|
|
12
|
+
*/
|
|
13
|
+
declare function isEmptyObject(value: unknown): value is Record<PropertyKey, never>;
|
|
14
|
+
|
|
15
|
+
export { isEmptyObject };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const isPlainObject = require('./isPlainObject.js');
|
|
6
|
+
|
|
7
|
+
function isEmptyObject(value) {
|
|
8
|
+
return isPlainObject.isPlainObject(value) && Object.keys(value).length === 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.isEmptyObject = isEmptyObject;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
|
-
"version": "1.43.0-dev.
|
|
3
|
+
"version": "1.43.0-dev.1719+50339c32",
|
|
4
4
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
5
5
|
"homepage": "https://es-toolkit.dev",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|