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) => {
|
||||
if (!contributor.accounts) { return false; }
|
||||
return contributor.accounts.find((account) => {
|
||||
return searchEntries.reduce((accumulator, searchValue) => {
|
||||
return accumulator && account[searchValue[0]] === searchValue[1];
|
||||
}, true);
|
||||
return searchEntries.every((item) => {
|
||||
let [ key, value ] = item;
|
||||
return account[key] === value;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user