mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
17 lines
410 B
JavaScript
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;
|
|
}
|