lbry-desktop/ui/js/util/query_params.js
2017-05-07 19:50:32 +07:00

16 lines
335 B
JavaScript

function parseQueryParams(queryString) {
if (queryString === '') return {};
const parts = queryString
.split('?')
.pop()
.split('&')
.map(function(p) { return p.split('=') })
const params = {};
parts.forEach(function(arr) {
params[arr[0]] = arr[1];
})
return params;
}
export default parseQueryParams