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 e451ead commit 24538bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/config/normalize/lib/wild_wild_path/iterate/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ const iterateLevel = function* ({
}

parents.add(value)
yield* iterateToken({ entries, index, parents, opts })
parents.delete(value)
}

const iterateToken = function* ({ entries, index, parents, opts }) {
const entriesA = expandRecursiveTokens(entries, index)
const entriesB = removeDuplicates(entriesA)
const parentEntry = getParentEntry(entriesB, index)
Expand All @@ -61,8 +65,6 @@ const iterateLevel = function* ({
if (parentEntry !== undefined && opts.childFirst) {
yield parentEntry
}

parents.delete(value)
}

const getParentEntry = function (entries, index) {
Expand Down

0 comments on commit 24538bb

Please sign in to comment.