(str: string)
| 95 | |
| 96 | export const makeTemplate = |
| 97 | (str: string): ((values?: Array<string>) => string) => |
| 98 | (values = []) => |
| 99 | str.replaceAll(/\$(\d+)/g, (_match, number) => { |
| 100 | if (!Array.isArray(values)) { |
| 101 | throw new TypeError('Array of values must be passed to the template.'); |
| 102 | } |
| 103 | return values[number - 1]; |
| 104 | }); |
| 105 | |
| 106 | export const cleanup = (directory: string) => { |
| 107 | try { |
no outgoing calls
no test coverage detected