Skip to content

Commit eef9ad4

Browse files
jcubicbilliegoose
authored andcommitted
fix: ignore trailing slash (#14)
1 parent e47c9c1 commit eef9ad4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/path.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ function splitPath(path) {
1919
if (path.length === 0) return [];
2020
if (path === "/") return ["/"];
2121
let parts = path.split("/");
22+
if (parts[parts.length - 1] === '') {
23+
parts.pop();
24+
}
2225
if (path[0] === "/") {
2326
// assert(parts[0] === '')
2427
parts[0] = "/";

0 commit comments

Comments
 (0)