index.js 314 B

1234567891011
  1. 'use strict';
  2. var isUncPath = require('is-unc-path');
  3. module.exports = function isRelative(fp) {
  4. if (typeof fp !== 'string') {
  5. throw new TypeError('isRelative expects a string.');
  6. }
  7. // Windows UNC paths are always considered to be absolute.
  8. return !isUncPath(fp) && !/^([a-z]:)?[\\\/]/i.test(fp);
  9. };