@sigiljs/sigil
Version:
TypeScript-first Node.js HTTP framework offering schema-driven routing, modifier-based middleware, plugin extensibility, and flexible response templating
2 lines (1 loc) • 851 B
JavaScript
;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../requests/containers/incoming-headers.js");class c{constructor(t,s=200,n){if(this.content=t,this.code=s,s<100||s>599)throw new Error("Invalid response code: "+s);this.headers=n instanceof r.default?n:new r.default(n)}headers}class o extends c{__$schemaName;__$raw;constructor(){super(null,200,{})}}class d extends c{constructor(t,s=200,n){super(t,s,n),this.content=t,this.code=s}static describe(t,s,n,a){const e=new o;return t&&(e.__$schemaName=t),e.content=s,e.code=n||200,e.headers=new r.default(a),e}static describeRaw(t,s,n,a){const e=new o;return t&&(e.__$schemaName=t),e.__$raw=!0,e.content=s,e.code=n||200,e.headers=new r.default(a),e}}exports.$InternalNamedSigilResponse=o;exports.BasicResponse=c;exports.default=d;