Use more readable Array.every method instead of reduce
This commit is contained in:
parent
fe1fa2e881
commit
017073018f
@ -49,9 +49,10 @@ class Contributor extends Base {
|
|||||||
return contributors[method]((contributor) => {
|
return contributors[method]((contributor) => {
|
||||||
if (!contributor.accounts) { return false; }
|
if (!contributor.accounts) { return false; }
|
||||||
return contributor.accounts.find((account) => {
|
return contributor.accounts.find((account) => {
|
||||||
return searchEntries.reduce((accumulator, searchValue) => {
|
return searchEntries.every((item) => {
|
||||||
return accumulator && account[searchValue[0]] === searchValue[1];
|
let [ key, value ] = item;
|
||||||
}, true);
|
return account[key] === value;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user