wallet-core/node_modules/istanbul-lib-source-maps/lib/pathutils.js

18 lines
502 B
JavaScript
Raw Normal View History

2017-05-28 00:38:50 +02: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);
};