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

stricter types for bodymixin.json #2181

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/types/dispatcher.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,5 @@ declare const { body }: Dispatcher.ResponseData;
expectType<Promise<Blob>>(body.blob())
expectType<Promise<never>>(body.formData())
expectType<Promise<string>>(body.text())
expectType<Promise<any>>(body.json())
expectType<Promise<unknown>>(body.json())
}
2 changes: 1 addition & 1 deletion test/types/readable.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ expectAssignable<BodyReadable>(new BodyReadable())
expectAssignable<Promise<string>>(readable.text())

// json
expectAssignable<Promise<any>>(readable.json())
expectAssignable<Promise<unknown>>(readable.json())

// blob
expectAssignable<Promise<Blob>>(readable.blob())
Expand Down
2 changes: 1 addition & 1 deletion types/dispatcher.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ declare namespace Dispatcher {
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
formData(): Promise<never>;
json(): Promise<any>;
json(): Promise<unknown>;
text(): Promise<string>;
}

Expand Down
2 changes: 1 addition & 1 deletion types/readable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare class BodyReadable extends Readable {
/** Consumes and returns the body as a JavaScript Object
* https://fetch.spec.whatwg.org/#dom-body-json
*/
json(): Promise<any>
json(): Promise<unknown>

/** Consumes and returns the body as a Blob
* https://fetch.spec.whatwg.org/#dom-body-blob
Expand Down