Comparing version 2.0.3 to 2.0.4
{ | ||
"name": "url-join", | ||
"version": "2.0.2", | ||
"version": "2.0.4", | ||
"homepage": "https://github.com/jfromaniello/url-join", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -13,3 +13,3 @@ (function (name, context, definition) { | ||
var resultArray = []; | ||
// If the first part is a plain protocol, we combine it with the next part. | ||
@@ -27,6 +27,11 @@ if (strArray[0].match(/:\/*$/) && strArray.length > 1) { | ||
} | ||
for (var i = 0; i < strArray.length; i++) { | ||
var component = strArray[i]; | ||
if (typeof component !== 'string') { | ||
component = component && component.toString() || ''; | ||
} | ||
if (i > 0) { | ||
@@ -43,7 +48,7 @@ // Removing the starting slashes for each component but the first. | ||
} | ||
resultArray.push(component); | ||
} | ||
var str = resultArray.join('/'); | ||
@@ -71,3 +76,3 @@ // Each input component is now separated by a single slash except the possible first plain protocol part. | ||
} | ||
return normalize([].slice.call(input), options); | ||
@@ -74,0 +79,0 @@ }; |
{ | ||
"name": "url-join", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Join urls and normalize as in path.join.", | ||
@@ -23,2 +23,2 @@ "main": "lib/url-join.js", | ||
} | ||
} | ||
} |
@@ -95,3 +95,3 @@ var urljoin = require('../lib/url-join'); | ||
}); | ||
it('should merge just a simple path without URL correctly', function() { | ||
@@ -102,2 +102,7 @@ urljoin('/', 'test') | ||
it('should merge just a simple path without URL correctly', function() { | ||
urljoin('/', 1) | ||
.should.eql('/1'); | ||
}); | ||
it('should merge slashes in protocol correctly', function () { | ||
@@ -104,0 +109,0 @@ urljoin('http://example.org', 'a') |
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
9905
185