Skip to content

Commit 74f106c

Browse files
committed
refactor: simpler check exactPath
1 parent 825328e commit 74f106c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/util/route.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,9 @@ export function isSameRoute (a: Route, b: ?Route, onlyPath: ?boolean): boolean {
7676
} else if (!b) {
7777
return false
7878
} else if (a.path && b.path) {
79-
const isSamePath = a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '')
80-
return onlyPath ? isSamePath : (
81-
isSamePath &&
79+
return a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && (onlyPath ||
8280
a.hash === b.hash &&
83-
isObjectEqual(a.query, b.query)
84-
)
81+
isObjectEqual(a.query, b.query))
8582
} else if (a.name && b.name) {
8683
return (
8784
a.name === b.name &&

0 commit comments

Comments
 (0)