MCPcopy
hub / github.com/simstudioai/sim / decodePayloadMap

Function decodePayloadMap

apps/sim/tools/temporal/utils.ts:195–202  ·  view source on GitHub ↗
(
  fields: Record<string, TemporalPayload> | undefined
)

Source from the content-addressed store, hash-verified

193
194/** Decodes a `map<string, Payload>` (memo / search attributes) into a plain object. */
195export function decodePayloadMap(
196 fields: Record<string, TemporalPayload> | undefined
197): Record<string, unknown> | null {
198 if (!fields) return null
199 return Object.fromEntries(
200 Object.entries(fields).map(([key, value]) => [key, decodePayload(value)])
201 )
202}
203
204/** Strips a protobuf enum prefix (e.g. `WORKFLOW_EXECUTION_STATUS_RUNNING` → `RUNNING`). */
205export function stripEnumPrefix(value: string | undefined, prefix: string): string | null {

Callers 1

Calls 1

decodePayloadFunction · 0.85

Tested by

no test coverage detected