From d418f0f3b342fc76e4a3f7f4c8aa9859922b74ca Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Wed, 21 Aug 2024 17:06:54 -0700 Subject: [PATCH] chore: resolve most of the comments from cshfang cont. --- .../serialization/createEmptyResponseDeserializer.ts | 8 +++----- .../shared/serialization/createUserPoolDeserializer.ts | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/auth/src/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serialization/createEmptyResponseDeserializer.ts b/packages/auth/src/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serialization/createEmptyResponseDeserializer.ts index 005c28e4570..a27f4ef0564 100644 --- a/packages/auth/src/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serialization/createEmptyResponseDeserializer.ts +++ b/packages/auth/src/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serialization/createEmptyResponseDeserializer.ts @@ -8,10 +8,9 @@ import { import { assertServiceError } from '../../../../../../errors/utils/assertServiceError'; import { AuthError } from '../../../../../../errors/AuthError'; -export const createEmptyResponseDeserializer = (): (( - response: HttpResponse, -) => Promise) => { - return async (response: HttpResponse): Promise => { +export const createEmptyResponseDeserializer = + (): ((response: HttpResponse) => Promise) => + async (response: HttpResponse): Promise => { if (response.statusCode >= 300) { const error = await parseJsonError(response); assertServiceError(error); @@ -20,4 +19,3 @@ export const createEmptyResponseDeserializer = (): (( return undefined; } }; -}; diff --git a/packages/auth/src/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serialization/createUserPoolDeserializer.ts b/packages/auth/src/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serialization/createUserPoolDeserializer.ts index 07a4214f5f0..dc9c16d7d9f 100644 --- a/packages/auth/src/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serialization/createUserPoolDeserializer.ts +++ b/packages/auth/src/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serialization/createUserPoolDeserializer.ts @@ -10,10 +10,9 @@ import { import { assertServiceError } from '../../../../../../errors/utils/assertServiceError'; import { AuthError } from '../../../../../../errors/AuthError'; -export const createUserPoolDeserializer = (): (( - response: HttpResponse, -) => Promise) => { - return async (response: HttpResponse): Promise => { +export const createUserPoolDeserializer = + (): ((response: HttpResponse) => Promise) => + async (response: HttpResponse): Promise => { if (response.statusCode >= 300) { const error = await parseJsonError(response); assertServiceError(error); @@ -22,4 +21,3 @@ export const createUserPoolDeserializer = (): (( return parseJsonBody(response); }; -};