@shushed/helpers 0.0.198-v2-20251110170231 → 0.0.198-v2-20251110205114
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.
|
@@ -269,14 +269,13 @@ function onResponse(config, options, requiredFlag) {
|
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
let responsePayload;
|
|
272
|
-
if (outputBody
|
|
272
|
+
if (outputBody?.headersToSet && outputBody?.body) {
|
|
273
273
|
responsePayload = outputBody.body;
|
|
274
|
-
headersToSet = outputBody.headersToSet;
|
|
275
274
|
}
|
|
276
275
|
else {
|
|
277
276
|
responsePayload = outputBody;
|
|
278
277
|
}
|
|
279
|
-
if (Array.isArray(responsePayload) && responsePayload.length === numberOfInputMessages) {
|
|
278
|
+
if (responsePayload && Array.isArray(responsePayload) && responsePayload.length === numberOfInputMessages) {
|
|
280
279
|
return {
|
|
281
280
|
status: (responsePayload.every(x => x instanceof Error) ? 500 : (outputStatus ? outputStatus : 200)),
|
|
282
281
|
value: responsePayload.map(x => {
|
|
@@ -291,7 +290,7 @@ function onResponse(config, options, requiredFlag) {
|
|
|
291
290
|
};
|
|
292
291
|
}
|
|
293
292
|
return {
|
|
294
|
-
status: headersToSet['retry-after'] ? 429 : (outputStatus ? outputStatus : (responsePayload instanceof Error ? 500 : 200)),
|
|
293
|
+
status: headersToSet['retry-after'] ? 429 : (outputStatus ? outputStatus : ((responsePayload && responsePayload instanceof Error) ? 500 : 200)),
|
|
295
294
|
value: responsePayload,
|
|
296
295
|
cacheMaxAge: 0,
|
|
297
296
|
};
|