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

Function initializeTriggerMetadataMap

apps/sim/lib/logs/get-trigger-options.ts:85–96  ·  view source on GitHub ↗

* Internal: Initialize metadata map for O(1) lookups * Converts array of options to Map for fast access

()

Source from the content-addressed store, hash-verified

83 * Converts array of options to Map for fast access
84 */
85function initializeTriggerMetadataMap(): Map<string, { label: string; color: string }> {
86 if (cachedTriggerMetadataMap) {
87 return cachedTriggerMetadataMap
88 }
89
90 const options = getTriggerOptions()
91 cachedTriggerMetadataMap = new Map(
92 options.map((opt) => [opt.value, { label: opt.label, color: opt.color }])
93 )
94
95 return cachedTriggerMetadataMap
96}
97
98/**
99 * Gets integration metadata (label and color) for a specific trigger type.

Callers 1

getIntegrationMetadataFunction · 0.85

Calls 1

getTriggerOptionsFunction · 0.85

Tested by

no test coverage detected