Skip to content

Commit ea6f74b

Browse files
[autofix.ci] apply automated fixes
1 parent 91a8114 commit ea6f74b

File tree

4 files changed

+23
-45
lines changed

4 files changed

+23
-45
lines changed

packages/callapi/src/createFetchClient.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ export const createFetchClientWithContext = <
8989
{ Data: TBaseData; ErrorData: TBaseErrorData; ResultMode: TBaseResultMode }
9090
>,
9191
TComputedBaseSchemaConfig extends CallApiSchemaConfig = GetBaseSchemaConfig<TBaseSchemaAndConfig>,
92-
TComputedBaseSchemaRoutes extends
93-
BaseCallApiSchemaRoutes = GetBaseSchemaRoutes<TBaseSchemaAndConfig>,
92+
TComputedBaseSchemaRoutes extends BaseCallApiSchemaRoutes =
93+
GetBaseSchemaRoutes<TBaseSchemaAndConfig>,
9494
>(
9595
initBaseConfig: BaseCallApiConfig<
9696
TBaseCallApiContext,
@@ -120,10 +120,8 @@ export const createFetchClientWithContext = <
120120
TComputedBaseSchemaRoutes,
121121
TSchemaConfig
122122
>,
123-
TCurrentRouteSchemaKey extends GetCurrentRouteSchemaKey<
124-
TSchemaConfig,
125-
TInitURL
126-
> = GetCurrentRouteSchemaKey<TSchemaConfig, TInitURL>,
123+
TCurrentRouteSchemaKey extends GetCurrentRouteSchemaKey<TSchemaConfig, TInitURL> =
124+
GetCurrentRouteSchemaKey<TSchemaConfig, TInitURL>,
127125
const TSchema extends CallApiSchema = GetCurrentRouteSchema<
128126
TComputedBaseSchemaRoutes,
129127
TCurrentRouteSchemaKey

packages/callapi/src/hooks.ts

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,8 @@ export type ValidationErrorContext<
223223
>;
224224

225225
export type SuccessContext<
226-
TCallApiContext extends Pick<
227-
CallApiContext,
228-
"Data" | "InferredPluginOptions" | "Meta"
229-
> = DefaultCallApiContext,
226+
TCallApiContext extends Pick<CallApiContext, "Data" | "InferredPluginOptions" | "Meta"> =
227+
DefaultCallApiContext,
230228
> = UnmaskType<
231229
RequestContext<TCallApiContext> & {
232230
data: NoInfer<TCallApiContext["Data"]>;
@@ -235,10 +233,8 @@ export type SuccessContext<
235233
>;
236234

237235
export type ResponseContext<
238-
TCallApiContext extends Pick<
239-
CallApiContext,
240-
"Data" | "ErrorData" | "InferredPluginOptions" | "Meta"
241-
> = DefaultCallApiContext,
236+
TCallApiContext extends Pick<CallApiContext, "Data" | "ErrorData" | "InferredPluginOptions" | "Meta"> =
237+
DefaultCallApiContext,
242238
> = UnmaskType<
243239
RequestContext<TCallApiContext>
244240
& (
@@ -260,10 +256,8 @@ export type RequestErrorContext<
260256
};
261257

262258
export type ErrorContext<
263-
TCallApiContext extends Pick<
264-
CallApiContext,
265-
"ErrorData" | "InferredPluginOptions" | "Meta"
266-
> = DefaultCallApiContext,
259+
TCallApiContext extends Pick<CallApiContext, "ErrorData" | "InferredPluginOptions" | "Meta"> =
260+
DefaultCallApiContext,
267261
> = UnmaskType<
268262
RequestContext<TCallApiContext>
269263
& (
@@ -279,20 +273,16 @@ export type ErrorContext<
279273
>;
280274

281275
export type ResponseErrorContext<
282-
TCallApiContext extends Pick<
283-
CallApiContext,
284-
"ErrorData" | "InferredPluginOptions" | "Meta"
285-
> = DefaultCallApiContext,
276+
TCallApiContext extends Pick<CallApiContext, "ErrorData" | "InferredPluginOptions" | "Meta"> =
277+
DefaultCallApiContext,
286278
> = UnmaskType<
287279
Extract<ErrorContext<TCallApiContext>, { error: PossibleHTTPError<TCallApiContext["ErrorData"]> }>
288280
& RequestContext<TCallApiContext>
289281
>;
290282

291283
export type RetryContext<
292-
TCallApiContext extends Pick<
293-
CallApiContext,
294-
"ErrorData" | "InferredPluginOptions" | "Meta"
295-
> = DefaultCallApiContext,
284+
TCallApiContext extends Pick<CallApiContext, "ErrorData" | "InferredPluginOptions" | "Meta"> =
285+
DefaultCallApiContext,
296286
> = UnmaskType<
297287
ErrorContext<TCallApiContext> & {
298288
retryAttemptCount: number;

packages/callapi/src/result.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,8 @@ export type ResultModeMapWithoutException<
137137
TResponseType extends ResponseTypeType,
138138
TComputedData = GetResponseType<TData, TResponseType>,
139139
TComputedErrorData = GetResponseType<TErrorData, TResponseType>,
140-
TComputedResult extends CallApiSuccessOrErrorVariant<
141-
TComputedData,
142-
TComputedErrorData
143-
> = CallApiSuccessOrErrorVariant<TComputedData, TComputedErrorData>,
140+
TComputedResult extends CallApiSuccessOrErrorVariant<TComputedData, TComputedErrorData> =
141+
CallApiSuccessOrErrorVariant<TComputedData, TComputedErrorData>,
144142
> = UnmaskType<{
145143
all: TComputedResult;
146144
onlyData: TComputedResult["data"];
@@ -152,8 +150,8 @@ type ResultModeMapWithException<
152150
TData,
153151
TResponseType extends ResponseTypeType,
154152
TComputedData = GetResponseType<TData, TResponseType>,
155-
TComputedResult extends
156-
CallApiResultSuccessVariant<TComputedData> = CallApiResultSuccessVariant<TComputedData>,
153+
TComputedResult extends CallApiResultSuccessVariant<TComputedData> =
154+
CallApiResultSuccessVariant<TComputedData>,
157155
> = {
158156
all: TComputedResult;
159157
onlyData: TComputedResult["data"];
@@ -185,16 +183,10 @@ export type GetCallApiResult<
185183
TResultMode extends ResultModeType,
186184
TThrowOnError extends ThrowOnErrorUnion,
187185
TResponseType extends ResponseTypeType,
188-
TComputedResultModeMapWithException extends ResultModeMapWithException<
189-
TData,
190-
TResponseType
191-
> = ResultModeMapWithException<TData, TResponseType>,
192-
TComputedResultModeMap extends ResultModeMap<
193-
TData,
194-
TErrorData,
195-
TResponseType,
196-
TThrowOnError
197-
> = ResultModeMap<TData, TErrorData, TResponseType, TThrowOnError>,
186+
TComputedResultModeMapWithException extends ResultModeMapWithException<TData, TResponseType> =
187+
ResultModeMapWithException<TData, TResponseType>,
188+
TComputedResultModeMap extends ResultModeMap<TData, TErrorData, TResponseType, TThrowOnError> =
189+
ResultModeMap<TData, TErrorData, TResponseType, TThrowOnError>,
198190
> =
199191
TErrorData extends false ? TComputedResultModeMapWithException["onlyData"]
200192
: TErrorData extends false | undefined ? TComputedResultModeMapWithException["onlyData"]

packages/callapi/src/utils/external/error.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ const prettifyPath = (path: ValidationError["errorData"][number]["path"]) => {
7676
};
7777

7878
const prettifyValidationIssues = (issues: ValidationError["errorData"]) => {
79-
const issuesString = issues
80-
.map((issue) => `✖ ${issue.message}${prettifyPath(issue.path)}`)
81-
.join(" | ");
79+
const issuesString = issues.map((issue) => `✖ ${issue.message}${prettifyPath(issue.path)}`).join(" | ");
8280

8381
return issuesString;
8482
};

0 commit comments

Comments
 (0)