Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/*
* ResponseMap & related functions
* ResponseMap is for making response maps
* with chainable helper functions
*/
const core_response = require("../core/response")
const mime = require("send").mime
mime.default_type = undefined
class ResponseMap {
constructor(body) {
this.status = 200
this.headers = {}
this.body = body || ""
}
statusCode(n) {
this.status = parseInt(n)
return this
}
type(content_type) {
let t = mime.lookup(content_type)
if (!t) {