Comparing version 1.0.1 to 1.0.2
@@ -154,3 +154,6 @@ 'use strict'; | ||
if ('query' === part) { | ||
if ('string' === typeof value) value = (fn || qs.parse)(value); | ||
if ('string' === typeof value && value.length) { | ||
value = (fn || qs.parse)(value); | ||
} | ||
url[part] = value; | ||
@@ -157,0 +160,0 @@ } else if ('port' === part) { |
{ | ||
"name": "url-parse", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Parse URL in node using the URL module and in the browser using the DOM", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -282,2 +282,11 @@ describe('url-parse', function () { | ||
it('removes querystring and hash', function () { | ||
var data = parse('https://thisanurl.com/?swag=yolo#representing'); | ||
data.set('query', ''); | ||
data.set('hash', ''); | ||
assume(data.href).equals('https://thisanurl.com/'); | ||
}); | ||
it('only sets port when its not default', function () { | ||
@@ -284,0 +293,0 @@ var data = parse('http://google.com/foo'); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
30907
601
0