@centeredgesoft/runtime-mock-routes 2.10.1 → 2.10.2
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/build/src/appV2.js +4 -1
- package/package.json +1 -1
- package/src/appV2.ts +7 -3
package/build/src/appV2.js
CHANGED
|
@@ -192,9 +192,12 @@ const appFactory = (runtimeCollection) => {
|
|
|
192
192
|
headers: req.headers
|
|
193
193
|
};
|
|
194
194
|
if (method.status) {
|
|
195
|
-
|
|
195
|
+
let status = typeof method.status === 'function'
|
|
196
196
|
? method.status(tokenParams)
|
|
197
197
|
: method.status;
|
|
198
|
+
if (typeof status === 'string') {
|
|
199
|
+
status = parseInt(status);
|
|
200
|
+
}
|
|
198
201
|
res.status(status);
|
|
199
202
|
}
|
|
200
203
|
if (method.headers) {
|
package/package.json
CHANGED
package/src/appV2.ts
CHANGED
|
@@ -245,9 +245,13 @@ export const appFactory = (runtimeCollection?: RuntimeRequestCollection) => {
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
if (method.status) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
let status = typeof method.status === 'function'
|
|
249
|
+
? method.status(tokenParams)
|
|
250
|
+
: method.status
|
|
251
|
+
|
|
252
|
+
if (typeof status === 'string') {
|
|
253
|
+
status = parseInt(status);
|
|
254
|
+
}
|
|
251
255
|
|
|
252
256
|
res.status(status);
|
|
253
257
|
}
|