Haha-Yes/node_modules/graceful-readlink/index.js
2018-09-09 21:20:36 +02:00

12 lines
188 B
JavaScript

var fs = require('fs')
, lstat = fs.lstatSync;
exports.readlinkSync = function (p) {
if (lstat(p).isSymbolicLink()) {
return fs.readlinkSync(p);
} else {
return p;
}
};