Total Complexity | 3 |
Complexity/F | 3 |
Lines of Code | 13 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 50% |
Changes | 1 | ||
Bugs | 1 | Features | 1 |
1 | import App from "app"; |
||
2 | 4 | import qs from "qs"; |
|
3 | |||
4 | // parse querystring |
||
5 | App.service("ROUTER").addMiddleware("*", (context, next) => { |
||
6 | let query = context.canonicalPath; |
||
7 | 4 | if (query && query.length) { |
|
8 | 2 | query = query.split("?")[1] || ""; |
|
9 | } |
||
10 | |||
11 | 2 | context.query = qs.parse(query || location.search.slice(1)); |
|
12 | next(); |
||
13 | }); |
||
14 |