Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 16, 2022
1 parent 351fa75 commit 284fd00
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/config/normalize/prop_path/entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ const getMissingArrayEntries = function ({
isStrict,
missing,
}) {
if (isStrict) {
if (isAny || key === 0) {
return [{ value, path: [...path, { key: 0, missing }] }]
}
if (!isStrict) {
return []
}

return [{ value: undefined, path: [...path, { key, missing }] }]
if (isAny || key === 0) {
return [{ value, path: [...path, { key: 0, missing }] }]
}

return []
return [{ value: undefined, path: [...path, { key, missing }] }]
}

const getNormalArrayEntries = function ({ value, path, key, isAny, missing }) {
Expand Down Expand Up @@ -73,11 +73,11 @@ const getMissingObjectEntries = function ({
isStrict,
missing,
}) {
if (isStrict && !isAny) {
return [{ value: undefined, path: [...path, { key, missing }] }]
if (!isStrict || isAny) {
return []
}

return []
return [{ value: undefined, path: [...path, { key, missing }] }]
}

const getNormalObjectEntries = function ({ value, path, key, isAny, missing }) {
Expand Down

0 comments on commit 284fd00

Please sign in to comment.