Commit e781e1a3 authored by Jose Vargas's avatar Jose Vargas

Break out function result

parent ad5c2fee
...@@ -270,9 +270,9 @@ export function getWebSocketUrl(path) { ...@@ -270,9 +270,9 @@ export function getWebSocketUrl(path) {
export function queryToObject(query) { export function queryToObject(query) {
const removeQuestionMarkFromQuery = String(query).startsWith('?') ? query.slice(1) : query; const removeQuestionMarkFromQuery = String(query).startsWith('?') ? query.slice(1) : query;
return removeQuestionMarkFromQuery.split('&').reduce((accumulator, curr) => { return removeQuestionMarkFromQuery.split('&').reduce((accumulator, curr) => {
const p = curr.split('='); const [key, value] = curr.split('=');
if (p[1] !== undefined) { if (value !== undefined) {
accumulator[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); accumulator[decodeURIComponent(key)] = decodeURIComponent(value);
} }
return accumulator; return accumulator;
}, {}); }, {});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment