debug-server-next
Version:
Dev server for hippy-core.
18 lines (12 loc) • 398 B
JavaScript
function parseURL(resourceQuery) {
const options = {};
if (typeof resourceQuery === 'string' && resourceQuery !== '') {
const searchParams = resourceQuery.substr(1).split('&');
for (let i = 0; i < searchParams.length; i++) {
const pair = searchParams[i].split('=');
options[pair[0]] = decodeURIComponent(pair[1]);
}
}
return options;
}
export default parseURL;