0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-24 02:07:30 +01:00

refactor(utils/body): shorten the code (#3353)

This commit is contained in:
Yusuke Wada 2024-09-01 17:41:16 +09:00 committed by GitHub
parent e4cc5aae73
commit 7593e75aca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 })
}