Socket
Socket
Sign inDemoInstall

url2

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url2 - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

50

package.json
{
"name": "url2",
"version": "0.0.0",
"description": "Node's URL module plus relative pathing",
"author": "Kris Kowal <kris@cixar.com> (https://github.com/kriskowal/url2)",
"homepage": "https://github.com/kriskowal/url2",
"keywords": ["url"],
"main": "url2.js",
"repository": {
"type": "git",
"url": "git://github.com/kriskowal/url2.git"
},
"devDependencies": {
"jshint": ">=0.9.1",
"jasmine-node": "*",
"cover": "*",
"opener": "*"
},
"scripts": {
"test": "jasmine-node test",
"lint": "jshint url2.js",
"cover": "cover run node_modules/jasmine-node/bin/jasmine-node test && cover report html && opener cover_html/index.html"
}
"name": "url2",
"version": "1.0.0",
"description": "Node's URL module plus relative pathing",
"author": "Kris Kowal <kris@cixar.com> (https://github.com/kriskowal/url2)",
"homepage": "https://github.com/kriskowal/url2",
"keywords": [
"url",
"relative",
"resolve",
"parse",
"format"
],
"main": "url2.js",
"repository": {
"type": "git",
"url": "git://github.com/kriskowal/url2.git"
},
"devDependencies": {
"jshint": "~2.1",
"jasmine-node": "~1.2",
"cover": "~0.2.8",
"opener": "~1.3"
},
"scripts": {
"test": "jasmine-node test",
"lint": "jshint url2.js",
"cover": "cover run node_modules/jasmine-node/bin/jasmine-node test && cover report html && opener cover_html/index.html"
}
}

@@ -1,2 +0,1 @@

var URL = require("url");

@@ -8,18 +7,25 @@

// | ||| hostname | ^- query ----^| |
// proto|| | ^--^^- path ----------------------^| |
// | slashes | port hash^
// | ^- host ---^ |
// protocol | ^--^^- path ----------------------^| |
// | || | port hash^
// | slashes ^- host ---^ |
// ^- href ------------------------------------------------------------^
// Node's URL format uses:
// protocol: gets a colon added if it doesn't have one yet
// slashes: used
// auth: used
// hostname: used if there's no host
// port: used if there's no host
// path: NOT USED AT ALL EVER
// pathname: used
// search: used
// query: used if object and no search
// hash: used
// protocol: gets a colon added if it doesn't have one yet
// slashes: used
// auth: used
// user: not used
// password: not used
// host:
// hostname: used if there's no host
// port: used if there's no host
// path: NOT USED AT ALL EVER
// pathname: used
// root: not used, not produced
// directory: not used, not produced
// directories: not used, not produced
// file: not used, not produced
// search: used
// query: used if object and no search
// hash: used

@@ -30,4 +36,4 @@ exports.resolve = URL.resolve;

exports.parse = parse;
function parse(url) {
var object = URL.parse(url);
function parse() {
var object = URL.parse.apply(URL, arguments);
object.pathname = object.pathname || "";

@@ -34,0 +40,0 @@ object.root = !!object.pathname.length && object.pathname[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