UNPKG

539 BJavaScriptView Raw
1import only from "only";
2
3/**
4 * suppose we have a protocol
5 * data start with ##, end whit ##
6 *
7 * # # {month} {date} {hour} {minute} {second} # #
8 * 23 23 09 12 08 08 20 23 23
9 */
10
11export default class Request {
12 header;
13 body;
14
15 constructor({ header, body }) {
16 this.header = header;
17 this.body = body;
18 }
19
20 /**
21 * Return JSON representation.
22 * We only bother showing settings.
23 *
24 * @return {Object}
25 * @api public
26 */
27
28 toJSON() {
29 return only(this, ["header", "body"]);
30 }
31}