is-relative-path
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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] === '.'; | ||
}; |
{ | ||
"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); | ||
}); | ||
}); |
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
2832
41