Skip to content

Commit

Permalink
fix: syntax error on ios, axios/axios#6608
Browse files Browse the repository at this point in the history
  • Loading branch information
ModyQyW committed Jan 6, 2025
1 parent 21c94e2 commit 2f51786
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/core/src/core/Un.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,10 @@ export class Un<T = UnData, D = UnData> {
return await this._request(configOrUrl, config);
} catch (error) {
if (error instanceof Error) {
// biome-ignore lint/suspicious/noImplicitAnyLet: <explanation>
let dummy;
let dummy: any = {};
Error.captureStackTrace
? // biome-ignore lint/suspicious/noAssignInExpressions: <explanation>
Error.captureStackTrace((dummy = {}))
: // biome-ignore lint/suspicious/noAssignInExpressions: <explanation>
? Error.captureStackTrace(dummy)
: // biome-ignore lint/suspicious/noAssignInExpressions: follow axios implementation
(dummy = new Error());
// slice off the Error: ... line
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
Expand Down

0 comments on commit 2f51786

Please # to comment.