@8ms/helpers 2.4.0 → 2.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/lodash/index.d.mts +11 -1
- package/dist/lodash/index.mjs +17 -1
- package/package.json +2 -2
package/dist/lodash/index.d.mts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
//#region src/lodash/chunk.d.ts
|
|
2
2
|
declare const chunk: <T>(array: T[], size: number) => T[][];
|
|
3
3
|
//#endregion
|
|
4
|
+
//#region src/lodash/findKey.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Finds the first key in an object that satisfies the provided predicate function.
|
|
7
|
+
*
|
|
8
|
+
* @param object - The object to inspect.
|
|
9
|
+
* @param predicate - The function invoked per iteration (value, key, object).
|
|
10
|
+
* @returns The key of the matched element, else undefined.
|
|
11
|
+
*/
|
|
12
|
+
declare const findKey: <T extends object>(object: T, predicate: (value: T[keyof T], key: string, object: T) => boolean) => string | undefined;
|
|
13
|
+
//#endregion
|
|
4
14
|
//#region src/lodash/flatten.d.ts
|
|
5
15
|
declare const flatten: <T>(array: T[][]) => T[];
|
|
6
16
|
//#endregion
|
|
@@ -42,4 +52,4 @@ declare const uniq: (arr: any[]) => any[];
|
|
|
42
52
|
//#region src/lodash/uniqBy.d.ts
|
|
43
53
|
declare const uniqBy: <T>(collection: T[], iteratee: ((item: T) => unknown) | string) => T[];
|
|
44
54
|
//#endregion
|
|
45
|
-
export { chunk, flatten, isDate, isEmpty, isEqual, isFunction, isObject, merge, orderBy, set, trim, unescape, uniq, uniqBy };
|
|
55
|
+
export { chunk, findKey, flatten, isDate, isEmpty, isEqual, isFunction, isObject, merge, orderBy, set, trim, unescape, uniq, uniqBy };
|
package/dist/lodash/index.mjs
CHANGED
|
@@ -5,6 +5,22 @@ const chunk = (array, size) => {
|
|
|
5
5
|
return result;
|
|
6
6
|
};
|
|
7
7
|
//#endregion
|
|
8
|
+
//#region src/lodash/findKey.ts
|
|
9
|
+
/**
|
|
10
|
+
* Finds the first key in an object that satisfies the provided predicate function.
|
|
11
|
+
*
|
|
12
|
+
* @param object - The object to inspect.
|
|
13
|
+
* @param predicate - The function invoked per iteration (value, key, object).
|
|
14
|
+
* @returns The key of the matched element, else undefined.
|
|
15
|
+
*/
|
|
16
|
+
const findKey = (object, predicate) => {
|
|
17
|
+
if (object == null) return;
|
|
18
|
+
for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
19
|
+
const value = object[key];
|
|
20
|
+
if (predicate(value, key, object)) return key;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
8
24
|
//#region src/lodash/flatten.ts
|
|
9
25
|
const flatten = (array) => [].concat(...array);
|
|
10
26
|
//#endregion
|
|
@@ -160,4 +176,4 @@ const uniqBy = (collection, iteratee) => {
|
|
|
160
176
|
});
|
|
161
177
|
};
|
|
162
178
|
//#endregion
|
|
163
|
-
export { chunk, flatten, isDate, isEmpty, isEqual, isFunction, isObject, merge, orderBy, set, trim, unescape, uniq, uniqBy };
|
|
179
|
+
export { chunk, findKey, flatten, isDate, isEmpty, isEqual, isFunction, isObject, merge, orderBy, set, trim, unescape, uniq, uniqBy };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@8ms/helpers",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"node": "24"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
+
"fs-extra": "^11.0.0",
|
|
19
20
|
"ky": "^2.0.0",
|
|
20
21
|
"luxon": "^3.7.2",
|
|
21
22
|
"zod": "^4.3.6"
|
|
@@ -44,7 +45,6 @@
|
|
|
44
45
|
"@prisma/adapter-planetscale": "^7.0.0",
|
|
45
46
|
"@prisma/client": "^7.0.0",
|
|
46
47
|
"drizzle-orm": "*",
|
|
47
|
-
"fs-extra": "^11.0.0",
|
|
48
48
|
"googleapis-common": "^8.0.0",
|
|
49
49
|
"next": "^16.0.0",
|
|
50
50
|
"react": "^19.0.0",
|