query-string
Advanced tools
Comparing version 6.4.2 to 6.5.0
19
index.js
@@ -40,3 +40,3 @@ 'use strict'; | ||
return key => (result, value, index) => { | ||
if (!value) { | ||
if (value === null || value === undefined || value.length === 0) { | ||
return result; | ||
@@ -156,3 +156,13 @@ } | ||
function removeHash(input) { | ||
const hashStart = input.indexOf('#'); | ||
if (hashStart !== -1) { | ||
input = input.slice(0, hashStart); | ||
} | ||
return input; | ||
} | ||
function extract(input) { | ||
input = removeHash(input); | ||
const queryStart = input.indexOf('?'); | ||
@@ -253,11 +263,6 @@ if (queryStart === -1) { | ||
exports.parseUrl = (input, options) => { | ||
const hashStart = input.indexOf('#'); | ||
if (hashStart !== -1) { | ||
input = input.slice(0, hashStart); | ||
} | ||
return { | ||
url: input.split('?')[0] || '', | ||
url: removeHash(input).split('?')[0] || '', | ||
query: parse(extract(input), options) | ||
}; | ||
}; |
{ | ||
"name": "query-string", | ||
"version": "6.4.2", | ||
"version": "6.5.0", | ||
"description": "Parse and stringify URL query strings", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
"test": "xo && ava && tsd" | ||
}, | ||
@@ -47,5 +47,5 @@ "files": [ | ||
"fast-check": "^1.5.0", | ||
"tsd-check": "^0.3.0", | ||
"tsd": "^0.7.0", | ||
"xo": "^0.24.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17875
340