[ci] format

This commit is contained in:
matthewp 2022-05-05 16:22:41 +00:00 committed by github-actions[bot]
parent 61e1a267a8
commit b5b95e4fb4
5 changed files with 11 additions and 9 deletions

View file

@ -141,7 +141,7 @@ export interface AstroGlobal extends AstroGlobalPartial {
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#astroresponse) * [Astro reference](https://docs.astro.build/en/reference/api-reference/#astroresponse)
*/ */
response: ResponseInit & { response: ResponseInit & {
readonly headers: Headers readonly headers: Headers;
}; };
/** Redirect to another page (**SSR Only**) /** Redirect to another page (**SSR Only**)
* *

View file

@ -112,7 +112,7 @@ export class App {
let headers = init.headers as Headers; let headers = init.headers as Headers;
let bytes = this.#encoder.encode(html); let bytes = this.#encoder.encode(html);
headers.set('Content-Type', 'text/html'); headers.set('Content-Type', 'text/html');
headers.set('Content-Length', bytes.byteLength.toString()) headers.set('Content-Length', bytes.byteLength.toString());
return new Response(bytes, init); return new Response(bytes, init);
} }

View file

@ -84,7 +84,9 @@ export interface RenderOptions {
export async function render( export async function render(
opts: RenderOptions opts: RenderOptions
): Promise<{ type: 'html'; html: string, response: ResponseInit; } | { type: 'response'; response: Response }> { ): Promise<
{ type: 'html'; html: string; response: ResponseInit } | { type: 'response'; response: Response }
> {
const { const {
links, links,
logging, logging,
@ -162,6 +164,6 @@ export async function render(
return { return {
type: 'html', type: 'html',
html, html,
response: result.response response: result.response,
}; };
} }

View file

@ -45,7 +45,7 @@ export interface SSROptions {
export type ComponentPreload = [SSRLoadedRenderer[], ComponentInstance]; export type ComponentPreload = [SSRLoadedRenderer[], ComponentInstance];
export type RenderResponse = export type RenderResponse =
| { type: 'html'; html: string, response: ResponseInit } | { type: 'html'; html: string; response: ResponseInit }
| { type: 'response'; response: Response }; | { type: 'response'; response: Response };
const svelteStylesRE = /svelte\?svelte&type=style/; const svelteStylesRE = /svelte\?svelte&type=style/;

View file

@ -215,7 +215,7 @@ ${extra}`
renderers, renderers,
pathname, pathname,
}, },
response response,
}; };
return result; return result;