Urara-Blog/node_modules/.pnpm-store/v3/files/2c/13d406399480093dfcad6a2e7cc360c39c75504af3a146353fe71540e47c12fe3f29051e3d6539f739209606adfba6ed64f8ba7e5611e35d9a955a093d8ed3
2022-08-14 01:14:53 +08:00

23 lines
619 B
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.read = void 0;
function read(path, settings) {
const lstat = settings.fs.lstatSync(path);
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
return lstat;
}
try {
const stat = settings.fs.statSync(path);
if (settings.markSymbolicLink) {
stat.isSymbolicLink = () => true;
}
return stat;
}
catch (error) {
if (!settings.throwErrorOnBrokenSymbolicLink) {
return lstat;
}
throw error;
}
}
exports.read = read;