{"ScriptPreparationCode":null,"TestCases":[{"Name":"switch-case","Code":"const options = [\u0022top left\u0022, \u0022top center\u0022, \u0022top right\u0022, \u0022left center\u0022, \u0022right center\u0022, \u0022bottom left\u0022, \u0022bottom center\u0022, \u0022bottom right\u0022]\r\nconst testIt = (fn) =\u003E {\r\n fn();\r\n for (direction of options) fn(direction);\r\n}\r\n\r\nconst getDirection = (direction) =\u003E {\r\n\tswitch (direction) {\r\n\t\tcase \u0022top left\u0022:\r\n\t\t\treturn \u0022top-start\u0022;\r\n\t\tcase \u0022top center\u0022:\r\n\t\t\treturn \u0022top\u0022;\r\n\t\tcase \u0022top right\u0022:\r\n\t\t\treturn \u0022top-end\u0022;\r\n\t\tcase \u0022left center\u0022:\r\n\t\t\treturn \u0022left\u0022;\r\n\t\tcase \u0022right center\u0022:\r\n\t\t\treturn \u0022right\u0022;\r\n\t\tcase \u0022bottom left\u0022:\r\n\t\t\treturn \u0022bottom-start\u0022;\r\n\t\tcase \u0022bottom center\u0022:\r\n\t\t\treturn \u0022bottom\u0022;\r\n\t\tcase \u0022bottom right\u0022:\r\n\t\t\treturn \u0022bottom-end\u0022;\r\n\t\tdefault:\r\n\t\t\treturn \u0022top\u0022;\r\n\t}\r\n};\r\n\r\ntestIt(getDirection);","IsDeferred":false},{"Name":"custom fn","Code":"const options = [\u0022top left\u0022, \u0022top center\u0022, \u0022top right\u0022, \u0022left center\u0022, \u0022right center\u0022, \u0022bottom left\u0022, \u0022bottom center\u0022, \u0022bottom right\u0022]\r\nconst testIt = (fn) =\u003E {\r\n fn();\r\n for (direction of options) fn(direction);\r\n}\r\n\r\nconst getDirection = (direction = \u0027top\u0027) =\u003E {\r\n\tconst [v, h] = direction.split(\u0027 \u0027);\r\n\tconst map = {left: \u0027start\u0027, right: \u0027end\u0027};\r\n\r\n\treturn map[h] ? [v, map[h]].join(\u0060-\u0060) : v;\r\n};\r\n\r\ntestIt(getDirection);","IsDeferred":false}]}