Skip to content

Commit

Permalink
Add roots to include.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 13, 2022
1 parent 075ad08 commit 04e8fff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/config/normalize/lib/wild_wild_path_utils/include.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const reduceParents = function (
) {
const entries = list(target, query, {
childFirst: false,
roots: false,
sort,
missing: false,
classes,
Expand All @@ -83,7 +84,8 @@ const reduceParents = function (
.reduce((newTargetA, entry) => setFunc(newTargetA, entry, 0), newTarget)
}

// If both a parent and a child property are set, the parent prevails
// This is like the `roots` option. However, we cannot use that option since we
// need to apply `condition()` first.
const hasNoParentSet = function ({ path: pathA }, indexA, entries) {
return entries.every(
(entryB, indexB) => indexA <= indexB || !isParentPath(entryB.path, pathA),
Expand Down

0 comments on commit 04e8fff

Please sign in to comment.