MCPcopy
hub / github.com/continuedev/continue / getTemplateVariables

Function getTemplateVariables

packages/config-yaml/src/load/unroll.ts:85–97  ·  view source on GitHub ↗
(templatedYaml: string)

Source from the content-addressed store, hash-verified

83export const TEMPLATE_VAR_REGEX = /\${{[\s]*([^}\s]+)[\s]*}}/g;
84
85export function getTemplateVariables(templatedYaml: string): string[] {
86 // Defensive guard against undefined/null/non-string values
87 if (!templatedYaml || typeof templatedYaml !== "string") {
88 return [];
89 }
90
91 const variables = new Set<string>();
92 const matches = templatedYaml.matchAll(TEMPLATE_VAR_REGEX);
93 for (const match of matches) {
94 variables.add(match[1]);
95 }
96 return Array.from(variables);
97}
98
99export function fillTemplateVariables(
100 templatedYaml: string,

Callers 9

connectClientMethod · 0.90
connectServerMethod · 0.90
renderSecretsFunction · 0.85
unroll.test.tsFile · 0.85
extractFQSNMapFunction · 0.85
replaceInputsWithSecretsFunction · 0.85
resolveBlockFunction · 0.85

Calls 2

fromMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected