We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
readonly
RequestInit
It'd be good to remove readonly modifier from RequestInit typings to match https://github.com/microsoft/TypeScript/blob/95731f03979985609c9fd662f179be5b9cea3470/lib/lib.dom.d.ts#L1470. This would allow for RequestInit objects to be conditionally mutated like so https://github.com/ferdikoomen/openapi-typescript-codegen/blob/0f11ea84a9ca9867bb72700f468fa21d8085ce86/src/templates/core/fetch/sendRequest.hbs#L20
I'm happy to raise a PR for this if there are no objections.
If you try to mutate a RequestInit object, TypeScript will say something like:
Cannot assign to 'credentials' because it is a read-only property. ts(2540)
No error.
The text was updated successfully, but these errors were encountered:
PR welcome, make sure to include tests. We use tsd for testing types.
Sorry, something went wrong.
Thanks @KhafraDev, let me know if the test in #1446 isn't enough and I'll see what I can do
Successfully merging a pull request may close this issue.
Bug Description
It'd be good to remove
readonly
modifier fromRequestInit
typings to match https://github.com/microsoft/TypeScript/blob/95731f03979985609c9fd662f179be5b9cea3470/lib/lib.dom.d.ts#L1470. This would allow forRequestInit
objects to be conditionally mutated like so https://github.com/ferdikoomen/openapi-typescript-codegen/blob/0f11ea84a9ca9867bb72700f468fa21d8085ce86/src/templates/core/fetch/sendRequest.hbs#L20I'm happy to raise a PR for this if there are no objections.
Reproducible By
If you try to mutate a
RequestInit
object, TypeScript will say something like:Expected Behavior
No error.
Logs & Screenshots
Environment
Additional context
The text was updated successfully, but these errors were encountered: