query-string 6.8.1 → 6.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +1 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -202,7 +202,7 @@ function parse(input, options) {
202
202
  // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
203
203
  value = value === undefined ? null : decode(value, options);
204
204
 
205
- if (options.parseNumbers && !Number.isNaN(Number(value))) {
205
+ if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {
206
206
  value = Number(value);
207
207
  } else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
208
208
  value = value.toLowerCase() === 'true';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "query-string",
3
- "version": "6.8.1",
3
+ "version": "6.8.2",
4
4
  "description": "Parse and stringify URL query strings",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/query-string",