{"ScriptPreparationCode":"var str = \u0027style\u0027;\r\nvar obj = {\r\n \u0027style-2\u0027: true,\r\n \u0027style-3\u0027: false,\r\n \u0027style-4\u0027: true,\r\n}\r\nvar arr = [\u0027style-5\u0027, \u0027style-6\u0027]\r\n\r\nfunction composeCssClass(...values) {\r\n const classNameStack = []\r\n\r\n for (let i=0; i\u003Cvalues.length; i\u002B=1) {\r\n \tconst value = values[i]\r\n \r\n switch (true) {\r\n case !value: {\r\n continue\r\n }\r\n case typeof value === \u0022string\u0022:\r\n \tcase typeof value === \u0022number\u0022: {\r\n classNameStack.push(value)\r\n continue\r\n }\r\n case Array.isArray(value): {\r\n const valueFromArray = composeCssClass(...value)\r\n\r\n if (typeof valueFromArray !== \u0027undefined\u0027) {\r\n classNameStack.push(valueFromArray)\r\n }\r\n continue\r\n }\r\n case typeof value === \u0022object\u0022: {\r\n for (const key in value) {\r\n if (value[key]) {\r\n classNameStack.push(key)\r\n }\r\n }\r\n continue\r\n }\r\n }\r\n }\r\n\r\n return classNameStack.length \u003E 0 ? classNameStack.join(\u0022 \u0022) : undefined\r\n}","TestCases":[{"Name":"classnames","Code":"let result = window.classNames(str, obj, arr, \u0027test classname\u0027)","IsDeferred":false},{"Name":"clsx","Code":"let result = window.clsx(str, obj, arr, \u0027test classname\u0027)","IsDeferred":false},{"Name":"custom implemenatation","Code":"let result = composeCssClass(str, obj, arr, \u0027test classname\u0027)","IsDeferred":false}]}