Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 29, 2022
1 parent d05ca85 commit b2978d4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/config/normalize/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2978d4

Please sign in to comment.