[ci] format
This commit is contained in:
parent
21e0757ea2
commit
b18d4bf3b1
3 changed files with 20 additions and 24 deletions
|
@ -91,12 +91,8 @@ export function createAPIContext({
|
|||
|
||||
type ResponseParameters = ConstructorParameters<typeof Response>;
|
||||
|
||||
export class ResponseWithEncoding extends Response {
|
||||
constructor(
|
||||
body: ResponseParameters[0],
|
||||
init: ResponseParameters[1],
|
||||
encoding?: BufferEncoding
|
||||
) {
|
||||
export class ResponseWithEncoding extends Response {
|
||||
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') {
|
||||
|
@ -116,7 +112,7 @@ type ResponseParameters = ConstructorParameters<typeof Response>;
|
|||
this.headers.set('X-Astro-Encoding', encoding);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function callEndpoint<MiddlewareResult = Response | EndpointOutput>(
|
||||
mod: EndpointHandler,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import crypto from 'node:crypto';
|
||||
import buffer from 'node:buffer';
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
export function apply() {
|
||||
// Remove when Node 18 is dropped for Node 20
|
||||
|
|
Loading…
Reference in a new issue