Files
openclaw/scripts/e2e/lib/gateway-frame-payload.mjs
2026-06-02 05:44:37 +02:00

17 lines
410 B
JavaScript

function hasOwnEnvelopeField(frame, field) {
return (
((typeof frame === "object" && frame !== null) || typeof frame === "function") &&
Object.hasOwn(frame, field)
);
}
export function resolveGatewaySuccessPayload(frame) {
if (hasOwnEnvelopeField(frame, "payload")) {
return frame.payload;
}
if (hasOwnEnvelopeField(frame, "result")) {
return frame.result;
}
return undefined;
}