Comparing version 0.1.2 to 0.1.3
@@ -18,2 +18,5 @@ /** | ||
jshint: { | ||
options:{ | ||
node: true | ||
}, | ||
index: ['index.js'] | ||
@@ -20,0 +23,0 @@ }, |
@@ -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
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
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
7790
8
129
35