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

Improve headers types #64

Open
StarpTech opened this issue Aug 29, 2022 · 1 comment
Open

Improve headers types #64

StarpTech opened this issue Aug 29, 2022 · 1 comment

Comments

@StarpTech
Copy link

StarpTech commented Aug 29, 2022

Headers supports an array of values new Headers({ "foo": ["a", "b"] }) but this isn't reflected in the types.
It results in { "foo": "a,b" }.

Would you accept a PR?

@Gozala
Copy link
Contributor

Gozala commented Aug 28, 2023

Hey @StarpTech having more accurate types would be awesome, that said I'm not sure if diverging from the stock TS types would be a good idea and currently unfortunately this is what I see in TS playground

image

I think this should be fixed on TS side, this library simply tells TS that Headers come from globals (even though node mapped version does something else)

export const { Headers, Request, Response } = globalThis;

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

2 participants