diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 73aaa2358..f05af6f36 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -239,9 +239,9 @@ const conversation = { depth, }, walk(forest, forest[id], depth + 1, processed), - ].reduce((a, b) => a.concat(b), []) + ].flat() }) - .reduce((a, b) => a.concat(b), []) + .flat() const linearized = walk( threads.forest, diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index ac9952b9b..a0e30bf6d 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -408,7 +408,7 @@ const EmojiPicker = { isFirstRow: index === 0, })), ) - .reduce((a, c) => a.concat(c), []) + .flat() }, languages() { return ensureFinalFallback( diff --git a/src/services/theme_data/iss_utils.js b/src/services/theme_data/iss_utils.js index 67579a118..d42da3780 100644 --- a/src/services/theme_data/iss_utils.js +++ b/src/services/theme_data/iss_utils.js @@ -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() } /** diff --git a/src/services/theme_data/theme2_to_theme3.js b/src/services/theme_data/theme2_to_theme3.js index 9ea319175..96955edfd 100644 --- a/src/services/theme_data/theme2_to_theme3.js +++ b/src/services/theme_data/theme2_to_theme3.js @@ -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(), diff --git a/src/services/theme_data/theme_data_3.service.js b/src/services/theme_data/theme_data_3.service.js index 507b384db..465062225 100644 --- a/src/services/theme_data/theme_data_3.service.js +++ b/src/services/theme_data/theme_data_3.service.js @@ -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 diff --git a/src/stores/emoji.js b/src/stores/emoji.js index 2d77954f1..8135a483e 100644 --- a/src/stores/emoji.js +++ b/src/stores/emoji.js @@ -120,23 +120,19 @@ export const useEmojiStore = defineStore('emoji', { }, {}) }, standardEmojiList(state) { - return ( - SORTED_EMOJI_GROUP_IDS.map((groupId) => - (this.emoji[groupId] || []).map((k) => - injectAnnotations(k, this.unicodeEmojiAnnotations), - ), - ).reduce((a, b) => a.concat(b), []) ?? [] - ) + return SORTED_EMOJI_GROUP_IDS.map((groupId) => + (this.emoji[groupId] || []).map((k) => + injectAnnotations(k, this.unicodeEmojiAnnotations), + ), + ).flat() }, standardEmojiGroupList(state) { - return ( - SORTED_EMOJI_GROUP_IDS.map((groupId) => ({ - id: groupId, - emojis: (this.emoji[groupId] || []).map((k) => - injectAnnotations(k, this.unicodeEmojiAnnotations), - ), - })) ?? [] - ) + return SORTED_EMOJI_GROUP_IDS.map((groupId) => ({ + id: groupId, + emojis: (this.emoji[groupId] || []).map((k) => + injectAnnotations(k, this.unicodeEmojiAnnotations), + ), + })) }, }, actions: {