Skip to content

Commit

Permalink
Add thing
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmaa committed Dec 16, 2024
1 parent 2f66a5b commit 316ede0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ext/js/comm/anki-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ export class AnkiConnect {
if (typeof result === 'object' && result !== null && !Array.isArray(result)) {
const apiError = /** @type {import('core').SerializableObject} */ (result).error;
if (typeof apiError !== 'undefined') {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
const error = new ExtensionError(`Anki error: ${apiError}`);
// eslint-disable-next-line @typescript-eslint/no-base-to-string
error.data = {action, params, status: response.status, apiError: typeof apiError === 'string' ? apiError : `${apiError}`};
throw error;
}
Expand Down
2 changes: 1 addition & 1 deletion types/ext/core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type TypeofResult = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol'
export type SafeAny = any;

/** This type is used as an explicit way of permitting the `Function` type. */
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-unsafe-function-type
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
export type SafeFunction = Function;

/** This type is used as an explicit way of permitting the `any` type. */
Expand Down

0 comments on commit 316ede0

Please sign in to comment.