1
0

feat: always use index for buckets

This commit is contained in:
Dominik Pschenitschni
2021-09-07 15:42:41 +02:00
parent 672d63fbed
commit 8d88b3792d
4 changed files with 94 additions and 54 deletions

View File

@ -1,10 +0,0 @@
export const filterObject = (obj, fn) => {
let key
for (key in obj) {
if (fn(obj[key])) {
return key
}
}
return null
}

View File

@ -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)
}