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

Function replaceValidReferences

apps/sim/executor/utils/reference-validation.ts:144–156  ·  view source on GitHub ↗
(
  template: string,
  replacer: (match: string, index: number, template: string) => string
)

Source from the content-addressed store, hash-verified

142 * Distinguishes < operator from < bracket using isLikelyReferenceSegment.
143 */
144export function replaceValidReferences(
145 template: string,
146 replacer: (match: string, index: number, template: string) => string
147): string {
148 const pattern = createReferencePattern()
149
150 return template.replace(pattern, (match, _content, index) => {
151 if (!isLikelyReferenceSegment(match)) {
152 return match
153 }
154 return replacer(match, index, template)
155 })
156}

Callers

nothing calls this directly

Calls 3

isLikelyReferenceSegmentFunction · 0.90
createReferencePatternFunction · 0.85
replaceMethod · 0.65

Tested by

no test coverage detected