es-toolkit 1.18.0-dev.593 → 1.18.0-dev.595
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/_chunk/{isWeakSet-Dob5v4.js → isWeakSet-Cg7dfc.js} +1 -0
- package/dist/array/forEachRight.d.mts +23 -0
- package/dist/array/forEachRight.d.ts +23 -0
- package/dist/array/orderBy.d.mts +1 -1
- package/dist/array/orderBy.d.ts +1 -1
- package/dist/array/sortBy.d.mts +1 -1
- package/dist/array/sortBy.d.ts +1 -1
- package/dist/array/unzip.d.mts +1 -1
- package/dist/array/unzip.d.ts +1 -1
- package/dist/array/zipObject.d.mts +1 -1
- package/dist/array/zipObject.d.ts +1 -1
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/array/flatten.d.mts +1 -1
- package/dist/compat/array/flatten.d.ts +1 -1
- package/dist/compat/array/flattenDepth.d.mts +1 -1
- package/dist/compat/array/flattenDepth.d.ts +1 -1
- package/dist/compat/array/orderBy.d.mts +1 -1
- package/dist/compat/array/orderBy.d.ts +1 -1
- package/dist/compat/array/size.d.mts +1 -1
- package/dist/compat/array/size.d.ts +1 -1
- package/dist/compat/array/sortBy.d.mts +1 -1
- package/dist/compat/array/sortBy.d.ts +1 -1
- package/dist/compat/array/zipObjectDeep.d.mts +1 -1
- package/dist/compat/array/zipObjectDeep.d.ts +1 -1
- package/dist/compat/index.js +57 -49
- package/dist/compat/object/fromPairs.d.mts +2 -2
- package/dist/compat/object/fromPairs.d.ts +2 -2
- package/dist/compat/object/get.d.mts +12 -12
- package/dist/compat/object/get.d.ts +12 -12
- package/dist/compat/object/mergeWith.mjs +14 -2
- package/dist/compat/object/pick.d.mts +2 -2
- package/dist/compat/object/pick.d.ts +2 -2
- package/dist/compat/predicate/isMatch.mjs +44 -4
- package/dist/index.js +1 -1
- package/dist/object/pick.d.mts +1 -1
- package/dist/object/pick.d.ts +1 -1
- package/dist/predicate/index.js +1 -1
- package/package.json +1 -1
- package/dist/compat/_internal/isArrayMatch.mjs +0 -24
- package/dist/compat/_internal/isMapMatch.mjs +0 -18
- package/dist/compat/_internal/isSetMatch.mjs +0 -13
package/dist/object/pick.d.ts
CHANGED
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
* const result = pick(obj, ['a', 'c']);
|
|
16
16
|
* // result will be { a: 1, c: 3 }
|
|
17
17
|
*/
|
|
18
|
-
declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
18
|
+
declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: readonly K[]): Pick<T, K>;
|
|
19
19
|
|
|
20
20
|
export { pick };
|
package/dist/predicate/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const isWeakSet = require('../_chunk/isWeakSet-
|
|
5
|
+
const isWeakSet = require('../_chunk/isWeakSet-Cg7dfc.js');
|
|
6
6
|
const isPlainObject = require('../_chunk/isPlainObject-BIekvL.js');
|
|
7
7
|
|
|
8
8
|
function isRegExp(value) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
3
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
4
|
-
"version": "1.18.0-dev.
|
|
4
|
+
"version": "1.18.0-dev.595+b870fa36",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { isMatch } from '../predicate/isMatch.mjs';
|
|
2
|
-
|
|
3
|
-
function isArrayMatch(target, source) {
|
|
4
|
-
if (source.length === 0) {
|
|
5
|
-
return true;
|
|
6
|
-
}
|
|
7
|
-
if (!Array.isArray(target)) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
const countedIndex = new Set();
|
|
11
|
-
for (let i = 0; i < source.length; i++) {
|
|
12
|
-
const sourceItem = source[i];
|
|
13
|
-
const index = target.findIndex((targetItem, index) => {
|
|
14
|
-
return isMatch(targetItem, sourceItem) && !countedIndex.has(index);
|
|
15
|
-
});
|
|
16
|
-
if (index === -1) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
countedIndex.add(index);
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { isArrayMatch };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { isMatch } from '../predicate/isMatch.mjs';
|
|
2
|
-
|
|
3
|
-
function isMapMatch(target, source) {
|
|
4
|
-
if (source.size === 0) {
|
|
5
|
-
return true;
|
|
6
|
-
}
|
|
7
|
-
if (!(target instanceof Map)) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
for (const [key, value] of source.entries()) {
|
|
11
|
-
if (!isMatch(target.get(key), value)) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { isMapMatch };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { isArrayMatch } from './isArrayMatch.mjs';
|
|
2
|
-
|
|
3
|
-
function isSetMatch(target, source) {
|
|
4
|
-
if (source.size === 0) {
|
|
5
|
-
return true;
|
|
6
|
-
}
|
|
7
|
-
if (!(target instanceof Set)) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
return isArrayMatch([...target], [...source]);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { isSetMatch };
|