Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Dec 26, 2021
1 parent 1caadb0 commit 0181641
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/system/footer/shared_2.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,13 @@ const reduceOneOnePropDimensions = function (
isReducibleSystem({ system, allDimensionsB, index, dimensionName }),
)

if (matching.length !== allDimensionsB.length) {
return allDimensionsB
}

return [
...allDimensionsB.slice(0, index),
omit.default(allDimensionsB[index], [dimensionName]),
...allDimensionsB.slice(index + 1),
]
return matching.length === allDimensionsB.length
? [
...allDimensionsB.slice(0, index),
omit.default(allDimensionsB[index], [dimensionName]),
...allDimensionsB.slice(index + 1),
]
: allDimensionsB
}

const isReducibleSystem = function ({
Expand Down

0 comments on commit 0181641

Please sign in to comment.