function searchParams(req) {
  return new URL(req.url, "http://localhost").searchParams;
}
const ApiResponse = {
  json(body, init) {
    const headers = new Headers(init?.headers);
    headers.set("Content-Type", "application/json");
    return new Response(JSON.stringify(body), {
      ...init,
      headers
    });
  },
  redirect(location, init) {
    const headers = new Headers(init?.headers);
    headers.set("Location", location.toString());
    return new Response(null, {
      status: 307,
      ...init,
      headers
    });
  }
};
export {
  ApiResponse,
  searchParams
};
//# sourceMappingURL=request-response.js.map