Socket
Socket
Sign inDemoInstall

is-relative-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

is-relative-path - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

6

index.js

@@ -0,1 +1,3 @@

var util = require('util');
/**

@@ -6,3 +8,7 @@ * @param {String} filename

module.exports = function (filename) {
if (typeof filename !== 'string') {
throw new TypeError('Path must be a string. Received ' + util.inspect(filename));
}
return filename[0] === '.';
};

2

package.json
{
"name": "is-relative-path",
"version": "1.0.1",
"version": "1.0.2",
"description": "Whether or not a given path is relative",

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

@@ -22,2 +22,13 @@ var assert = require('assert');

});
it('throws TypeError if the given path is not a string', function () {
assert.throws(isRelative.bind(null, undefined), TypeError);
assert.throws(isRelative.bind(null, null), TypeError);
assert.throws(isRelative.bind(null, false), TypeError);
assert.throws(isRelative.bind(null, true), TypeError);
assert.throws(isRelative.bind(null, 0), TypeError);
assert.throws(isRelative.bind(null, 1), TypeError);
assert.throws(isRelative.bind(null, []), TypeError);
assert.throws(isRelative.bind(null, {}), TypeError);
});
});
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