(str: string, key: string, getValue: () => string | undefined)
| 16 | } |
| 17 | |
| 18 | function 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 | |
| 28 | export function substituteVariables(str: string): string { |
| 29 | let result = str; |
no outgoing calls
no test coverage detected