Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and github-actions[bot] committed May 5, 2022
1 parent 61e1a26 commit b5b95e4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ export interface AstroGlobal extends AstroGlobalPartial {
*/
request: Request;
/** Information about the outgoing response. This is a standard [ResponseInit](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#init) object
*
*
* For example, to change the status code you can set a different status on this object:
* ```typescript
* Astro.response.status = 404;
* ```
*
*
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#astroresponse)
*/
response: ResponseInit & {
readonly headers: Headers
readonly headers: Headers;
};
/** Redirect to another page (**SSR Only**)
*
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class App {
let headers = init.headers as Headers;
let bytes = this.#encoder.encode(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);
}

Expand Down
6 changes: 4 additions & 2 deletions packages/astro/src/core/render/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export interface RenderOptions {

export async function render(
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 {
links,
logging,
Expand Down Expand Up @@ -162,6 +164,6 @@ export async function render(
return {
type: 'html',
html,
response: result.response
response: result.response,
};
}
2 changes: 1 addition & 1 deletion packages/astro/src/core/render/dev/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface SSROptions {
export type ComponentPreload = [SSRLoadedRenderer[], ComponentInstance];

export type RenderResponse =
| { type: 'html'; html: string, response: ResponseInit }
| { type: 'html'; html: string; response: ResponseInit }
| { type: 'response'; response: Response };

const svelteStylesRE = /svelte\?svelte&type=style/;
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/src/core/render/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function createResult(args: CreateResultArgs): SSRResult {

const url = new URL(request.url);
const canonicalURL = createCanonicalURL('.' + pathname, site ?? url.origin);
const response: ResponseInit = {
const response: ResponseInit = {
status: 200,
statusText: 'OK',
headers: new Headers(),
Expand Down Expand Up @@ -215,7 +215,7 @@ ${extra}`
renderers,
pathname,
},
response
response,
};

return result;
Expand Down

0 comments on commit b5b95e4

Please sign in to comment.