{"ScriptPreparationCode":"function format_lodash(data) {\r\n return data.map(({ id, label, ...properties}) =\u003E {\r\n return { id, label, properties: _.mapValues(properties, v =\u003E v[0]) };\r\n });\r\n}\r\n\r\nfunction format_pure(data) {\r\n return data.map(({ id, label, ...properties}) =\u003E {\r\n for (let [key, value] of Object.entries(properties)) { properties[key] = value[0] }\r\n return { id, label, properties};\r\n });\r\n}","TestCases":[{"Name":"Lodash Test","Code":"const input = [{\r\n id: 1,\r\n label: \u0027label 1\u0027,\r\n property_1: [\u0027prop_1\u0027],\r\n property_2: [\u0027prop_2\u0027]\r\n },\r\n {\r\n id: 2,\r\n label: \u0027label 2\u0027,\r\n property_3: [\u0027prop_3\u0027],\r\n property_4: [\u0027prop_4\u0027]\r\n }\r\n]\r\n\r\nconsole.log(format_lodash(input))","IsDeferred":false},{"Name":"Pure JS Test","Code":"const input = [{\r\n id: 1,\r\n label: \u0027label 1\u0027,\r\n property_1: [\u0027prop_1\u0027],\r\n property_2: [\u0027prop_2\u0027]\r\n },\r\n {\r\n id: 2,\r\n label: \u0027label 2\u0027,\r\n property_3: [\u0027prop_3\u0027],\r\n property_4: [\u0027prop_4\u0027]\r\n }\r\n]\r\n\r\nconsole.log(format_pure(input))","IsDeferred":false}]}