Skip to content

Route match includes extra params #34

@whawker

Description

@whawker

I am using qs to append arbitrary URL params to a route.

However when I match this back, it returns the additional params I added.

I would expect the below example to return { alertId: "456", id: "123" }

var route = new Route('/feeditems/:id?useralertId=:alertId')

var myEndpoint = route.reverse({ id: 123, alertId: 456 })
// Appending extra params with qs
myEndpoint += '&' + qs.stringify({ extraParam: 'value' }) // /feeditems/123?useralertId=456&extraParam=value

route.match('/feeditems/123?useralertId=456&extraParam=value')
/*
Returns
{
  alertId: "456&extraParam=value",
  id: "123"
}
*/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions