Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
6
test/getURLParameters/getURLParameters.js
Normal file
6
test/getURLParameters/getURLParameters.js
Normal file
@ -0,0 +1,6 @@
|
||||
const getURLParameters = url =>
|
||||
(url.match(/([^?=&]+)(=([^&]*))/g) || []).reduce(
|
||||
(a, v) => ((a[v.slice(0, v.indexOf('='))] = v.slice(v.indexOf('=') + 1)), a),
|
||||
{}
|
||||
);
|
||||
module.exports = getURLParameters;
|
||||
Reference in New Issue
Block a user