Comparing version 1.1.9 to 1.2.0
@@ -340,4 +340,9 @@ 'use strict'; | ||
case 'pathname': | ||
url.pathname = value.length && value.charAt(0) !== '/' ? '/' + value : value; | ||
case 'hash': | ||
if (value) { | ||
var char = part === 'pathname' ? '/' : '#'; | ||
url[part] = value.charAt(0) !== char ? char + value : value; | ||
} else { | ||
url[part] = value; | ||
} | ||
break; | ||
@@ -344,0 +349,0 @@ |
{ | ||
"name": "url-parse", | ||
"version": "1.1.9", | ||
"version": "1.2.0", | ||
"description": "Small footprint URL parser that works seamlessly across Node.js and browser environments", | ||
"main": "index.js", | ||
"scripts": { | ||
"100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100", | ||
"browserify": "mkdir -p dist && browserify index.js -s URLParse -o dist/url-parse.js", | ||
"test-node": "istanbul cover _mocha --report lcovonly -- test.js", | ||
"coverage": "istanbul cover _mocha -- test.js", | ||
"test-browser": "zuul -- test.js", | ||
"watch": "mocha --watch test.js", | ||
"test": "mocha test.js" | ||
"browserify": "mkdir -p dist && browserify index.js -s URLParse | uglifyjs -cm -o dist/url-parse.min.js", | ||
"test": "nyc --reporter=html --reporter=text mocha test/test.js", | ||
"test-browser": "node test/browser.js", | ||
"prepublishOnly": "npm run browserify", | ||
"watch": "mocha --watch test/test.js" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"dist" | ||
], | ||
"repository": { | ||
@@ -34,12 +36,14 @@ "type": "git", | ||
"querystringify": "~1.0.0", | ||
"requires-port": "1.0.x" | ||
"requires-port": "~1.0.0" | ||
}, | ||
"devDependencies": { | ||
"assume": "~1.5.0", | ||
"browserify": "~14.3.0", | ||
"istanbul": "0.4.x", | ||
"mocha": "~3.3.0", | ||
"browserify": "~14.5.0", | ||
"mocha": "~4.0.0", | ||
"nyc": "~11.3.0", | ||
"pre-commit": "~1.2.0", | ||
"zuul": "3.11.x" | ||
"sauce-browsers": "~1.0.0", | ||
"sauce-test": "~1.3.3", | ||
"uglify-js": "~3.1.0" | ||
} | ||
} |
@@ -92,2 +92,13 @@ # url-parse | ||
Note that when `url-parse` is used in a browser environment, it will default to | ||
using the browser's current window location as the base URL when parsing all | ||
inputs. To parse an input independently of the browser's current URL (e.g. for | ||
functionality parity with the library in a Node environment), pass an empty | ||
location object as the second parameter: | ||
```js | ||
var parse = require('url-parse'); | ||
parse('hostname', {}); | ||
``` | ||
### URL.set(key, value) | ||
@@ -94,0 +105,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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
35823
6
661
148
8
2
4
Updatedrequires-port@~1.0.0