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

urljoin

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urljoin - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

.travis.yml

3

Gruntfile.js

@@ -18,2 +18,5 @@ /**

jshint: {
options:{
node: true
},
index: ['index.js']

@@ -20,0 +23,0 @@ },

7

index.js

@@ -8,8 +8,9 @@ /**

* 2014-08-19[14:05:43]:fixed crash when first piece is empty
* 2014-11-16[21:15:06]:support windows \\
*
* @author yanni4night@gmail.com
* @version 0.1.1
* @version 0.1.2
* @since 0.1.0
*/
/*jslint node: true */
"use strict";

@@ -64,4 +65,4 @@

first.query = query;
first.pathname = path.join.apply(path, paths);
first.pathname = path.join.apply(path, paths).replace(new RegExp('\\' + path.sep, 'g'), '/');
return url.format(first);
};
{
"name": "urljoin",
"version": "0.1.2",
"version": "0.1.3",
"description": "Join the urls like joining the paths",

@@ -25,5 +25,5 @@ "main": "index.js",

"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-nodeunit": "^0.4.1",
"grunt-contrib-watch": "^0.6.1"
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-watch": "~0.6.1"
},

@@ -30,0 +30,0 @@ "dependencies": {

@@ -28,3 +28,3 @@ urljoin

- Only the **protocol/port/host** will be saved
- Only the **protocol/port/host** in the first part will be saved
- Get parameters will be **all** saved

@@ -35,2 +35,2 @@

- yanni4night@gmail.com
- yanni4night@gmail.com

@@ -32,3 +32,5 @@ 'use strict';

join: function(test) {
test.expect(10);
test.deepEqual('', urljoin(), 'Empty argument');
test.deepEqual('/static/css/index.css', urljoin('\\static', '\\css', 'index.css'));
test.deepEqual('http://yanni4night.com/static/index/main.css', urljoin("http://yanni4night.com", 'static/css', '../index', 'main.css'), '../');

@@ -41,5 +43,5 @@ test.deepEqual('http://yanni4night.com/static/css/main.css', urljoin("http://yanni4night.com/", '/static/css/', '/main.css'), '/');

test.deepEqual('http://yanni4night.com/static/build', urljoin('http://yanni4night.com/static', 'http://google.com/build'), 'more than one scheme');
test.deepEqual('/static',urljoin('','/static'),'Empty ignored');
test.deepEqual('/static', urljoin('', '/static'), 'Empty ignored');
test.done();
}
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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