From 57e9a28063c28e5ad81034ca170291aba6084100 Mon Sep 17 00:00:00 2001 From: matthewp Date: Mon, 28 Aug 2023 15:59:37 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/endpoint/index.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/astro/src/core/endpoint/index.ts b/packages/astro/src/core/endpoint/index.ts index b8c7000fb..a3aff6dca 100644 --- a/packages/astro/src/core/endpoint/index.ts +++ b/packages/astro/src/core/endpoint/index.ts @@ -96,7 +96,11 @@ export let ResponseWithEncoding: ReturnType; // TODO Remove this after StackBlitz supports Node 18. let initResponseWithEncoding = () => { class LocalResponseWithEncoding extends Response { - constructor(body: ResponseParameters[0], init: ResponseParameters[1], encoding?: BufferEncoding) { + constructor( + body: ResponseParameters[0], + init: ResponseParameters[1], + encoding?: BufferEncoding + ) { // If a body string is given, try to encode it to preserve the behaviour as simple objects. // We don't do the full handling as simple objects so users can control how headers are set instead. if (typeof body === 'string') { @@ -109,9 +113,9 @@ let initResponseWithEncoding = () => { body = encoder.encode(body); } } - + super(body, init); - + if (encoding) { this.headers.set('X-Astro-Encoding', encoding); } @@ -125,7 +129,7 @@ let initResponseWithEncoding = () => { initResponseWithEncoding = (() => {}) as any; return LocalResponseWithEncoding; -} +}; export async function callEndpoint( mod: EndpointHandler,