Skip to content

Commit

Permalink
Simplify if conditions in handleFragment
Browse files Browse the repository at this point in the history
  • Loading branch information
elvisvoer committed Feb 13, 2024
1 parent 494bef2 commit e1e3d8e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/b-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,9 @@ const posix = {
if (fragments.length && fragments[fragments.length - 1] !== "..") {
// navigate up but don't pop an existing ".."
fragments.pop();
} else if (absolute) {
// top reached and absolute path
fragments.push(posix.sep);
} else {
// top reached and relative path
} else if (!absolute) {
// top reached and relative path,
// absolute path is handled in the if (fragments.length === 0) below
fragments.push("..");
}
}
Expand Down

0 comments on commit e1e3d8e

Please sign in to comment.