Skip to content

Commit

Permalink
Use filter-obj
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 29, 2022
1 parent dc4fde5 commit 18b63c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/config/normalize/lib/normalize.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import filterObj from 'filter-obj'
import { normalizeQuery } from 'wild-wild-parser'

import { wrapError } from '../../../error/wrap.js'
Expand All @@ -15,11 +16,11 @@ const mergeRulesAll = function (rules, all) {
return rules
}

const allA = Object.fromEntries(Object.entries(all).filter(isDefined))
const allA = filterObj(all, isDefined)
return rules.map((rule) => ({ ...allA, ...rule }))
}

const isDefined = function ([, value]) {
const isDefined = function (key, value) {
return value !== undefined
}

Expand Down

0 comments on commit 18b63c7

Please sign in to comment.