| Server IP : 216.238.66.20 / Your IP : 216.73.216.248 Web Server : nginx/1.30.4 System : Linux woropds 5.15.0-187-generic #197-Ubuntu SMP Fri Jul 17 19:17:01 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/energia-cce.gamliel.mx/htdocs/energia-cce/node_modules/is-absolute/ |
Upload File : |
'use strict';
var isRelative = require('is-relative');
var isWindows = require('is-windows');
/**
* Expose `isAbsolute`
*/
module.exports = isAbsolute;
/**
* Returns true if a file path is absolute.
*
* @param {String} `fp`
* @return {Boolean}
*/
function isAbsolute(fp) {
if (typeof fp !== 'string') {
throw new TypeError('isAbsolute expects a string.');
}
return isWindows() ? isAbsolute.win32(fp) : isAbsolute.posix(fp);
}
/**
* Test posix paths.
*/
isAbsolute.posix = function posixPath(fp) {
return fp.charAt(0) === '/';
};
/**
* Test windows paths.
*/
isAbsolute.win32 = function win32(fp) {
if (/[a-z]/i.test(fp.charAt(0)) && fp.charAt(1) === ':' && fp.charAt(2) === '\\') {
return true;
}
// Microsoft Azure absolute filepath
if (fp.slice(0, 2) === '\\\\') {
return true;
}
return !isRelative(fp);
};