Skip to content

Commit f6ad637

Browse files
jdufresneKhafraDev
authored andcommitted
types: align RequestInit.body type with lib.dom.ts (nodejs#2956)
Allow null.
1 parent 6ef15c6 commit f6ad637

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

test/types/fetch.test-d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const requestInit2: RequestInit = {
3131
const requestInit3: RequestInit = {}
3232
// Test assignment. See https://github.com/whatwg/fetch/issues/1445
3333
requestInit3.credentials = 'include'
34+
const requestInit4: RequestInit = { body: null }
3435

3536
declare const request: Request
3637
declare const headers: Headers

types/fetch.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export interface RequestInit {
122122
method?: string
123123
keepalive?: boolean
124124
headers?: HeadersInit
125-
body?: BodyInit
125+
body?: BodyInit | null
126126
redirect?: RequestRedirect
127127
integrity?: string
128128
signal?: AbortSignal | null

0 commit comments

Comments
 (0)