Skip to content

Commit

Permalink
default case
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Dec 30, 2024
1 parent 206f046 commit 515f124
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export class AdWebAuthConnector {
#config;
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
#maxRetries = 3;
constructor(defaultConfig) {
this.#config = defaultConfig;
Expand Down Expand Up @@ -43,6 +44,11 @@ export class AdWebAuthConnector {
});
break;
}
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
default: {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
throw new Error(`Invalid method: ${this.#config.method}`);
}
}
return (await response.json());
}
Expand Down
5 changes: 5 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export class AdWebAuthConnector {

break
}
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
default: {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
throw new Error(`Invalid method: ${this.#config.method}`)
}
}

return (await response.json()) as boolean
Expand Down

0 comments on commit 515f124

Please sign in to comment.