aboutsummaryrefslogtreecommitdiff
path: root/node_modules/is-relative/index.js
blob: 4272ca8ae89be147ab57ecd192ba80868840f6a9 (plain)
1
2
3
4
5
6
7
8
9
10
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);
};