Skip to content

Commit 18e1e84

Browse files
[autofix.ci] apply automated fixes
1 parent d49f07d commit 18e1e84

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

packages/callapi/src/hooks.ts

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -221,20 +221,16 @@ export type ValidationErrorContext<
221221
};
222222

223223
export type SuccessContext<
224-
TCallApiContext extends Pick<
225-
CallApiContext,
226-
"Data" | "InferredExtraOptions" | "Meta"
227-
> = DefaultCallApiContext,
224+
TCallApiContext extends Pick<CallApiContext, "Data" | "InferredExtraOptions" | "Meta"> =
225+
DefaultCallApiContext,
228226
> = RequestContext<TCallApiContext> & {
229227
data: NoInfer<TCallApiContext["Data"]>;
230228
response: Response;
231229
};
232230

233231
export type ResponseContext<
234-
TCallApiContext extends Pick<
235-
CallApiContext,
236-
"Data" | "ErrorData" | "InferredExtraOptions" | "Meta"
237-
> = DefaultCallApiContext,
232+
TCallApiContext extends Pick<CallApiContext, "Data" | "ErrorData" | "InferredExtraOptions" | "Meta"> =
233+
DefaultCallApiContext,
238234
> = RequestContext<TCallApiContext>
239235
& (
240236
| Prettify<CallApiResultSuccessVariant<TCallApiContext["Data"]>>
@@ -254,10 +250,8 @@ export type RequestErrorContext<
254250
};
255251

256252
export type ErrorContext<
257-
TCallApiContext extends Pick<
258-
CallApiContext,
259-
"ErrorData" | "InferredExtraOptions" | "Meta"
260-
> = DefaultCallApiContext,
253+
TCallApiContext extends Pick<CallApiContext, "ErrorData" | "InferredExtraOptions" | "Meta"> =
254+
DefaultCallApiContext,
261255
> = RequestContext<TCallApiContext>
262256
& (
263257
| {
@@ -271,18 +265,14 @@ export type ErrorContext<
271265
);
272266

273267
export type ResponseErrorContext<
274-
TCallApiContext extends Pick<
275-
CallApiContext,
276-
"ErrorData" | "InferredExtraOptions" | "Meta"
277-
> = DefaultCallApiContext,
268+
TCallApiContext extends Pick<CallApiContext, "ErrorData" | "InferredExtraOptions" | "Meta"> =
269+
DefaultCallApiContext,
278270
> = Extract<ErrorContext<TCallApiContext>, { error: PossibleHTTPError<TCallApiContext["ErrorData"]> }>
279271
& RequestContext<TCallApiContext>;
280272

281273
export type RetryContext<
282-
TCallApiContext extends Pick<
283-
CallApiContext,
284-
"ErrorData" | "InferredExtraOptions" | "Meta"
285-
> = DefaultCallApiContext,
274+
TCallApiContext extends Pick<CallApiContext, "ErrorData" | "InferredExtraOptions" | "Meta"> =
275+
DefaultCallApiContext,
286276
> = ErrorContext<TCallApiContext> & {
287277
retryAttemptCount: number;
288278
};

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)