1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-02 16:08:31 +00:00

Fix routing issues. (Closes #407)

This commit is contained in:
SirStendec 2018-04-08 15:03:40 -04:00
parent c5564150b1
commit 6fd2e8a2ba

View file

@ -79,7 +79,11 @@ export default class FineRouter extends Module {
}
const parts = parse(path),
score = parts.length,
score = parts.reduce((total, val) => total + (
typeof val === 'string' ?
val.split('/').length - 1 :
0
), 0),
route = this.routes[name] = {
name,
parts,
@ -89,6 +93,6 @@ export default class FineRouter extends Module {
}
this.__routes.push(route);
this.__routes.sort(r => r.score);
this.__routes.sort((a,b) => b.score - a.score);
}
}