MCPcopy Create free account
hub / github.com/ShipSecAI/studio / interpolate

Function interpolate

worker/src/components/notification/slack.ts:55–59  ·  view source on GitHub ↗

* Simple helper to replace {{var}} placeholders in a string

(template: string, vars: Record<string, any>)

Source from the content-addressed store, hash-verified

53 * Simple helper to replace {{var}} placeholders in a string
54 */
55function interpolate(template: string, vars: Record<string, any>): string {
56 return template.replace(/\{\{\s*(\w+)\s*\}\}/g, (match, key) => {
57 return vars[key] !== undefined ? String(vars[key]) : match;
58 });
59}
60
61const mapTypeToSchema = (
62 type: string,

Callers 1

executeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected