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.
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./?a[0]=b0&a[1]=b1
routes/my-repo/[...subpath].js
#get()
returns them concatenated with a comma, which is generally inconsistent withURLSearchParams#getAll
andFormData#getAll
.Would it make sense to create typed versions of
getAll
, like those ofget
, that operate on every member of the array? For example, for a given typeuuid
that verifies a string is a UUID, create agetAllUuid
function onrequest.{query,path,cookies,headers}
that evaluates all members of the property.