{"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 let className = \u0027\u0027\r\n\r\n for (let valueIndex = 0, valuesLength = values.length; valueIndex \u003C valuesLength; valueIndex \u002B= 1) {\r\n const value = values[valueIndex]\r\n\r\n switch (true) {\r\n case !value: {\r\n continue\r\n }\r\n case typeof value === \u0027string\u0027:\r\n case typeof value === \u0027number\u0027: {\r\n\r\n className = className \u002B (className \u0026\u0026 \u0027 \u0027) \u002B value\r\n continue\r\n }\r\n case Array.isArray(value): {\r\n const valueFromArray = composeCssClass(...value)\r\n\r\n if (valueFromArray) {\r\n className = className \u002B (className \u0026\u0026 \u0027 \u0027) \u002B valueFromArray\r\n }\r\n continue\r\n }\r\n case typeof value === \u0027object\u0027: {\r\n for (const key in value) {\r\n if (value[key]) {\r\n className = className \u002B (className \u0026\u0026 \u0027 \u0027) \u002B key\r\n }\r\n }\r\n continue\r\n }\r\n }\r\n }\r\n\r\n return className || 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}]}