MCPcopy Index your code
hub / github.com/simstudioai/sim / encodePayload

Function encodePayload

apps/sim/tools/temporal/utils.ts:109–114  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

107
108/** Encodes a single JSON value as a Temporal `json/plain` payload. */
109export function encodePayload(value: unknown): TemporalPayload {
110 return {
111 metadata: { encoding: JSON_PLAIN_ENCODING },
112 data: Buffer.from(JSON.stringify(value)).toString('base64'),
113 }
114}
115
116/**
117 * Normalizes a JSON field value: strings are parsed as JSON, already-resolved objects

Callers 1

parseJsonPayloadMapFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected