From dcdb77e904e4c2571b159e7fffbb463de6ca0f57 Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Mon, 12 Feb 2024 14:03:39 -0800 Subject: [PATCH] chore(api-rest): manual fix of errors reported by yarn lint --- packages/api-rest/src/apis/server.ts | 1 - packages/api-rest/src/utils/createCancellableOperation.ts | 4 ++-- packages/api-rest/src/utils/resolveHeaders.ts | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/api-rest/src/apis/server.ts b/packages/api-rest/src/apis/server.ts index 0314542a205..78dd984d321 100644 --- a/packages/api-rest/src/apis/server.ts +++ b/packages/api-rest/src/apis/server.ts @@ -54,7 +54,6 @@ import { * }, * }); * ``` - * @see {@link clientGet} */ export const get = ( contextSpec: AmplifyServer.ContextSpec, diff --git a/packages/api-rest/src/utils/createCancellableOperation.ts b/packages/api-rest/src/utils/createCancellableOperation.ts index 0402834b6e1..f75010faabe 100644 --- a/packages/api-rest/src/utils/createCancellableOperation.ts +++ b/packages/api-rest/src/utils/createCancellableOperation.ts @@ -36,10 +36,10 @@ export function createCancellableOperation( abortController?: AbortController, ): Operation | Promise { const isInternalPost = ( - handler: + targetHandler: | ((signal: AbortSignal) => Promise) | (() => Promise), - ): handler is () => Promise => !!abortController; + ): targetHandler is () => Promise => !!abortController; // For creating a cancellable operation for public REST APIs, we need to create an AbortController // internally. Whereas for internal POST APIs, we need to accept in the AbortController from the diff --git a/packages/api-rest/src/utils/resolveHeaders.ts b/packages/api-rest/src/utils/resolveHeaders.ts index b7b165c10c2..f83920970fe 100644 --- a/packages/api-rest/src/utils/resolveHeaders.ts +++ b/packages/api-rest/src/utils/resolveHeaders.ts @@ -6,7 +6,6 @@ export const resolveHeaders = ( body?: unknown, ) => { const normalizedHeaders: Record = {}; - const isFormData = body instanceof FormData; for (const key in headers) { normalizedHeaders[key.toLowerCase()] = headers[key]; }