Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 13, 2022
1 parent e9edefa commit aea41e4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/config/normalize/lib/wild_wild_path_utils/include.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ export const pick = function (target, queryOrPaths) {
newTarget: {},
queryOrPaths,
setFunc: pickEntry,
condition: returnTrue,
})
}

const pickEntry = function (target, { path, value }) {
return set(target, path, value)
}

const returnTrue = function () {
return true
}

// Remove values matching a query
export const include = function (target, queryOrPaths, condition) {
return reduceParents({
Expand Down Expand Up @@ -53,7 +58,7 @@ const reduceParents = function ({
newTarget,
queryOrPaths,
setFunc,
condition = returnTrue,
condition,
}) {
const paths = []

Expand All @@ -71,10 +76,6 @@ const reduceParents = function ({
return newTarget
}

const returnTrue = function () {
return true
}

const shouldUseEntry = function ({ entry, paths, newTarget, condition }) {
return (
!entry.missing &&
Expand Down

0 comments on commit aea41e4

Please sign in to comment.