flat
This commit is contained in:
parent
03ef01672e
commit
b8a0f540a3
6 changed files with 20 additions and 24 deletions
|
|
@ -24,7 +24,7 @@ export const getAllPossibleCombinations = (array) => {
|
|||
const nonSelf = array.filter((x) => !selfSet.has(x))
|
||||
return nonSelf.map((x) => [...self, x])
|
||||
})
|
||||
const flatCombos = newCombos.reduce((acc, x) => [...acc, ...x], [])
|
||||
const flatCombos = newCombos.flat()
|
||||
const uniqueComboStrings = new Set()
|
||||
const uniqueCombos = flatCombos.map(sortBy).filter((x) => {
|
||||
if (uniqueComboStrings.has(x.join())) {
|
||||
|
|
@ -36,7 +36,7 @@ export const getAllPossibleCombinations = (array) => {
|
|||
})
|
||||
combos.push(uniqueCombos)
|
||||
}
|
||||
return combos.reduce((acc, x) => [...acc, ...x], [])
|
||||
return combos.flat()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -559,9 +559,9 @@ export const convertTheme2To3 = (data) => {
|
|||
|
||||
const flatExtRules = extendedRules
|
||||
.filter(Boolean)
|
||||
.reduce((acc, x) => [...acc, ...x], [])
|
||||
.flat()
|
||||
.filter(Boolean)
|
||||
.reduce((acc, x) => [...acc, ...x], [])
|
||||
.flat()
|
||||
|
||||
return [
|
||||
generateRoot(),
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ export const init = ({
|
|||
...r,
|
||||
})),
|
||||
)
|
||||
.reduce((acc, arr) => [...acc, ...arr], []),
|
||||
.flat()
|
||||
...inputRuleset,
|
||||
].map((rule) => {
|
||||
normalizeCombination(rule)
|
||||
|
|
@ -705,7 +705,7 @@ export const init = ({
|
|||
.map((variant) => {
|
||||
return stateCombinations.map((state) => ({ variant, state }))
|
||||
})
|
||||
.reduce((acc, x) => [...acc, ...x], [])
|
||||
.flat()
|
||||
|
||||
stateVariantCombination.forEach((combination) => {
|
||||
combination.component = component.name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue