{"ScriptPreparationCode":"var obj = {\r\n \t \u0027style-2\u0027: true,\r\n \t \u0027style-3\u0027: false,\r\n \t \u0027style-4\u0027: true,\r\n}","TestCases":[{"Name":"classnames 2.3.1","Code":"let result = window.classNames(obj)","IsDeferred":false},{"Name":"keys, filter, join","Code":"function classes(obj = {}) {\r\n return Object.keys(obj)\r\n .filter((key) =\u003E obj[key])\r\n .join(\u0027 \u0027);\r\n}\r\n\r\nlet result = classes(obj)","IsDeferred":false},{"Name":"string based","Code":"function ts(...args){\r\n let template = \u0027\u0027;\r\n args.forEach(arg =\u003E {\r\n \tif (typeof arg === \u0027string\u0027) { \r\n template \u002B= \u0027 \u0027\u002Barg;\r\n return; \r\n }\r\n \tif (arg.join) { \r\n arg.forEach((e) =\u003E { \r\n template \u002B= \u0027 \u0027 \u002B e; \r\n }) \r\n return;\r\n }\r\n let entries = Object.entries(arg);\r\n if (entries.length) {\r\n entries.forEach(entry =\u003E {\r\n if(entry[1]) template \u002B= \u0027 \u0027 \u002B entry[0]\r\n })\r\n }\r\n })\r\n return template;\r\n}\r\nlet result = ts(obj)","IsDeferred":false}]}