| 701 | const lstatReadlinkAbsolute = (fs, p, callback) => { |
| 702 | let i = 3; |
| 703 | const doReadLink = () => { |
| 704 | fs.readlink(p, (err, target) => { |
| 705 | if (err && --i > 0) { |
| 706 | // It might was just changed from symlink to file |
| 707 | // we retry 2 times to catch this case before throwing the error |
| 708 | return doStat(); |
| 709 | } |
| 710 | if (err) return callback(err); |
| 711 | const value = /** @type {string} */ (target).toString(); |
| 712 | callback(null, join(fs, dirname(fs, p), value)); |
| 713 | }); |
| 714 | }; |
| 715 | const doStat = () => { |
| 716 | if ("lstat" in fs) { |
| 717 | return /** @type {NonNullable<InputFileSystem["lstat"]>} */ (fs.lstat)( |