Skip to content

Commit 1059d8a

Browse files
authored
Merge pull request #363 from platformsh/fix-allow-null-data
fix: allow null data
2 parents b84922c + b68499e commit 1059d8a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (isNode) {
2727
defaultHeaders["Content-Type"] = "application/json";
2828
}
2929

30-
const isFormData = (data: FormData | object | undefined) =>
30+
const isFormData = (data: FormData | object | null | undefined) =>
3131
typeof FormData !== "undefined" && data instanceof FormData;
3232

3333
// To transform header value string to an object:
@@ -60,7 +60,7 @@ const getChallengeExtraParams = (headers: Headers): Record<string, string> => {
6060
export const request = async (
6161
url: string,
6262
method: string,
63-
data?: FormData | object | undefined,
63+
data?: FormData | object | null | undefined,
6464
additionalHeaders: Record<string, string> = {},
6565
retryNumber = 0,
6666
options: RequestOptions = {},
@@ -186,7 +186,7 @@ export const request = async (
186186
export const authenticatedRequest = async (
187187
url: string,
188188
method = "GET",
189-
data?: FormData | object | undefined,
189+
data?: FormData | object | null | undefined,
190190
additionalHeaders: Record<string, string> = {},
191191
retryNumber = 0,
192192
options: RequestOptions = {},

0 commit comments

Comments
 (0)