Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jun 5, 2022
1 parent 4ce5967 commit a8c6e38
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/config/normalize/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,7 @@ const applyRule = async function ({
keywords,
sync,
}) {
const entries = list(inputs, rule.name, {
childFirst: true,
sort: true,
missing: true,
entries: true,
})
const entries = list(inputs, rule.name, LIST_OPTS)

// eslint-disable-next-line fp/no-loops
for (const { value: input, path } of entries) {
Expand All @@ -117,6 +112,8 @@ const applyRule = async function ({
}
}

const LIST_OPTS = { childFirst: true, sort: true, missing: true, entries: true }

// When in `sort` mode, input errors are returned instead of being thrown.
// Other errors are always propagated.
const handleError = function (error, soft) {
Expand Down

0 comments on commit a8c6e38

Please sign in to comment.