Matching search params object/map/array #60
OliverJAsh
started this conversation in
Ideas
Replies: 1 comment
-
I agree that pattern syntax is not really fit for extracting search params since they can be re-ordered. My current expectation is that code that wants to get parameter values out would need to use We could consider adding some kind of map-like matching construct like you suggest in the future. It would be helpful to see use cases where it provides significant benefit over using just |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm curious whether we could match the search params using a richer structure than just
string
so that we don't need to worry about matching characters such as&
or=
. For example:For example, this would match a
search
of:foo=bar&abc=123
abc=456&foo=bar
I thought about whether we could re-use
URLSearchParams
but I'm not sure we can, because we don't want to encode characters for pattern matching. Perhaps we could introduce aURLSearchParamsPattern
. This would allow it to be used on its own.Beta Was this translation helpful? Give feedback.
All reactions