export type Body = ConstructorParameters<typeof Response>[0];
export type ResponseOptions = ConstructorParameters<typeof Response>[1];

export function badRequest(body?: Body, options?: ResponseOptions): Response {
	return new Response(body, { status: 400, ...options });
}

export function html(body: Body, options?: ResponseOptions): Response {
	return new Response(body, {
		...options,
		headers: { 'Content-Type': 'text/html', ...options?.headers },
	});
}
