flat
This commit is contained in:
parent
03ef01672e
commit
b8a0f540a3
6 changed files with 20 additions and 24 deletions
|
|
@ -239,9 +239,9 @@ const conversation = {
|
||||||
depth,
|
depth,
|
||||||
},
|
},
|
||||||
walk(forest, forest[id], depth + 1, processed),
|
walk(forest, forest[id], depth + 1, processed),
|
||||||
].reduce((a, b) => a.concat(b), [])
|
].flat()
|
||||||
})
|
})
|
||||||
.reduce((a, b) => a.concat(b), [])
|
.flat()
|
||||||
|
|
||||||
const linearized = walk(
|
const linearized = walk(
|
||||||
threads.forest,
|
threads.forest,
|
||||||
|
|
|
||||||
|
|
@ -408,7 +408,7 @@ const EmojiPicker = {
|
||||||
isFirstRow: index === 0,
|
isFirstRow: index === 0,
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
.reduce((a, c) => a.concat(c), [])
|
.flat()
|
||||||
},
|
},
|
||||||
languages() {
|
languages() {
|
||||||
return ensureFinalFallback(
|
return ensureFinalFallback(
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ export const getAllPossibleCombinations = (array) => {
|
||||||
const nonSelf = array.filter((x) => !selfSet.has(x))
|
const nonSelf = array.filter((x) => !selfSet.has(x))
|
||||||
return nonSelf.map((x) => [...self, x])
|
return nonSelf.map((x) => [...self, x])
|
||||||
})
|
})
|
||||||
const flatCombos = newCombos.reduce((acc, x) => [...acc, ...x], [])
|
const flatCombos = newCombos.flat()
|
||||||
const uniqueComboStrings = new Set()
|
const uniqueComboStrings = new Set()
|
||||||
const uniqueCombos = flatCombos.map(sortBy).filter((x) => {
|
const uniqueCombos = flatCombos.map(sortBy).filter((x) => {
|
||||||
if (uniqueComboStrings.has(x.join())) {
|
if (uniqueComboStrings.has(x.join())) {
|
||||||
|
|
@ -36,7 +36,7 @@ export const getAllPossibleCombinations = (array) => {
|
||||||
})
|
})
|
||||||
combos.push(uniqueCombos)
|
combos.push(uniqueCombos)
|
||||||
}
|
}
|
||||||
return combos.reduce((acc, x) => [...acc, ...x], [])
|
return combos.flat()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -559,9 +559,9 @@ export const convertTheme2To3 = (data) => {
|
||||||
|
|
||||||
const flatExtRules = extendedRules
|
const flatExtRules = extendedRules
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.reduce((acc, x) => [...acc, ...x], [])
|
.flat()
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.reduce((acc, x) => [...acc, ...x], [])
|
.flat()
|
||||||
|
|
||||||
return [
|
return [
|
||||||
generateRoot(),
|
generateRoot(),
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ export const init = ({
|
||||||
...r,
|
...r,
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
.reduce((acc, arr) => [...acc, ...arr], []),
|
.flat()
|
||||||
...inputRuleset,
|
...inputRuleset,
|
||||||
].map((rule) => {
|
].map((rule) => {
|
||||||
normalizeCombination(rule)
|
normalizeCombination(rule)
|
||||||
|
|
@ -705,7 +705,7 @@ export const init = ({
|
||||||
.map((variant) => {
|
.map((variant) => {
|
||||||
return stateCombinations.map((state) => ({ variant, state }))
|
return stateCombinations.map((state) => ({ variant, state }))
|
||||||
})
|
})
|
||||||
.reduce((acc, x) => [...acc, ...x], [])
|
.flat()
|
||||||
|
|
||||||
stateVariantCombination.forEach((combination) => {
|
stateVariantCombination.forEach((combination) => {
|
||||||
combination.component = component.name
|
combination.component = component.name
|
||||||
|
|
|
||||||
|
|
@ -120,23 +120,19 @@ export const useEmojiStore = defineStore('emoji', {
|
||||||
}, {})
|
}, {})
|
||||||
},
|
},
|
||||||
standardEmojiList(state) {
|
standardEmojiList(state) {
|
||||||
return (
|
return SORTED_EMOJI_GROUP_IDS.map((groupId) =>
|
||||||
SORTED_EMOJI_GROUP_IDS.map((groupId) =>
|
(this.emoji[groupId] || []).map((k) =>
|
||||||
(this.emoji[groupId] || []).map((k) =>
|
injectAnnotations(k, this.unicodeEmojiAnnotations),
|
||||||
injectAnnotations(k, this.unicodeEmojiAnnotations),
|
),
|
||||||
),
|
).flat()
|
||||||
).reduce((a, b) => a.concat(b), []) ?? []
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
standardEmojiGroupList(state) {
|
standardEmojiGroupList(state) {
|
||||||
return (
|
return SORTED_EMOJI_GROUP_IDS.map((groupId) => ({
|
||||||
SORTED_EMOJI_GROUP_IDS.map((groupId) => ({
|
id: groupId,
|
||||||
id: groupId,
|
emojis: (this.emoji[groupId] || []).map((k) =>
|
||||||
emojis: (this.emoji[groupId] || []).map((k) =>
|
injectAnnotations(k, this.unicodeEmojiAnnotations),
|
||||||
injectAnnotations(k, this.unicodeEmojiAnnotations),
|
),
|
||||||
),
|
}))
|
||||||
})) ?? []
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue