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

join-path

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

join-path - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

8

index.js

@@ -5,3 +5,3 @@ var path = require('path');

var asArray = require('as-array');
var _isUrl = require('is-url');
var validUrl = require('valid-url');

@@ -12,3 +12,3 @@ var exports = module.exports = function () {

return isUrl(paths[0])
return validUrl.isUri(paths[0])
? urlJoin.apply(urlJoin, paths)

@@ -20,3 +20,3 @@ : path.join.apply(path, paths);

return _isUrl(url)
return validUrl.isUri(url)
|| url === 'http://'

@@ -30,4 +30,4 @@ || url === 'https://'

return (p === undefined || p === null)
? isUrl(paths[0]) ? '/' : path.sep
? validUrl.isUri(paths[0]) ? '/' : path.sep
: p;
}
{
"name": "join-path",
"version": "1.1.0",
"version": "1.1.1",
"description": "Join urls or system paths, even with undefined values",

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

"as-array": "^2.0.0",
"is-url": "^1.1.0",
"valid-url": "^1",
"url-join": "0.0.1"
}
}

@@ -23,1 +23,6 @@ var test = require('tape');

});
test('joins a url without only tld', function (t) {
t.equal(join('http://test:3002/api/v1', '/some/path'), 'http://test:3002/api/v1/some/path', 'tld only with port');
t.end();
});
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