module.exports = function (Component, Master) { const locals = Object.assign({}, this.app.locals, this.locals); let preamble = ''; let html; if (typeof Master === 'function') { preamble = ''; if (typeof Component === 'function') { return this.send(preamble + ( )); } Component = Master; } if (typeof Component !== 'function') { throw new Error('Not a Component'); } else if (Component.prototype && Component.prototype.render) { const instance = new Component(locals); html = instance.render(instance.props, instance.state); } else { html = Component(locals); } this.send(preamble ? preamble + html : html); };