@8ms/helpers 2.3.10 → 2.3.11
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/.yarn/install-state.gz +0 -0
- package/dist/lodash/index.d.mts +4 -1
- package/dist/lodash/index.mjs +17 -1
- package/package.json +1 -1
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/dist/lodash/index.d.mts
CHANGED
|
@@ -30,4 +30,7 @@ declare const unescape: (str: string) => string;
|
|
|
30
30
|
//#region src/lodash/uniq.d.ts
|
|
31
31
|
declare const uniq: (arr: any[]) => any[];
|
|
32
32
|
//#endregion
|
|
33
|
-
|
|
33
|
+
//#region src/lodash/uniqBy.d.ts
|
|
34
|
+
declare const uniqBy: <T>(collection: T[], iteratee: ((item: T) => unknown) | string) => T[];
|
|
35
|
+
//#endregion
|
|
36
|
+
export { isDate, isEmpty, isEqual, isObject, merge, orderBy, set, trim, unescape, uniq, uniqBy };
|
package/dist/lodash/index.mjs
CHANGED
|
@@ -141,4 +141,20 @@ const unescape = (str) => {
|
|
|
141
141
|
const uniq = (arr) => [...new Set(arr)];
|
|
142
142
|
|
|
143
143
|
//#endregion
|
|
144
|
-
|
|
144
|
+
//#region src/lodash/uniqBy.ts
|
|
145
|
+
const uniqBy = (collection, iteratee) => {
|
|
146
|
+
const seen = /* @__PURE__ */ new Set();
|
|
147
|
+
const getValue = (item) => {
|
|
148
|
+
if (typeof iteratee === "function") return iteratee(item);
|
|
149
|
+
return iteratee.split(".").reduce((acc, part) => acc?.[part], item);
|
|
150
|
+
};
|
|
151
|
+
return collection.filter((item) => {
|
|
152
|
+
const key = getValue(item);
|
|
153
|
+
if (seen.has(key)) return false;
|
|
154
|
+
seen.add(key);
|
|
155
|
+
return true;
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
export { isDate, isEmpty, isEqual, isObject, merge, orderBy, set, trim, unescape, uniq, uniqBy };
|