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
json fetch casting
The json function definition to be changed to allow the ability to specify a type
json
This is a minimal change that will require changing the line 3186 in the lib.dom.d.ts
3186
lib.dom.d.ts
from 3186 json(): Promise<any>; to 3186 json<T = any>(): Promise<T>;
3186 json(): Promise<any>;
3186 json<T = any>(): Promise<T>;
This simple change will allow calling the json function and organically feed the correct type instead of using type casting.
The text was updated successfully, but these errors were encountered:
Duplicate of #44603 / #30220. This has been rejected several times already.
Sorry, something went wrong.
No branches or pull requests
π Search Terms
json fetch casting
β Viability Checklist
β Suggestion
The
json
function definition to be changed to allow the ability to specify a typeThis is a minimal change that will require changing the line
3186
in thelib.dom.d.ts
from
3186 json(): Promise<any>;
to
3186 json<T = any>(): Promise<T>;
π Motivating Example
This simple change will allow calling the
json
function and organically feed the correct type instead of using type casting.π» Use Cases
The text was updated successfully, but these errors were encountered: