diff --git a/src/adapter/lambda-edge/handler.ts b/src/adapter/lambda-edge/handler.ts index 12e58ccdf..3f512d7b8 100644 --- a/src/adapter/lambda-edge/handler.ts +++ b/src/adapter/lambda-edge/handler.ts @@ -141,7 +141,7 @@ const createResult = async (res: Response): Promise => { status: res.status.toString(), headers: convertHeaders(res.headers), body, - ...(isBase64Encoded ? { bodyEncoding: 'base64' } : {}), + ...(isBase64Encoded && { bodyEncoding: 'base64' }), } } diff --git a/src/client/client.ts b/src/client/client.ts index 2d5edeff5..ec8eb24fe 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -80,12 +80,8 @@ class ClientRequestImpl { let methodUpperCase = this.method.toUpperCase() const headerValues: Record = { - ...(args?.header ?? {}), - ...(typeof opt?.headers === 'function' - ? await opt.headers() - : opt?.headers - ? opt.headers - : {}), + ...args?.header, + ...(typeof opt?.headers === 'function' ? await opt.headers() : opt?.headers), } if (args?.cookie) { @@ -201,7 +197,7 @@ export const hc = >( const req = new ClientRequestImpl(url, method) if (method) { options ??= {} - const args = deepMerge(options, { ...(opts.args[1] ?? {}) }) + const args = deepMerge(options, { ...opts.args[1] }) return req.fetch(opts.args[0], args) } return req diff --git a/src/middleware/jsx-renderer/index.ts b/src/middleware/jsx-renderer/index.ts index 195a02293..bda5ce976 100644 --- a/src/middleware/jsx-renderer/index.ts +++ b/src/middleware/jsx-renderer/index.ts @@ -44,7 +44,8 @@ const createRenderer = ? jsx( (props: any) => component(props, c), { - ...{ Layout, ...(props as any) }, + Layout, + ...(props as any), }, children as any )