Skip to content

Commit

Permalink
chore: rename variable to resolve variable shadowing
Browse files Browse the repository at this point in the history
  • Loading branch information
saitho committed Jul 18, 2021
1 parent 87186d4 commit 6a24123
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export function verify(pluginConfig) {
};

const options = resolveConfig(pluginConfig);
const errors = Object.entries(options).reduce(
const reducedErrors = Object.entries(options).reduce(
(errors, [option, value]) =>
!isNil(value) && VALIDATORS.hasOwnProperty(option) && !VALIDATORS[option](value)
? [...errors, getError(`EINVALID${option.toUpperCase()}`, {[option]: value})]
: errors,
[]
);

if (errors.length > 0) {
throw new AggregateError(errors);
if (reducedErrors.length > 0) {
throw new AggregateError(reducedErrors);
}
}
}

0 comments on commit 6a24123

Please sign in to comment.