All Downloads are FREE. Search and download functionalities are using the official Maven repository.

node_modules.bower.lib.node_modules.is-relative.index.js Maven / Gradle / Ivy

'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);
};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy