From a55d570b9814d15d95c5eb1dfae8dd3c09b3a1e7 Mon Sep 17 00:00:00 2001 From: Ephraim Duncan <55143799+ephraimduncan@users.noreply.github.com> Date: Thu, 10 Sep 2026 10:44:06 +0000 Subject: [PATCH] fix(utils): keep the __proto__ header (#2680) * fix(utils): keep the __proto__ header * test(utils): remove header conversion test --- packages/utils/src/index.ts | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 4fef0aeb..70771944 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -1,34 +1,28 @@ export { assertSafeUrl, assertSafeUrlSync, safeUrlSchema } from "./ssrf"; export { - httpPayloadSchema, - type HttpPayload, - tpcPayloadSchema, - type TcpPayload, - DNSPayloadSchema, type DNSPayload, - icmpPayloadSchema, - grpcPayloadSchema, + DNSPayloadSchema, GRPC_TLS_MODES, - type IcmpPayload, type GrpcPayload, + grpcPayloadSchema, + type HttpPayload, + httpPayloadSchema, + type IcmpPayload, + icmpPayloadSchema, + type TcpPayload, + tpcPayloadSchema, } from "./payloads"; export { + MONITOR_JOB_TYPES, MONITOR_METHODS, MONITOR_STATUSES, - MONITOR_JOB_TYPES, } from "./constants"; export { buildCurlCommand, type CurlRequest } from "./curl"; -export { yieldMany, iteratorToStream } from "./stream"; -export { statusLabel, type PageUpdateStatus } from "./status"; +export { iteratorToStream, yieldMany } from "./stream"; +export { type PageUpdateStatus, statusLabel } from "./status"; -export function transformHeaders(headers: { key: string; value: string }[]) { - return headers.length > 0 - ? headers.reduce( - (acc, curr) => { - acc[curr.key] = curr.value; - return acc; - }, - {} as Record, - ) - : {}; +export function transformHeaders( + headers: { key: string; value: string }[], +): Record { + return Object.fromEntries(headers.map(({ key, value }) => [key, value])); } -- 2.51.2