0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-23 17:57:29 +01:00

refactor(context): use simple for-of syntax (#3598)

This commit is contained in:
Taku Amano 2024-11-01 18:02:08 +09:00 committed by GitHub
parent ae99d86d89
commit 224ec367f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -266,8 +266,7 @@ export const TEXT_PLAIN = 'text/plain; charset=UTF-8'
* @returns The updated Headers object.
*/
const setHeaders = (headers: Headers, map: Record<string, string> = {}) => {
for (let i = 0, keys = Object.keys(map), len = keys.length; i < len; i++) {
const key = keys[i]
for (const key of Object.keys(map)) {
headers.set(key, map[key])
}
return headers