( fields: Record<string, TemporalPayload> | undefined )
| 193 | |
| 194 | /** Decodes a `map<string, Payload>` (memo / search attributes) into a plain object. */ |
| 195 | export 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`). */ |
| 205 | export function stripEnumPrefix(value: string | undefined, prefix: string): string | null { |
no test coverage detected