mirror of
https://github.com/honojs/hono.git
synced 2024-11-21 10:08:58 +01:00
refactor: remove useless spread (#3600)
* refactor: remove useless spread * refactor: remove useless spread fallback * refactor(adapter/lambda-edge): remove unneeded ternary operators * refactor: remove useless fallback --------- Co-authored-by: EdamAmex <121654029+EdamAme-x@users.noreply.github.com>
This commit is contained in:
parent
1af7e58ae0
commit
ae99d86d89
@ -141,7 +141,7 @@ const createResult = async (res: Response): Promise<CloudFrontResult> => {
|
||||
status: res.status.toString(),
|
||||
headers: convertHeaders(res.headers),
|
||||
body,
|
||||
...(isBase64Encoded ? { bodyEncoding: 'base64' } : {}),
|
||||
...(isBase64Encoded && { bodyEncoding: 'base64' }),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,12 +80,8 @@ class ClientRequestImpl {
|
||||
let methodUpperCase = this.method.toUpperCase()
|
||||
|
||||
const headerValues: Record<string, string> = {
|
||||
...(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 = <T extends Hono<any, any, any>>(
|
||||
const req = new ClientRequestImpl(url, method)
|
||||
if (method) {
|
||||
options ??= {}
|
||||
const args = deepMerge<ClientRequestOptions>(options, { ...(opts.args[1] ?? {}) })
|
||||
const args = deepMerge<ClientRequestOptions>(options, { ...opts.args[1] })
|
||||
return req.fetch(opts.args[0], args)
|
||||
}
|
||||
return req
|
||||
|
@ -44,7 +44,8 @@ const createRenderer =
|
||||
? jsx(
|
||||
(props: any) => component(props, c),
|
||||
{
|
||||
...{ Layout, ...(props as any) },
|
||||
Layout,
|
||||
...(props as any),
|
||||
},
|
||||
children as any
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user