@hey-api/client-fetch
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -30,3 +30,3 @@ type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; | ||
declare const formDataBodySerializer: { | ||
bodySerializer: <T extends Record<string, any> | Record<string, any>[]>(body: T) => FormData; | ||
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T) => FormData; | ||
}; | ||
@@ -96,3 +96,8 @@ declare const jsonBodySerializer: { | ||
querySerializer?: QuerySerializer | QuerySerializerOptions; | ||
responseTransformer?: (data: unknown) => unknown; | ||
/** | ||
* A function for transforming response data before it's returned to the | ||
* caller function. This is an ideal place to post-process server data, | ||
* e.g. convert date ISO strings into native Date objects. | ||
*/ | ||
responseTransformer?: (data: unknown) => Promise<unknown>; | ||
} | ||
@@ -99,0 +104,0 @@ interface RequestOptionsBase extends Omit<Config, 'global'> { |
{ | ||
"name": "@hey-api/client-fetch", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Typesafe Fetch API client for your @hey-api/openapi-ts types", |
@@ -125,3 +125,3 @@ import type { Client, Config, RequestOptions } from './types'; | ||
if (parseAs === 'json' && options.responseTransformer) { | ||
data = options.responseTransformer(data); | ||
data = await options.responseTransformer(data); | ||
} | ||
@@ -128,0 +128,0 @@ |
@@ -93,4 +93,8 @@ import type { | ||
querySerializer?: QuerySerializer | QuerySerializerOptions; | ||
responseTransformer?: (data: unknown) => unknown; | ||
/** | ||
* A function for transforming response data before it's returned to the | ||
* caller function. This is an ideal place to post-process server data, | ||
* e.g. convert date ISO strings into native Date objects. | ||
*/ | ||
responseTransformer?: (data: unknown) => Promise<unknown>; | ||
} | ||
@@ -97,0 +101,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43017
970