Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 13, 2022
1 parent dc3d7bc commit 75d08bc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/config/normalize/lib/wild_wild_path/iterate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const iterate = function (
const entries = paths.map((path) => ({
path,
value: target,
props: [],
simplePath: [],
missing: false,
}))
const entriesA = iterateLevel(entries, childFirst, 0)
Expand Down Expand Up @@ -57,15 +57,15 @@ const isNotDuplicate = function (entryA, index, entries) {
}

const isDuplicate = function (
{ props: propsA, path: pathA },
{ props: propsB, path: pathB },
{ simplePath: simplePathA, path: pathA },
{ simplePath: simplePathB, path: pathB },
) {
return (
equalsSimple(propsA, propsB) &&
equalsSimple(simplePathA, simplePathB) &&
pathA.length === pathB.length &&
pathA.every(
(tokenA, index) =>
index < propsA.length || isSameToken(tokenA, pathB[index]),
index < simplePathA.length || isSameToken(tokenA, pathB[index]),
)
)
}
Expand All @@ -75,7 +75,7 @@ const isDuplicate = function (
// However, iteration is guaranteed to return child entries before parent ones.
// - This is useful for recursive logic which must often be applied in a
// specific parent-child order
const iteratePath = function ({ path, value, props }, index) {
const iteratePath = function ({ path, value, simplePath }, index) {
const token = path[index]
const {
tokenType,
Expand All @@ -87,7 +87,7 @@ const iteratePath = function ({ path, value, props }, index) {
({ value: childValue, prop, missing: missingEntry }) => ({
path,
value: childValue,
props: [...props, prop],
simplePath: [...simplePath, prop],
missing: missingParent || missingEntry,
}),
)
Expand Down Expand Up @@ -120,11 +120,11 @@ const iterateChildren = function (levelEntries, childFirst, index) {
)
}

const getLastProp = function ({ props }) {
return props[props.length - 1]
const getLastProp = function ({ simplePath }) {
return simplePath[simplePath.length - 1]
}

const normalizeEntry = function ({ value, props: path, missing }) {
const normalizeEntry = function ({ value, simplePath: path, missing }) {
const query = serialize(path)
return { value, path, query, missing }
}

0 comments on commit 75d08bc

Please sign in to comment.