This commit is contained in:
MICHAEL JACKSON
2017-11-25 13:25:01 -08:00
parent f3974b5e2d
commit 3a309241da
64 changed files with 635 additions and 801 deletions

View File

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