{"ScriptPreparationCode":null,"TestCases":[{"Name":"Using reduce and the spread operator","Code":"const styles = {\r\n foo: {\r\n color: \u0027red\u0027,\r\n },\r\n bar: {\r\n color: \u0027green\u0027,\r\n \u0027\u0026:focus\u0027: {\r\n color: \u0027blue\u0027,\r\n },\r\n },\r\n};\r\n\r\nObject\r\n .keys(styles)\r\n .reduce((classes, selector) =\u003E ({\r\n ...classes,\r\n [selector]: selector,\r\n}), {});","IsDeferred":false},{"Name":"Using map and adding to an object","Code":"const styles = {\r\n foo: {\r\n color: \u0027red\u0027,\r\n },\r\n bar: {\r\n color: \u0027green\u0027,\r\n \u0027\u0026:focus\u0027: {\r\n color: \u0027blue\u0027,\r\n },\r\n },\r\n};\r\n\r\nconst obj = {};\r\n\r\nObject\r\n .keys(styles)\r\n .forEach(style =\u003E {\r\n\tobj[style] = style;\r\n\t})","IsDeferred":false}]}