MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / substituteVariable

Function substituteVariable

src/util.ts:18–26  ·  view source on GitHub ↗
(str: string, key: string, getValue: () => string | undefined)

Source from the content-addressed store, hash-verified

16}
17
18function substituteVariable(str: string, key: string, getValue: () => string | undefined) {
19 if (str.includes(key)) {
20 const value = getValue();
21 if (value) {
22 return str.replaceAll(key, value);
23 }
24 }
25 return str;
26}
27
28export function substituteVariables(str: string): string {
29 let result = str;

Callers 1

substituteVariablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected