Skip to content

Commit

Permalink
types: align RequestInit.body type with lib.dom.ts (#2956)
Browse files Browse the repository at this point in the history
Allow null.
  • Loading branch information
jdufresne committed Mar 14, 2024
1 parent 3577ade commit dae3182
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/types/fetch.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const requestInit2: RequestInit = {
const requestInit3: RequestInit = {}
// Test assignment. See https://github.com/whatwg/fetch/issues/1445
requestInit3.credentials = 'include'
const requestInit4: RequestInit = { body: null }

declare const request: Request
declare const headers: Headers
Expand Down
2 changes: 1 addition & 1 deletion types/fetch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export interface RequestInit {
method?: string
keepalive?: boolean
headers?: HeadersInit
body?: BodyInit
body?: BodyInit | null
redirect?: RequestRedirect
integrity?: string
signal?: AbortSignal | null
Expand Down

0 comments on commit dae3182

Please sign in to comment.