We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45aa272 commit 3008dc5Copy full SHA for 3008dc5
src/utils/object.ts
@@ -2,7 +2,7 @@ export type Entries<T> = { [K in keyof T]: [K, T[K]] }[keyof T][];
2
3
export const isObject = (obj: any): obj is Object => !!obj && typeof obj === 'object' && obj.constructor === Object;
4
5
-export const findDeep = <T>(obj: T, cb: (obj: T) => boolean): T[] => {
+export const findDeep = <T extends Record<string, any>>(obj: T, cb: (obj: T) => boolean): T[] => {
6
const keys = (Object.keys(obj) as (keyof typeof obj)[]) || [];
7
8
let result: T[] = [];
0 commit comments