diff options
Diffstat (limited to 'node_modules/is-relative/index.js')
-rw-r--r-- | node_modules/is-relative/index.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/node_modules/is-relative/index.js b/node_modules/is-relative/index.js new file mode 100644 index 000000000..ffc760a82 --- /dev/null +++ b/node_modules/is-relative/index.js @@ -0,0 +1,21 @@ +'use strict'; + +/** + * ```js + * var isRelative = require('is-relative'); + * isRelative('README.md'); + * //=> true + * ``` + * + * @name isRelative + * @param {String} `filepath` Path to test. + * @return {Boolean} + * @api public + */ + +module.exports = function isRelative(filepath) { + if (typeof filepath !== 'string') { + throw new Error('isRelative expects a string.'); + } + return !/^([a-z]+:)?[\\\/]/i.test(filepath); +};
\ No newline at end of file |