Skip to content

Commit

Permalink
Merge pull request #156 from techlove/hotfix/ios-16-2-regexp-doesnt-s…
Browse files Browse the repository at this point in the history
…upport-look-behinds

Fix: change method of removing trailing slash from url to support ios…
  • Loading branch information
manchenkoff authored Sep 3, 2024
2 parents 7ea0ec7 + 104b592 commit e0d5275
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)
}
return path
}

0 comments on commit e0d5275

Please sign in to comment.