(replace: Replace, value: any)
| 46 | type Replace = (match: string, variable: string, args: string[]) => string; |
| 47 | |
| 48 | function substitute0(replace: Replace, value: any): any { |
| 49 | if (typeof value === 'string') { |
| 50 | return resolveString(replace, value); |
| 51 | } else if (Array.isArray(value)) { |
| 52 | return value.map(s => substitute0(replace, s)); |
| 53 | } else if (value && typeof value === 'object' && !URI.isUri(value)) { |
| 54 | const result: any = Object.create(null); |
| 55 | Object.keys(value).forEach(key => { |
| 56 | result[key] = substitute0(replace, value[key]); |
| 57 | }); |
| 58 | return result; |
| 59 | } |
| 60 | return value; |
| 61 | } |
| 62 | |
| 63 | const VARIABLE_REGEXP = /\$\{(.*?)\}/g; |
| 64 |
no test coverage detected