[ci] format

This commit is contained in:
matthewp 2023-03-31 19:29:49 +00:00 committed by fredkbot
parent d54cbe4134
commit 9846b3e935
7 changed files with 17 additions and 8 deletions

View file

@ -202,7 +202,7 @@ export class App {
});
const response = await renderPage(mod, ctx, this.#env);
Reflect.set(request, responseSentSymbol, true)
Reflect.set(request, responseSentSymbol, true);
return response;
} catch (err: any) {
error(this.#logging, 'ssr', err.stack || err.message || String(err));

View file

@ -20,7 +20,10 @@ export const decoder = new TextDecoder();
// Rendering produces either marked strings of HTML or instructions for hydration.
// These directive instructions bubble all the way up to renderPage so that we
// can ensure they are added only once, and as soon as possible.
export function stringifyChunk(result: SSRResult, chunk: string | SlotString | RenderInstruction): string {
export function stringifyChunk(
result: SSRResult,
chunk: string | SlotString | RenderInstruction
): string {
if (typeof (chunk as any).type === 'string') {
const instruction = chunk as RenderInstruction;
switch (instruction.type) {

View file

@ -99,7 +99,11 @@ export async function writeWebResponse(res: http.ServerResponse, webResponse: Re
res.end();
}
export async function writeSSRResult(webRequest: Request, webResponse: Response, res: http.ServerResponse) {
export async function writeSSRResult(
webRequest: Request,
webResponse: Response,
res: http.ServerResponse
) {
Reflect.set(webRequest, Symbol.for('astro.responseSent'), true);
return writeWebResponse(res, webResponse);
}

View file

@ -31,7 +31,9 @@ describe('Astro.redirect', () => {
const text = await response.text();
expect(false).to.equal(true);
} catch (e) {
expect(e.message).to.equal('The response has already been sent to the browser and cannot be altered.');
expect(e.message).to.equal(
'The response has already been sent to the browser and cannot be altered.'
);
}
});
});