Comparing version 4.0.0 to 4.0.1
@@ -9,3 +9,8 @@ (function (name, context, definition) { | ||
var resultArray = []; | ||
if (strArray.length === 0) { return ''; } | ||
if (typeof strArray[0] !== 'string') { | ||
throw new TypeError('Url must be a string. Received ' + strArray[0]); | ||
} | ||
// If the first part is a plain protocol, we combine it with the next part. | ||
@@ -12,0 +17,0 @@ if (strArray[0].match(/^[^/:]+:\/*$/) && strArray.length > 1) { |
{ | ||
"name": "url-join", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Join urls and normalize as in path.join.", | ||
@@ -20,2 +20,3 @@ "main": "lib/url-join.js", | ||
"devDependencies": { | ||
"conventional-changelog": "^1.1.10", | ||
"mocha": "^3.2.0", | ||
@@ -22,0 +23,0 @@ "should": "~1.2.1" |
@@ -103,2 +103,4 @@ var urljoin = require('../lib/url-join'); | ||
it('should fail with segments that are not string', function() { | ||
assert.throws(() => urljoin(true), | ||
/Url must be a string. Received true/); | ||
assert.throws(() => urljoin('http://blabla.com/', 1), | ||
@@ -146,2 +148,6 @@ /Url must be a string. Received 1/); | ||
}); | ||
it('should return an empty string if no arguments are supplied', function() { | ||
urljoin().should.eql(''); | ||
}); | ||
}); |
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
18310
3
182