route-parser
route-parser copied to clipboard
Query params order
Routes are matched correctly only if query parameters are specified in the right order.
var route = new Route('/?a=:a&b:b');
var result = route.match('/?b=1&a=2');
assert(result);
Would it possible to sort query params when route is parsed and when url is matched to avoid this problem?
Yeah, this is not the behaviour I would expect from "named parameters".
👍
Yeah this is super odd. I also notice if i do
let route = new Route('/users/:id(?foo=:foo)')
route.match('/users/123?foo=lol&rofl=true')
// output: { id: '123', foo: 'lol&rofl=true' }