Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix(helpers): querystring registers undefined or null
Browse files Browse the repository at this point in the history
closes #216
  • Loading branch information
MatteoGabriele committed Jun 10, 2019
1 parent 8121bf7 commit b192e05
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ export function getQueryString (queryMap) {
const queryString = Object.keys(queryMap)
.reduce((string, key, index, keys) => {
const isLastKey = index === (keys.length - 1)
string += `${key}=${queryMap[key]}${isLastKey ? '' : '&'}`
const value = queryMap[key]

if (value == null) {
return string
}

string += `${key}=${value}${isLastKey ? '' : '&'}`
return string
}, '')

Expand Down

0 comments on commit b192e05

Please sign in to comment.