remult 0.14.27 → 0.14.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/remult-middleware.js +3 -3
- package/package.json +1 -1
- package/remult-middleware.js +3 -3
package/esm/remult-middleware.js
CHANGED
|
@@ -44,18 +44,18 @@ class middleware {
|
|
|
44
44
|
return new Promise(res => {
|
|
45
45
|
const response = new class {
|
|
46
46
|
json(data) {
|
|
47
|
-
if (gRes)
|
|
47
|
+
if (gRes !== undefined)
|
|
48
48
|
gRes.json(data);
|
|
49
49
|
res({ statusCode: this.statusCode, data });
|
|
50
50
|
}
|
|
51
51
|
status(statusCode) {
|
|
52
|
-
if (gRes)
|
|
52
|
+
if (gRes !== undefined)
|
|
53
53
|
gRes.status(statusCode);
|
|
54
54
|
this.statusCode = statusCode;
|
|
55
55
|
return this;
|
|
56
56
|
}
|
|
57
57
|
end() {
|
|
58
|
-
if (gRes)
|
|
58
|
+
if (gRes !== undefined)
|
|
59
59
|
gRes.end();
|
|
60
60
|
res({
|
|
61
61
|
statusCode: this.statusCode
|
package/package.json
CHANGED
package/remult-middleware.js
CHANGED
|
@@ -54,18 +54,18 @@ var middleware = /** @class */ (function () {
|
|
|
54
54
|
function class_1() {
|
|
55
55
|
}
|
|
56
56
|
class_1.prototype.json = function (data) {
|
|
57
|
-
if (gRes)
|
|
57
|
+
if (gRes !== undefined)
|
|
58
58
|
gRes.json(data);
|
|
59
59
|
res({ statusCode: this.statusCode, data: data });
|
|
60
60
|
};
|
|
61
61
|
class_1.prototype.status = function (statusCode) {
|
|
62
|
-
if (gRes)
|
|
62
|
+
if (gRes !== undefined)
|
|
63
63
|
gRes.status(statusCode);
|
|
64
64
|
this.statusCode = statusCode;
|
|
65
65
|
return this;
|
|
66
66
|
};
|
|
67
67
|
class_1.prototype.end = function () {
|
|
68
|
-
if (gRes)
|
|
68
|
+
if (gRes !== undefined)
|
|
69
69
|
gRes.end();
|
|
70
70
|
res({
|
|
71
71
|
statusCode: this.statusCode
|