Skip to content

Commit

Permalink
perf(shared): use non-capture group for resolveRoutePathFromUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Apr 11, 2024
1 parent 950f158 commit 6c3a037
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/src/utils/resolveRoutePathFromUrl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const resolveRoutePathFromUrl = (url: string, base = '/'): string => {
const pathname = url
// remove url origin
.replace(/^(https?:)?\/\/[^/]*/, '')
.replace(/^(?:https?:)?\/\/[^/]*/, '')

// remove site base
return pathname.startsWith(base)
Expand Down

0 comments on commit 6c3a037

Please sign in to comment.