Why are request cookie values typed as string | string[]
instead of just string
?
#1854
-
To clarify, this is an MSW 2 question, and I'm specifically talking about the import { http } from "msw";
export const handlers = [
http.get("/", ({ cookies }) => {
// `cookies` has type `Record<string,string|string[]>`
})
] I could be misunderstanding something, but I can't think of a circumstance where cookie values make sense to represent with an array? It's extra weird, since there are other places in the code where MSW represents cookies with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey, @ezzatron. Thanks for raising this. I believe this is a bug in types. While response cookies may have multi-value cookies, like Would you like to open a pull request to fix this? |
Beta Was this translation helpful? Give feedback.
Hey, @ezzatron. Thanks for raising this. I believe this is a bug in types. While response cookies may have multi-value cookies, like
Set-Cookie
, request cookies are always a flat[string]: string
map.Would you like to open a pull request to fix this?