Comparing version
@@ -113,3 +113,3 @@ 'use strict'; | ||
// | ||
if (parser) url.query = parser(url.query); | ||
if (parser && url.query) url.query = parser(url.query); | ||
@@ -116,0 +116,0 @@ // |
{ | ||
"name": "url-parse", | ||
"version": "1.0.2", | ||
"description": "Parse URL in node using the URL module and in the browser using the DOM", | ||
"version": "1.0.3", | ||
"description": "Small footprint URL parser that works seamlessly across Node.js and browser environments", | ||
"main": "index.js", | ||
@@ -30,8 +30,8 @@ "scripts": { | ||
"devDependencies": { | ||
"assume": "1.1.x", | ||
"browserify": "8.1.x", | ||
"assume": "1.3.x", | ||
"browserify": "11.2.x", | ||
"istanbul": "0.3.x", | ||
"mocha": "2.1.x", | ||
"mochify": "2.4.x", | ||
"pre-commit": "1.0.x", | ||
"mocha": "2.2.x", | ||
"mochify": "2.13.x", | ||
"pre-commit": "1.1.x", | ||
"testling": "1.7.x" | ||
@@ -38,0 +38,0 @@ }, |
@@ -60,5 +60,6 @@ # url-parse | ||
- `protocol`: Without slashes `http:`. | ||
- `protocol`: Requested protocol without slashes (e.g. `http:`). | ||
- `username`: Username of basic authentication. | ||
- `password`: Password of basic authentication. | ||
- `auth`: Authentication information portion (e.g. `username:password`). | ||
- `host`: Host name with port number. | ||
@@ -69,3 +70,3 @@ - `hostname`: Host name without port number. | ||
- `query`: Parsed object containing query string, unless parsing is set to false. | ||
- `hash`: Prefixed with `#` | ||
- `hash`: The "fragment" portion of the URL including the pound-sign (`#`). | ||
- `href`: The full URL. | ||
@@ -72,0 +73,0 @@ |
@@ -27,2 +27,9 @@ describe('url-parse', function () { | ||
it('does not add question mark to href if query string empty', function () { | ||
var url = 'http://google.com/' | ||
, data = parse(url, true); | ||
assume(data.href).equals(url); | ||
}); | ||
it('allows a custom function as parser', function () { | ||
@@ -29,0 +36,0 @@ var url = 'http://google.com/?foo=bar' |
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
31166
0.84%606
0.83%120
0.84%