GT2/GT2-iOS/node_modules/istanbul-lib-source-maps/lib/pathutils.js

18 lines
502 B
JavaScript
Raw Normal View History

2018-02-12 17:26:06 +00:00
var path = require('path'),
isAbsolute = function (p) {
if (path.isAbsolute) {
return path.isAbsolute(p);
}
return path.resolve(p) === path.normalize(p);
};
exports.isAbsolute = isAbsolute;
exports.asAbsolute = function (file, baseDir) {
return isAbsolute(file) ? file : path.resolve(baseDir || process.cwd, file);
};
exports.relativeTo = function (file, origFile) {
return isAbsolute(file) ? file : path.resolve(path.dirname(origFile), file);
};