feat: always use index for buckets
This commit is contained in:
@ -1,10 +0,0 @@
|
||||
export const filterObject = (obj, fn) => {
|
||||
let key
|
||||
|
||||
for (key in obj) {
|
||||
if (fn(obj[key])) {
|
||||
return key
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
@ -1,3 +1,7 @@
|
||||
export function findIndexById(array : [], id : string | number) {
|
||||
return array.findIndex(({id: currentId}) => currentId === id)
|
||||
}
|
||||
|
||||
export function findById(array : [], id : string | number) {
|
||||
return array.find(({id: currentId}) => currentId === id)
|
||||
}
|
Reference in New Issue
Block a user