Skip to content

Commit

Permalink
Fix: change method of removing trailing slash from url to support ios…
Browse files Browse the repository at this point in the history
… <17
  • Loading branch information
olliescase committed Sep 3, 2024
1 parent 7ea0ec7 commit f9b5200
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime/utils/formatter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export function trimTrailingSlash(path: string): string {
return path.replace(/(?<!^)\/$/, '')
if (path.length > 1 && path.slice(-1) === '/') {
return path.slice(0, -1);

Check failure on line 3 in src/runtime/utils/formatter.ts

View workflow job for this annotation

GitHub Actions / lint

Extra semicolon
}
return path;

Check failure on line 5 in src/runtime/utils/formatter.ts

View workflow job for this annotation

GitHub Actions / lint

Extra semicolon
}

0 comments on commit f9b5200

Please sign in to comment.