mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 06:38:07 +02:00
Enable the no-array-reduce
ESLint plugin rule
Please see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md Note that this still allows "simple" usage of `Array.prototype.reduce`, however most of those cases will be possible to replace with `Math.sumPrecise` once that becomes generally available (currently not supported in Node.js or QuickJS).
This commit is contained in:
parent
85e6f3c92b
commit
38d01250f4
2 changed files with 2 additions and 4 deletions
|
@ -76,10 +76,7 @@ function pad(s, length, dir /* default: 'right' */) {
|
|||
}
|
||||
|
||||
function mean(array) {
|
||||
function add(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
return array.reduce(add, 0) / array.length;
|
||||
return array.reduce((a, b) => a + b, 0) / array.length;
|
||||
}
|
||||
|
||||
/* Comparator for row key sorting. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue