Added tests for arrayToHtmlList

This commit is contained in:
Angelos Chalaris
2018-01-26 12:02:06 +02:00
parent e75c6455eb
commit 49b1fc7947
3 changed files with 715 additions and 703 deletions

View File

@ -1,5 +1,6 @@
const getURLParameters = url =>
url
.match(/([^?=&]+)(=([^&]*))/g)
.reduce((a, v) => ((a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1)), a), {});
(url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce(
(a, v) => ((a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1)), a),
{}
);
module.exports = getURLParameters