diff options
Diffstat (limited to 'node_modules/is-absolute/index.js')
-rw-r--r-- | node_modules/is-absolute/index.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/node_modules/is-absolute/index.js b/node_modules/is-absolute/index.js new file mode 100644 index 000000000..e7a40dd73 --- /dev/null +++ b/node_modules/is-absolute/index.js @@ -0,0 +1,27 @@ +/*! + * is-absolute <https://github.com/jonschlinkert/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; + } +}; + |