@thisisagile/easy-test
Version:
Straightforward library for testing microservices built with @thisisagile/easy
26 lines • 656 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Req = void 0;
class Req {
constructor(state = {}) {
this.state = state;
this.get = (key) => this?.state[key.toString()] ?? this.path[key.toString()] ?? this.query[key.toString()];
}
get id() {
return this.state.id ?? this.path.id;
}
get q() {
return this.state.q ?? this.query.q;
}
get path() {
return this.state?.path ?? {};
}
get query() {
return this.state?.query ?? {};
}
get body() {
return this.state.body;
}
}
exports.Req = Req;
//# sourceMappingURL=Req.js.map