Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

url-parse

Package Overview
Dependencies
Maintainers
4
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-parse - npm Package Compare versions

Comparing version 1.1.9 to 1.2.0

dist/url-parse.js

9

index.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc