Prettify everything

This commit is contained in:
MICHAEL JACKSON
2018-02-17 18:00:56 -08:00
parent d6f2bc089a
commit 2e1f09e913
58 changed files with 1061 additions and 932 deletions

View File

@ -1,17 +1,17 @@
function createSearch(query) {
const params = []
const params = [];
Object.keys(query).forEach(param => {
if (query[param] === "") {
params.push(param) // Omit the trailing "=" from param=
params.push(param); // Omit the trailing "=" from param=
} else {
params.push(`${param}=${encodeURIComponent(query[param])}`)
params.push(`${param}=${encodeURIComponent(query[param])}`);
}
})
});
const search = params.join("&")
const search = params.join("&");
return search ? `?${search}` : ""
return search ? `?${search}` : "";
}
module.exports = createSearch
module.exports = createSearch;