diff options
Diffstat (limited to 'node_modules/is-relative/index.js')
-rw-r--r-- | node_modules/is-relative/index.js | 11 |
1 files changed, 11 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..4272ca8ae --- /dev/null +++ b/node_modules/is-relative/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var isUncPath = require('is-unc-path'); + +module.exports = function isRelative(fp) { + if (typeof fp !== 'string') { + throw new TypeError('isRelative expects a string.'); + } + // Windows UNC paths are always considered to be absolute. + return !isUncPath(fp) && !/^([a-z]:)?[\\\/]/i.test(fp); +}; |