Skip to content

Route.link: encode array searchParams as repeated keys (#92) - #106

Draft
nounder wants to merge 1 commit into
mainfrom
cursor/fix-92-link-searchparams-c215
Draft

Route.link: encode array searchParams as repeated keys (#92)#106
nounder wants to merge 1 commit into
mainfrom
cursor/fix-92-link-searchparams-c215

Conversation

@nounder

@nounder nounder commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Fixes #92

Summary

Route.link already supported search params, including typed schemaSearchParams. Array values were incorrectly stringified instead of encoded as repeated query keys (matching how decode already handles them).

Changes

  • Encode array search param values as repeated key=value entries
  • Regression tests for array and empty-array cases

Test plan

  • bun test test/Route.test.tsx
Open in Web Open in Cursor 

schemaSearchParams already decodes repeated query keys into arrays
(via Http.mapUrlSearchParams), but Route.link only ever stringified a
single value when encoding, producing a comma-joined value instead of
repeated key=value entries. Handle array values by appending each item
as its own query string entry, and add regression tests.

Co-authored-by: Ralph Gutkowski <nounder@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route.link doesn't support searchParams

2 participants