From b192e059403f1655d8e968a406c6da2e8f6a4e7e Mon Sep 17 00:00:00 2001 From: Matteo Date: Mon, 10 Jun 2019 17:34:34 +0200 Subject: [PATCH] fix(helpers): querystring registers undefined or null closes #216 --- src/helpers.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/helpers.js b/src/helpers.js index 7a2eae2..2a45ee4 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -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 }, '')