Skip to content

Commit 60ff22c

Browse files
committed
chore: Cleanup.
1 parent 645780e commit 60ff22c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/create-route-map.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,12 @@ function addRouteRecord (
144144
})
145145
}
146146

147-
if (!pathMap[record.path]) {
148-
if (!Object.values(pathMap).some(_record => {
149-
return _record.path !== '*' && record.path.match(_record.regex)
150-
})) {
151-
pathList.push(record.path)
152-
pathMap[record.path] = record
153-
}
147+
if (
148+
!pathMap[record.path] &&
149+
!Object.values(pathMap).some(r => r.path.indexOf('*') === -1 && record.path.match(r.regex))
150+
) {
151+
pathList.push(record.path)
152+
pathMap[record.path] = record
154153
}
155154

156155
if (route.alias !== undefined) {

0 commit comments

Comments
 (0)