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

url-join

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-join - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

bin/changelog

5

lib/url-join.js

@@ -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) {

3

package.json
{
"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('');
});
});
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