imean-service-engine 2.0.2 → 2.0.3
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/dist/index.js +10 -1
- package/dist/index.mjs +10 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2192,10 +2192,19 @@ var RoutePlugin = class {
|
|
|
2192
2192
|
}
|
|
2193
2193
|
try {
|
|
2194
2194
|
const result = await method.call(moduleInstance, ctx);
|
|
2195
|
+
if (result === void 0) {
|
|
2196
|
+
return new Response(null, { status: 204 });
|
|
2197
|
+
}
|
|
2195
2198
|
if (result instanceof Response) {
|
|
2196
2199
|
return result;
|
|
2197
2200
|
}
|
|
2198
|
-
if (typeof result === "string"
|
|
2201
|
+
if (typeof result === "string") {
|
|
2202
|
+
return result;
|
|
2203
|
+
}
|
|
2204
|
+
if (result === null) {
|
|
2205
|
+
return result;
|
|
2206
|
+
}
|
|
2207
|
+
if (typeof result === "object" && result !== null && "type" in result && (typeof result.type === "function" || typeof result.type === "string")) {
|
|
2199
2208
|
return result;
|
|
2200
2209
|
}
|
|
2201
2210
|
return ctx.json(result);
|
package/dist/index.mjs
CHANGED
|
@@ -2167,10 +2167,19 @@ var RoutePlugin = class {
|
|
|
2167
2167
|
}
|
|
2168
2168
|
try {
|
|
2169
2169
|
const result = await method.call(moduleInstance, ctx);
|
|
2170
|
+
if (result === void 0) {
|
|
2171
|
+
return new Response(null, { status: 204 });
|
|
2172
|
+
}
|
|
2170
2173
|
if (result instanceof Response) {
|
|
2171
2174
|
return result;
|
|
2172
2175
|
}
|
|
2173
|
-
if (typeof result === "string"
|
|
2176
|
+
if (typeof result === "string") {
|
|
2177
|
+
return result;
|
|
2178
|
+
}
|
|
2179
|
+
if (result === null) {
|
|
2180
|
+
return result;
|
|
2181
|
+
}
|
|
2182
|
+
if (typeof result === "object" && result !== null && "type" in result && (typeof result.type === "function" || typeof result.type === "string")) {
|
|
2174
2183
|
return result;
|
|
2175
2184
|
}
|
|
2176
2185
|
return ctx.json(result);
|