{"ScriptPreparationCode":"var getBemClassName =\r\n\t(block) =\u003E\r\n\t(elem, mod) =\u003E {\r\n\t\tconst isNonEmptyString = (str) =\u003E typeof str === \u0027string\u0027 \u0026\u0026 str.length \u003E 0;\r\n\t\tconst hasElem = isNonEmptyString(elem);\r\n\t\tconst hasMod = isNonEmptyString(mod);\r\n\r\n\t\tif (hasElem \u0026\u0026 hasMod) return \u0060${block}__${elem}--${mod}\u0060;\r\n\t\tif (!hasElem \u0026\u0026 hasMod) return \u0060${block}--${mod}\u0060;\r\n\t\tif (hasElem \u0026\u0026 !hasMod) return \u0060${block}__${elem}\u0060;\r\n\r\n\t\treturn block;\r\n\t};\r\n\r\nvar getModuleBemClassName =\r\n\t(styles) =\u003E\r\n\t(block) =\u003E\r\n\t(elem, mod) =\u003E\r\n\t\tstyles[getBemClassName(block)(elem, mod)];\r\n\r\nvar STYLES = {\r\n \u0027block\u0027: \u0027block\u0027,\r\n \u0027block--mod1\u0027: \u0027block--mod1\u0027,\r\n \u0027block--mod2\u0027: \u0027block--mod2\u0027,\r\n \u0027block__element\u0027: \u0027block__element\u0027,\r\n \u0027block__element--mod1\u0027: \u0027block__element--mod1\u0027,\r\n \u0027block__element--mod2\u0027: \u0027block__element--mod2\u0027,\r\n \u0027block__element2\u0027: \u0027block__element2\u0027\r\n};\r\nvar KEYS = Object.keys(STYLES);","TestCases":[{"Name":"via object","Code":"var c1 = STYLES[\u0027block\u0027];\r\nvar c2 = STYLES[\u0027block--mod1\u0027];\r\nvar c3 = STYLES[\u0027block--mod2\u0027];\r\nvar c4 = STYLES[\u0027block__element\u0027];\r\nvar c5 = STYLES[\u0027block__element--mod1\u0027];\r\nvar c6 = STYLES[\u0027block__element--mod2\u0027];\r\nvar c7 = STYLES[\u0027block__element2\u0027];","IsDeferred":false},{"Name":"via bem func with modules","Code":"var bem = getModuleBemClassName(STYLES)(\u0027block\u0027)\r\nvar c1 = bem();\r\nvar c2 = bem(undefined, \u0027mod1\u0027);\r\nvar c3 = bem(undefined, \u0027mod2\u0027);\r\nvar c4 = bem(\u0027element\u0027);\r\nvar c5 = bem(\u0027element\u0027, \u0027mod1\u0027);\r\nvar c6 = bem(\u0027element\u0027, \u0027mod2\u0027);\r\nvar c7 = bem(\u0027element2\u0027);","IsDeferred":false},{"Name":"classname generation with bem func","Code":"var bem = getBemClassName(\u0027block\u0027)\r\nvar c1 = bem();\r\nvar c2 = bem(undefined, \u0027mod1\u0027);\r\nvar c3 = bem(undefined, \u0027mod2\u0027);\r\nvar c4 = bem(\u0027element\u0027);\r\nvar c5 = bem(\u0027element\u0027, \u0027mod1\u0027);\r\nvar c6 = bem(\u0027element\u0027, \u0027mod2\u0027);\r\nvar c7 = bem(\u0027element2\u0027);","IsDeferred":false},{"Name":"manual classname generation","Code":"var c1 = \u0027block\u0027;\r\nvar c2 = \u0027block--mod1\u0027;\r\nvar c3 = \u0027block--mod2\u0027;\r\nvar c4 = \u0027block__element\u0027;\r\nvar c5 = \u0027block__element--mod1\u0027;\r\nvar c6 = \u0027block__element--mod2\u0027;\r\nvar c7 = \u0027block__element2\u0027;","IsDeferred":false}]}