Skip to content

Commit

Permalink
refactor: simpler check exactPath
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jan 25, 2021
1 parent 825328e commit 74f106c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/util/route.js
Expand Up @@ -76,12 +76,9 @@ export function isSameRoute (a: Route, b: ?Route, onlyPath: ?boolean): boolean {
} else if (!b) {
return false
} else if (a.path && b.path) {
const isSamePath = a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '')
return onlyPath ? isSamePath : (
isSamePath &&
return a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && (onlyPath ||
a.hash === b.hash &&
isObjectEqual(a.query, b.query)
)
isObjectEqual(a.query, b.query))
} else if (a.name && b.name) {
return (
a.name === b.name &&
Expand Down

0 comments on commit 74f106c

Please sign in to comment.