mirror of
https://github.com/honojs/hono.git
synced 2024-11-21 18:18:57 +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(),
|
status: res.status.toString(),
|
||||||
headers: convertHeaders(res.headers),
|
headers: convertHeaders(res.headers),
|
||||||
body,
|
body,
|
||||||
...(isBase64Encoded ? { bodyEncoding: 'base64' } : {}),
|
...(isBase64Encoded && { bodyEncoding: 'base64' }),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,12 +80,8 @@ class ClientRequestImpl {
|
|||||||
let methodUpperCase = this.method.toUpperCase()
|
let methodUpperCase = this.method.toUpperCase()
|
||||||
|
|
||||||
const headerValues: Record<string, string> = {
|
const headerValues: Record<string, string> = {
|
||||||
...(args?.header ?? {}),
|
...args?.header,
|
||||||
...(typeof opt?.headers === 'function'
|
...(typeof opt?.headers === 'function' ? await opt.headers() : opt?.headers),
|
||||||
? await opt.headers()
|
|
||||||
: opt?.headers
|
|
||||||
? opt.headers
|
|
||||||
: {}),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args?.cookie) {
|
if (args?.cookie) {
|
||||||
@ -201,7 +197,7 @@ export const hc = <T extends Hono<any, any, any>>(
|
|||||||
const req = new ClientRequestImpl(url, method)
|
const req = new ClientRequestImpl(url, method)
|
||||||
if (method) {
|
if (method) {
|
||||||
options ??= {}
|
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.fetch(opts.args[0], args)
|
||||||
}
|
}
|
||||||
return req
|
return req
|
||||||
|
@ -44,7 +44,8 @@ const createRenderer =
|
|||||||
? jsx(
|
? jsx(
|
||||||
(props: any) => component(props, c),
|
(props: any) => component(props, c),
|
||||||
{
|
{
|
||||||
...{ Layout, ...(props as any) },
|
Layout,
|
||||||
|
...(props as any),
|
||||||
},
|
},
|
||||||
children as any
|
children as any
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user