From 6a24123d7684874cd2087adfef64da417fe93a4a Mon Sep 17 00:00:00 2001 From: Mario Lubenka Date: Sun, 18 Jul 2021 21:39:30 +0200 Subject: [PATCH] chore: rename variable to resolve variable shadowing --- src/verify.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/verify.ts b/src/verify.ts index e065d51..c72a707 100644 --- a/src/verify.ts +++ b/src/verify.ts @@ -14,7 +14,7 @@ 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})] @@ -22,7 +22,7 @@ export function verify(pluginConfig) { [] ); - if (errors.length > 0) { - throw new AggregateError(errors); + if (reducedErrors.length > 0) { + throw new AggregateError(reducedErrors); } -} \ No newline at end of file +}