Skip to content

Commit 57e9a28

Browse files
matthewpastrobot-houston
authored andcommitted
[ci] format
1 parent 1048aca commit 57e9a28

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

  • packages/astro/src/core/endpoint

packages/astro/src/core/endpoint/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ export let ResponseWithEncoding: ReturnType<typeof initResponseWithEncoding>;
9696
// TODO Remove this after StackBlitz supports Node 18.
9797
let initResponseWithEncoding = () => {
9898
class LocalResponseWithEncoding extends Response {
99-
constructor(body: ResponseParameters[0], init: ResponseParameters[1], encoding?: BufferEncoding) {
99+
constructor(
100+
body: ResponseParameters[0],
101+
init: ResponseParameters[1],
102+
encoding?: BufferEncoding
103+
) {
100104
// If a body string is given, try to encode it to preserve the behaviour as simple objects.
101105
// We don't do the full handling as simple objects so users can control how headers are set instead.
102106
if (typeof body === 'string') {
@@ -109,9 +113,9 @@ let initResponseWithEncoding = () => {
109113
body = encoder.encode(body);
110114
}
111115
}
112-
116+
113117
super(body, init);
114-
118+
115119
if (encoding) {
116120
this.headers.set('X-Astro-Encoding', encoding);
117121
}
@@ -125,7 +129,7 @@ let initResponseWithEncoding = () => {
125129
initResponseWithEncoding = (() => {}) as any;
126130

127131
return LocalResponseWithEncoding;
128-
}
132+
};
129133

130134
export async function callEndpoint<MiddlewareResult = Response | EndpointOutput>(
131135
mod: EndpointHandler,

0 commit comments

Comments
 (0)