@sigiljs/sigil
Version:
TypeScript-first Node.js HTTP framework offering schema-driven routing, modifier-based middleware, plugin extensibility, and flexible response templating
18 lines (17 loc) • 592 B
JavaScript
import p from "./sigil-response.mjs";
class o extends p {
/**
* Constructs a new RawResponse.
*
* @param body - The response payload, can be any type.
* @param headers - Optional HTTP headers or init object. If omitted and `body` is an object,
* `Content-Type: application/json` will be set automatically.
* @param code - Optional HTTP status code. Defaults to 200.
*/
constructor(e, s, t) {
!s && typeof e == "object" && !Buffer.isBuffer(e) ? super(e, t ?? 200, { "content-type": "application/json" }) : super(e, t ?? 200, s);
}
}
export {
o as default
};