blob: e7a40dd73bc351c257e4306bcb65c5018750526a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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;
}
};
|