UNPKG

@cashfarm/tractor

Version:

A Hapi server with superpowers

33 lines 930 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const lang_1 = require("@cashfarm/lang"); class Request { constructor(params, query, payload) { this.params = params; this.query = query; this.payload = payload; this.deserializeData(); } deserializeData() { const data = {}; if (this.params) { Object.keys(this.payload).forEach(k => { data[k] = this.payload[k]; }); } if (this.payload) { Object.keys(this.payload).forEach(k => { data[k] = this.payload[k]; }); } if (this.query) { Object.keys(this.query).forEach(k => { data[k] = this.query[k]; }); } lang_1.hydrate(this, data); } } exports.Request = Request; exports.default = Request; //# sourceMappingURL=request.js.map