Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create Dispatcher#getAll(key) #97

Open
terrablue opened this issue Feb 27, 2024 · 0 comments
Open

create Dispatcher#getAll(key) #97

terrablue opened this issue Feb 27, 2024 · 0 comments

Comments

@terrablue
Copy link
Contributor

terrablue commented Feb 27, 2024

Dispatchers can often facade a multitude of values per key.

A Dispatcher#getAll(key: string): string[] function would return all values associated with a key.

  • query: /?a[0]=b0&a[1]=b1
  • path: routes/my-repo/[...subpath].js
  • cookies: ?
  • headers: Headers can contain multiple values. The WHATWG implementation of #get() returns them concatenated with a comma, which is generally inconsistent with URLSearchParams#getAll and FormData#getAll.

Would it make sense to create typed versions of getAll, like those of get, that operate on every member of the array? For example, for a given type uuid that verifies a string is a UUID, create a getAllUuid function on request.{query,path,cookies,headers} that evaluates all members of the property.

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

No branches or pull requests

1 participant