From 61f723b8a8d5e6a609b52ca10b2ae7ba662e1f89 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Thu, 25 Jan 2024 09:28:26 -0600 Subject: [PATCH] chore(format): fix code formatting --- packages/next-drupal/src/client.ts | 15 ++++++--------- packages/next-drupal/src/utils.ts | 9 ++++----- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/next-drupal/src/client.ts b/packages/next-drupal/src/client.ts index 4cc4e4c9..97a3d4d2 100644 --- a/packages/next-drupal/src/client.ts +++ b/packages/next-drupal/src/client.ts @@ -215,7 +215,6 @@ export class DrupalClient { this.tokenExpiresOn = Date.now() + token.expires_in * 1000 } - /* eslint-disable @typescript-eslint/no-explicit-any */ async fetch(input: RequestInfo, init?: FetchOptions): Promise { init = { ...init, @@ -268,9 +267,8 @@ export class DrupalClient { init["headers"]["Authorization"] = `Bearer ${token.access_token}` } } else if (isAccessTokenAuth(this._auth)) { - init["headers"][ - "Authorization" - ] = `${this._auth.token_type} ${this._auth.access_token}` + init["headers"]["Authorization"] = + `${this._auth.token_type} ${this._auth.access_token}` } } } else if (typeof init.withAuth === "string") { @@ -297,9 +295,8 @@ export class DrupalClient { init["headers"]["Authorization"] = `Bearer ${token.access_token}` } } else if (isAccessTokenAuth(init.withAuth)) { - init["headers"][ - "Authorization" - ] = `${init.withAuth.token_type} ${init.withAuth.access_token}` + init["headers"]["Authorization"] = + `${init.withAuth.token_type} ${init.withAuth.access_token}` } } @@ -1419,8 +1416,8 @@ export class DrupalClient { } // Error handling. - // If throwErrors is enable, we show errors in the Next.js overlay. - // Otherwise we log the errors even if debugging is turned off. + // If throwErrors is enabled, we show errors in the Next.js overlay. + // Otherwise, we log the errors even if debugging is turned off. // In production, errors are always logged never thrown. private throwError(error: Error) { if (!this.throwJsonApiErrors) { diff --git a/packages/next-drupal/src/utils.ts b/packages/next-drupal/src/utils.ts index 996f94e6..dd8330ec 100644 --- a/packages/next-drupal/src/utils.ts +++ b/packages/next-drupal/src/utils.ts @@ -89,9 +89,8 @@ export async function buildHeaders({ // This reduces the number of OAuth call to the Drupal server. // Intentionally marked as unstable for now. if (process.env.UNSTABLE_DRUPAL_ACCESS_TOKEN) { - headers[ - "Authorization" - ] = `Bearer ${process.env.UNSTABLE_DRUPAL_ACCESS_TOKEN}` + headers["Authorization"] = + `Bearer ${process.env.UNSTABLE_DRUPAL_ACCESS_TOKEN}` return headers } @@ -122,8 +121,8 @@ export function getPathFromContext( return !slug ? process.env.DRUPAL_FRONT_PAGE : prefix - ? `${prefix}/${slug}` - : slug + ? `${prefix}/${slug}` + : slug } export function syncDrupalPreviewRoutes(path) {