Skip to content

querystring params not working as expected #66

Open
@danwalkerdev

Description

@danwalkerdev

Describe the bug
In query.svelte.ts we're comparing the number of query parameters has the same length as inbound which is a Query object with 2 params, rather than inbound.params which is what we loop over to check for query string matches. When there are not 2 querystring params, the test will fail even if all the params match their tests.

To Reproduce
Steps to reproduce the behavior:

  1. Add a third parameter to e.g. this route in the demo
  2. Navigate to the route in the demo site
  3. The route is not found since, though all params match, Object.keys(matches).length is 3 but inbound keys length are still 2

Expected behavior
A route with 1 or >2 parameters should match

While testing, I also added a parameter to a single param route (to make it have two parameters) e.g. empty and set the value to 0. It seems that 0 fails to convert as a number correctly presumably because it's falsy

edit: opened PR here #67

Metadata

Metadata

Assignees

Labels

blockedbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions