diff --git a/templates/base/http-clients/fetch-http-client.ejs b/templates/base/http-clients/fetch-http-client.ejs index a1db3833..05528604 100644 --- a/templates/base/http-clients/fetch-http-client.ejs +++ b/templates/base/http-clients/fetch-http-client.ejs @@ -104,9 +104,9 @@ export class HttpClient { private contentFormatters: Record any> = { [ContentType.Json]: (input:any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input:any) => input !== null && typeof input !== "string" ? JSON.stringify(input) : input, - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob ? diff --git a/tests/__snapshots__/extended.test.ts.snap b/tests/__snapshots__/extended.test.ts.snap index 383381c3..b9e2a8de 100644 --- a/tests/__snapshots__/extended.test.ts.snap +++ b/tests/__snapshots__/extended.test.ts.snap @@ -2362,9 +2362,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -4330,9 +4330,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -4564,9 +4564,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -4833,9 +4833,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -5730,9 +5730,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -6457,9 +6457,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -6767,9 +6767,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -7034,9 +7034,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -7350,9 +7350,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -8110,9 +8110,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -8634,9 +8634,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -8902,9 +8902,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -9213,9 +9213,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -9519,9 +9519,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -9841,9 +9841,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -10135,9 +10135,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -45516,9 +45516,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -58812,9 +58812,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -59790,9 +59790,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -60355,9 +60355,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -60683,9 +60683,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -60949,9 +60949,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -61260,9 +61260,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -61902,9 +61902,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -62409,9 +62409,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -62780,9 +62780,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -63176,9 +63176,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -63625,9 +63625,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -63957,9 +63957,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -64332,9 +64332,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -65140,9 +65140,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -65837,9 +65837,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -66175,9 +66175,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -66436,9 +66436,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -66684,9 +66684,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -66968,9 +66968,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -67639,9 +67639,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -68456,9 +68456,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -70165,9 +70165,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -70823,9 +70823,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -71116,9 +71116,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -71500,9 +71500,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/__snapshots__/simple.test.ts.snap b/tests/__snapshots__/simple.test.ts.snap index 3069a13c..6c90ff37 100644 --- a/tests/__snapshots__/simple.test.ts.snap +++ b/tests/__snapshots__/simple.test.ts.snap @@ -267,9 +267,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -2431,9 +2431,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -2665,9 +2665,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -2908,9 +2908,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -3288,9 +3288,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -4011,9 +4011,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -4305,9 +4305,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -4552,9 +4552,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -4814,9 +4814,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -5150,9 +5150,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -5757,9 +5757,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -6024,9 +6024,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -6335,9 +6335,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -6602,9 +6602,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -6883,9 +6883,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -7162,9 +7162,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -16046,9 +16046,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -35983,9 +35983,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -36511,9 +36511,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -37150,9 +37150,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -37487,9 +37487,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -37727,9 +37727,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -37974,9 +37974,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -38422,9 +38422,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -38864,9 +38864,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -39170,9 +39170,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -39477,9 +39477,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -39820,9 +39820,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -40149,9 +40149,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -40425,9 +40425,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -40793,9 +40793,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -41437,9 +41437,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -41745,9 +41745,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -42017,9 +42017,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -42246,9 +42246,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -42499,9 +42499,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -42876,9 +42876,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -43475,9 +43475,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -44614,9 +44614,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -45351,9 +45351,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -45664,9 +45664,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob @@ -45918,9 +45918,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/another-query-params/__snapshots__/basic.test.ts.snap b/tests/spec/another-query-params/__snapshots__/basic.test.ts.snap index a7e14867..b85aa18f 100644 --- a/tests/spec/another-query-params/__snapshots__/basic.test.ts.snap +++ b/tests/spec/another-query-params/__snapshots__/basic.test.ts.snap @@ -138,9 +138,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/custom-extensions/__snapshots__/basic.test.ts.snap b/tests/spec/custom-extensions/__snapshots__/basic.test.ts.snap index 2debf655..e336eddc 100644 --- a/tests/spec/custom-extensions/__snapshots__/basic.test.ts.snap +++ b/tests/spec/custom-extensions/__snapshots__/basic.test.ts.snap @@ -110,9 +110,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/defaultAsSuccess/__snapshots__/basic.test.ts.snap b/tests/spec/defaultAsSuccess/__snapshots__/basic.test.ts.snap index a246f891..8f89810c 100644 --- a/tests/spec/defaultAsSuccess/__snapshots__/basic.test.ts.snap +++ b/tests/spec/defaultAsSuccess/__snapshots__/basic.test.ts.snap @@ -150,9 +150,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/defaultResponse/__snapshots__/basic.test.ts.snap b/tests/spec/defaultResponse/__snapshots__/basic.test.ts.snap index 3286c88a..5f74ac10 100644 --- a/tests/spec/defaultResponse/__snapshots__/basic.test.ts.snap +++ b/tests/spec/defaultResponse/__snapshots__/basic.test.ts.snap @@ -110,9 +110,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/deprecated/__snapshots__/basic.test.ts.snap b/tests/spec/deprecated/__snapshots__/basic.test.ts.snap index d8ca8953..54c965f9 100644 --- a/tests/spec/deprecated/__snapshots__/basic.test.ts.snap +++ b/tests/spec/deprecated/__snapshots__/basic.test.ts.snap @@ -110,9 +110,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap b/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap index e4aad5ec..6c010950 100644 --- a/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap +++ b/tests/spec/dot-path-params/__snapshots__/basic.test.ts.snap @@ -112,9 +112,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/enumNamesAsValues/__snapshots__/basic.test.ts.snap b/tests/spec/enumNamesAsValues/__snapshots__/basic.test.ts.snap index 4a857127..0558c324 100644 --- a/tests/spec/enumNamesAsValues/__snapshots__/basic.test.ts.snap +++ b/tests/spec/enumNamesAsValues/__snapshots__/basic.test.ts.snap @@ -302,9 +302,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/extractRequestBody/__snapshots__/basic.test.ts.snap b/tests/spec/extractRequestBody/__snapshots__/basic.test.ts.snap index 88abe76a..58aa1cd4 100644 --- a/tests/spec/extractRequestBody/__snapshots__/basic.test.ts.snap +++ b/tests/spec/extractRequestBody/__snapshots__/basic.test.ts.snap @@ -263,9 +263,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/extractRequestParams/__snapshots__/basic.test.ts.snap b/tests/spec/extractRequestParams/__snapshots__/basic.test.ts.snap index ffbbe4ed..500b782f 100644 --- a/tests/spec/extractRequestParams/__snapshots__/basic.test.ts.snap +++ b/tests/spec/extractRequestParams/__snapshots__/basic.test.ts.snap @@ -185,9 +185,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/extractResponseBody/__snapshots__/basic.test.ts.snap b/tests/spec/extractResponseBody/__snapshots__/basic.test.ts.snap index 457907f3..0c02891e 100644 --- a/tests/spec/extractResponseBody/__snapshots__/basic.test.ts.snap +++ b/tests/spec/extractResponseBody/__snapshots__/basic.test.ts.snap @@ -265,9 +265,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/extractResponseError/__snapshots__/basic.test.ts.snap b/tests/spec/extractResponseError/__snapshots__/basic.test.ts.snap index 20d0b77e..d1223e75 100644 --- a/tests/spec/extractResponseError/__snapshots__/basic.test.ts.snap +++ b/tests/spec/extractResponseError/__snapshots__/basic.test.ts.snap @@ -260,9 +260,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/jsAxios/__snapshots__/basic.test.ts.snap b/tests/spec/jsAxios/__snapshots__/basic.test.ts.snap index d257b150..31252f46 100644 --- a/tests/spec/jsAxios/__snapshots__/basic.test.ts.snap +++ b/tests/spec/jsAxios/__snapshots__/basic.test.ts.snap @@ -64,8 +64,8 @@ export class HttpClient { input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), [ContentType.FormData]: (input) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/moduleNameFirstTag/__snapshots__/basic.test.ts.snap b/tests/spec/moduleNameFirstTag/__snapshots__/basic.test.ts.snap index 4541e3c8..2e47194a 100644 --- a/tests/spec/moduleNameFirstTag/__snapshots__/basic.test.ts.snap +++ b/tests/spec/moduleNameFirstTag/__snapshots__/basic.test.ts.snap @@ -235,9 +235,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/moduleNameIndex/__snapshots__/basic.test.ts.snap b/tests/spec/moduleNameIndex/__snapshots__/basic.test.ts.snap index dadd562c..c6d3878f 100644 --- a/tests/spec/moduleNameIndex/__snapshots__/basic.test.ts.snap +++ b/tests/spec/moduleNameIndex/__snapshots__/basic.test.ts.snap @@ -235,9 +235,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/on-insert-path-param/__snapshots__/basic.test.ts.snap b/tests/spec/on-insert-path-param/__snapshots__/basic.test.ts.snap index 81245bc5..200d62dc 100644 --- a/tests/spec/on-insert-path-param/__snapshots__/basic.test.ts.snap +++ b/tests/spec/on-insert-path-param/__snapshots__/basic.test.ts.snap @@ -110,9 +110,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/patch/__snapshots__/basic.test.ts.snap b/tests/spec/patch/__snapshots__/basic.test.ts.snap index 95c6dc6c..6c39459c 100644 --- a/tests/spec/patch/__snapshots__/basic.test.ts.snap +++ b/tests/spec/patch/__snapshots__/basic.test.ts.snap @@ -1867,9 +1867,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/responses/__snapshots__/basic.test.ts.snap b/tests/spec/responses/__snapshots__/basic.test.ts.snap index 7a0746de..eb65ce9a 100644 --- a/tests/spec/responses/__snapshots__/basic.test.ts.snap +++ b/tests/spec/responses/__snapshots__/basic.test.ts.snap @@ -150,9 +150,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/singleHttpClient/__snapshots__/basic.test.ts.snap b/tests/spec/singleHttpClient/__snapshots__/basic.test.ts.snap index d8ae13d8..01c6522f 100644 --- a/tests/spec/singleHttpClient/__snapshots__/basic.test.ts.snap +++ b/tests/spec/singleHttpClient/__snapshots__/basic.test.ts.snap @@ -110,9 +110,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap b/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap index 00daa650..52bd96cb 100644 --- a/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap +++ b/tests/spec/sortTypes-false/__snapshots__/basic.test.ts.snap @@ -1867,9 +1867,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/sortTypes/__snapshots__/basic.test.ts.snap b/tests/spec/sortTypes/__snapshots__/basic.test.ts.snap index ab7e8ad1..ade4d7d1 100644 --- a/tests/spec/sortTypes/__snapshots__/basic.test.ts.snap +++ b/tests/spec/sortTypes/__snapshots__/basic.test.ts.snap @@ -1867,9 +1867,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/typeSuffixPrefix/__snapshots__/basic.test.ts.snap b/tests/spec/typeSuffixPrefix/__snapshots__/basic.test.ts.snap index 2a0c78ef..730f11e3 100644 --- a/tests/spec/typeSuffixPrefix/__snapshots__/basic.test.ts.snap +++ b/tests/spec/typeSuffixPrefix/__snapshots__/basic.test.ts.snap @@ -1867,9 +1867,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob diff --git a/tests/spec/unionEnums/__snapshots__/basic.test.ts.snap b/tests/spec/unionEnums/__snapshots__/basic.test.ts.snap index 3a5d468e..7d590322 100644 --- a/tests/spec/unionEnums/__snapshots__/basic.test.ts.snap +++ b/tests/spec/unionEnums/__snapshots__/basic.test.ts.snap @@ -122,9 +122,9 @@ export class HttpClient { [ContentType.Json]: (input: any) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), - [ContentType.FormData]: (input: any) => - Object.keys(input || {}).reduce((formData, key) => { - const property = input[key]; + [ContentType.FormData]: (input: FormData) => + (Array.from(input.keys()) || []).reduce((formData, key) => { + const property = input.get(key); formData.append( key, property instanceof Blob