{"ScriptPreparationCode":"var req = {\r\n query: {\r\n click_key: \u0027click_key_value\u0027,\r\n run_key: \u0027run_key_value\u0027,\r\n },\r\n};\r\n\r\nvar externalEvents = [\r\n {\r\n origin_query_params: \u0027click_key\u0027,\r\n code: \u0027cookie-oven\u0027,\r\n },\r\n {\r\n origin_query_params: \u0027run_key\u0027,\r\n code: \u0027cookie-run_key\u0027,\r\n },\r\n {\r\n origin_query_params: \u0027invalid_key\u0027,\r\n code: \u0027invalid_value\u0027,\r\n },\r\n];","TestCases":[{"Name":"_.get \u002B stringify","Code":"var q = externalEvents.reduce((acc, curr) =\u003E {\r\n var queryVal = _.get(req.query, curr.origin_query_params);\r\n if (queryVal) {\r\n return { ...acc, [curr.code]: queryVal };\r\n }\r\n return acc;\r\n}, {});","IsDeferred":false},{"Name":"native","Code":"Object.entries(req.query).map(([key, value]) =\u003E {\r\n var [event] = externalEvents.filter((e) =\u003E e.origin_query_params === key)\r\n if (event) { return \u0060${event.code}=${value}\u0060 }\r\n return \u0027\u0027\r\n // return \u0060${key}=${value}\u0060\r\n }).filter(Boolean).join(\u0027\u0026\u0027);","IsDeferred":false}]}