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

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

/*!
 * is-absolute 
 *
 * Copyright (c) 2014-2015, Jon Schlinkert.
 * Licensed under the MIT License.
 */

'use strict';

var isRelative = require('is-relative');

module.exports = function isAbsolute(filepath) {
  if ('/' === filepath[0]) {
    return true;
  }
  if (':' === filepath[1] && '\\' === filepath[2]) {
    return true;
  }
  // Microsoft Azure absolute filepath
  if ('\\\\' == filepath.substring(0, 2)) {
    return true;
  }
  if (!isRelative(filepath)) {
    return true;
  }
};





© 2015 - 2024 Weber Informatics LLC | Privacy Policy