Logic cleanup

This commit is contained in:
Sam Potts
2018-06-13 00:56:31 +10:00
parent 0ecf7e3854
commit 5dddf8b0ec
5 changed files with 19 additions and 23 deletions
+2 -4
View File
@@ -2820,12 +2820,9 @@ function parseUrl(input) {
// Convert object to URLSearchParams // Convert object to URLSearchParams
function buildUrlParams(input) { function buildUrlParams(input) {
if (!is.object(input)) {
return '';
}
var params = new URLSearchParams(); var params = new URLSearchParams();
if (is.object(input)) {
Object.entries(input).forEach(function (_ref) { Object.entries(input).forEach(function (_ref) {
var _ref2 = slicedToArray(_ref, 2), var _ref2 = slicedToArray(_ref, 2),
key = _ref2[0], key = _ref2[0],
@@ -2833,6 +2830,7 @@ function buildUrlParams(input) {
params.set(key, value); params.set(key, value);
}); });
}
return params; return params;
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -4
View File
@@ -27,18 +27,16 @@ export function parseUrl(input, safe = true) {
// Convert object to URLSearchParams // Convert object to URLSearchParams
export function buildUrlParams(input) { export function buildUrlParams(input) {
if (!is.object(input)) {
return '';
}
const params = new URLSearchParams(); const params = new URLSearchParams();
if (is.object(input)) {
Object.entries(input).forEach(([ Object.entries(input).forEach(([
key, key,
value, value,
]) => { ]) => {
params.set(key, value); params.set(key, value);
}); });
}
return params; return params;
} }