Skip to content

Commit

Permalink
fix: filtering of string forms of null and undefined (#5075)
Browse files Browse the repository at this point in the history
Removed null and undefined being filtered out in string forms which caused issues in `<client>.api`, issue: #5072
  • Loading branch information
VoltrexKeyva committed Dec 13, 2020
1 parent 12c909e commit 9042d19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rest/APIRequest.js
Expand Up @@ -20,7 +20,7 @@ class APIRequest {
let queryString = '';
if (options.query) {
const query = Object.entries(options.query)
.filter(([, value]) => ![null, 'null', 'undefined'].includes(value) && typeof value !== 'undefined')
.filter(([, value]) => value !== null && typeof value !== 'undefined')
.flatMap(([key, value]) => (Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]));
queryString = new URLSearchParams(query).toString();
}
Expand Down

0 comments on commit 9042d19

Please sign in to comment.