diff --git a/src/adapter/lambda-edge/handler.ts b/src/adapter/lambda-edge/handler.ts index 12e58ccd..3f512d7b 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 2d5edeff..ec8eb24f 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 195a0229..bda5ce97 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 )