Skip to content

Commit

Permalink
Code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Sep 20, 2024
1 parent 8dff3bf commit 2e315e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class Client {
*/
async verifyKey(): Promise<boolean> {
try {
const response = await this.#fetch("1.1/verify-key", {});
const response = await this.#fetch("1.1/verify-key");
return await response.text() == "valid";
}
catch {
Expand All @@ -111,7 +111,7 @@ export class Client {
* @param fields The fields describing the query body.
* @returns The server response.
*/
async #fetch(endpoint: string, fields: Record<string, any>): Promise<Response> {
async #fetch(endpoint: string, fields: Record<string, any> = {}): Promise<Response> {
const body = new URLSearchParams({...this.blog.toJSON(), api_key: this.apiKey});
if (this.isTest) body.set("is_test", "1");

Expand Down

0 comments on commit 2e315e4

Please sign in to comment.