From 22be382ea16604761bbe665b52634fcdb06c37d1 Mon Sep 17 00:00:00 2001 From: Jeldrik Hanschke Date: Fri, 13 Jan 2023 21:57:05 +0100 Subject: [PATCH] use Array.flat() instead of complex workaround --- addon/modifiers/style.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/addon/modifiers/style.js b/addon/modifiers/style.js index 2b7a7002..578c0f7c 100644 --- a/addon/modifiers/style.js +++ b/addon/modifiers/style.js @@ -22,12 +22,9 @@ export default class StyleModifier extends Modifier { * This data structure is slightly faster to process than an object / dictionary. */ getStyles(positional, named) { - // This is a workaround for the missing `Array#flat` in IE11. - return [].concat( - ...[...positional.filter(isObject), named].map((obj) => - Object.entries(obj).map(([k, v]) => [dasherize(k), v]) - ) - ); + return [...positional.filter(isObject), named] + .map((obj) => Object.entries(obj).map(([k, v]) => [dasherize(k), v])) + .flat(); } setStyles(element, newStyles) {