{"ScriptPreparationCode":"var options = [{\r\n label: \u0027kustomer.conversation.create\u0027,\r\n value: \u0027kustomer.conversation.create\u0027,\r\n },\r\n {\r\n label: \u0027kustomer.conversation.update\u0027,\r\n value: \u0027kustomer.conversation.update\u0027,\r\n },\r\n {\r\n label: \u0027kustomer.customer.create\u0027,\r\n value: \u0027kustomer.customer.create\u0027,\r\n },\r\n {\r\n label: \u0027kustomer.customer.update\u0027,\r\n value: \u0027kustomer.customer.update\u0027,\r\n },\r\n {\r\n label: \u0027kustomer.message.create\u0027,\r\n value: \u0027kustomer.message.create\u0027,\r\n },\r\n {\r\n label: \u0027kustomer.message.update\u0027,\r\n value: \u0027kustomer.message.update\u0027,\r\n },\r\n {\r\n label: \u0027kustomer.team.create\u0027,\r\n value: \u0027kustomer.team.create\u0027,\r\n },\r\n {\r\n label: \u0027kustomer.team.update\u0027,\r\n value: \u0027kustomer.team.update\u0027,\r\n },\r\n {\r\n label: \u0027kustomer.user.create\u0027,\r\n value: \u0027kustomer.user.create\u0027,\r\n },\r\n {\r\n label: \u0027kustomer.user.update\u0027,\r\n value: \u0027kustomer.user.update\u0027,\r\n },\r\n];\r\nvar getEventGroups = (eventsList) =\u003E {\r\n const groups = {};\r\n eventsList.forEach((event) =\u003E {\r\n const group = event.value.split(\u0027.\u0027, 2)[1];\r\n if (!groups[group]) groups[group] = {\r\n label: group,\r\n options: []\r\n };\r\n groups[group].options.push(event);\r\n });\r\n return Object.values(groups);\r\n}\r\n\r\nvar getEventGroupsMemoize = _.memoize(getEventGroups);\r\nvar getEventGroupsMemoizeSerialize = _.memoize(getEventGroups, (...args) =\u003E JSON.stringify(args));\r\n\r\n","TestCases":[{"Name":"getEventGroups","Code":"getEventGroups(options)","IsDeferred":false},{"Name":"getEventGroupsMemoize","Code":"getEventGroupsMemoize(options)","IsDeferred":false},{"Name":"getEventGroupsMemoizeSerialize","Code":"getEventGroupsMemoizeSerialize(options)","IsDeferred":false}]}