From b2978d4369b07937735898be5e66ad8e5edaf2b8 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Sun, 29 May 2022 19:50:45 +0200 Subject: [PATCH] Simplify code --- src/config/normalize/main.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/config/normalize/main.js b/src/config/normalize/main.js index dddb88f2..517dc4b6 100644 --- a/src/config/normalize/main.js +++ b/src/config/normalize/main.js @@ -5,19 +5,15 @@ import { normalizeInputs } from './lib/main.js' // Normalize the configuration properties, including default values and // validation. -export const normalizeConfig = async function ( - config, - rules, - { UserErrorType = UserError, all = {}, ...opts }, -) { +export const normalizeConfig = async function (config, rules, opts) { const { inputs, error } = await normalizeInputs(config, rules, { ...opts, - all: { ...all, prefix: PREFIX }, + all: { ...opts.all, prefix: PREFIX }, soft: true, }) if (error) { - throw wrapError(error, '', UserErrorType) + throw wrapError(error, '', UserError) } return inputs