From 7593e75aca1962a406f07c9dfbeb9bf84c0c0816 Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Sun, 1 Sep 2024 17:41:16 +0900 Subject: [PATCH] refactor(utils/body): shorten the code (#3353) --- src/utils/body.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/body.ts b/src/utils/body.ts index e67e284fa..81fff6a8f 100644 --- a/src/utils/body.ts +++ b/src/utils/body.ts @@ -101,8 +101,8 @@ export const parseBody: ParseBody = async ( const contentType = headers.get('Content-Type') if ( - (contentType !== null && contentType.startsWith('multipart/form-data')) || - (contentType !== null && contentType.startsWith('application/x-www-form-urlencoded')) + contentType?.startsWith('multipart/form-data') || + contentType?.startsWith('application/x-www-form-urlencoded') ) { return parseFormData(request, { all, dot }) }