UNPKG

@warp-works/warpjs-utils

Version:

Utility functions for WarpJS and plugins

14 lines (12 loc) 307 B
const _ = require('lodash'); module.exports = (res, formats) => { if (formats.default) { res.format(formats); } else { res.format(_.extend({}, formats, { default: () => { res.status(406).send("Unknown Accept header"); } })); } };