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 67465b1 commit 2a98e21
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/system/footer/shared_2.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,15 @@ const getDimensionEntry = function ({ propName, propValue }) {
const isSameArray = function (arrayA, arrayB) {
return (
arrayA.length === arrayB.length &&
arrayA.every((valueA) =>
arrayB.some((valueB) => isDeepStrictEqual(valueA, valueB)),
)
arrayA.every((value) => hasArrayValue(arrayB, value))
)
}

// Like `Array.includes()` but using deep comparison
const hasArrayValue = function (array, valueA) {
return array.some((valueB) => isDeepStrictEqual(valueA, valueB))
}

const PROP_ORDER = ['aa', 'ff', 'bb', 'cc', 'dd', 'ee', 'gg', 'hh']

const getSystemTitle = function (allDimensions) {
Expand Down

0 comments on commit 2a98e21

Please sign in to comment.