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

Function normalizeRecordMap

apps/sim/lib/core/utils/records.ts:36–48  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

34 * Normalizes record-of-record maps such as block output schema maps.
35 */
36export function normalizeRecordMap(value: unknown): Record<string, UnknownRecord> {
37 if (!isPlainRecord(value)) {
38 return {}
39 }
40
41 const normalized: Record<string, UnknownRecord> = {}
42 for (const [key, entryValue] of Object.entries(value)) {
43 if (isPlainRecord(entryValue)) {
44 normalized[key] = entryValue
45 }
46 }
47 return normalized
48}
49
50/**
51 * Workflow variables are stored as a record in current state, while some

Callers 2

execute.tsFile · 0.90
records.test.tsFile · 0.90

Calls 1

isPlainRecordFunction · 0.90

Tested by

no test coverage detected