()
| 3445 | // Walk down the path, swapping out linked path parts for their real |
| 3446 | // values |
| 3447 | function LOOP() { |
| 3448 | // Stop if scanned past end of path |
| 3449 | if (pos >= p.length) { |
| 3450 | return callback(null, encodeRealpathResult(p, options)); |
| 3451 | } |
| 3452 | |
| 3453 | // find the next part |
| 3454 | const result = nextPart(p, pos); |
| 3455 | previous = current; |
| 3456 | if (result === -1) { |
| 3457 | const last = StringPrototypeSlice(p, pos); |
| 3458 | current += last; |
| 3459 | base = previous + last; |
| 3460 | pos = p.length; |
| 3461 | } else { |
| 3462 | current += StringPrototypeSlice(p, pos, result + 1); |
| 3463 | base = previous + StringPrototypeSlice(p, pos, result); |
| 3464 | pos = result + 1; |
| 3465 | } |
| 3466 | |
| 3467 | // Continue if not a symlink, break if a pipe/socket |
| 3468 | if (knownHard.has(base)) { |
| 3469 | if (isFileType(statValues, S_IFIFO) || |
| 3470 | isFileType(statValues, S_IFSOCK)) { |
| 3471 | return callback(null, encodeRealpathResult(p, options)); |
| 3472 | } |
| 3473 | return process.nextTick(LOOP); |
| 3474 | } |
| 3475 | |
| 3476 | return fs.lstat(base, { bigint: true }, gotStat); |
| 3477 | } |
| 3478 | |
| 3479 | function gotStat(err, stats) { |
| 3480 | if (err) return callback(err); |
no test coverage detected
searching dependent graphs…