(key: StringKeys, vars: Record<string, any> = {})
| 30 | return { |
| 31 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 32 | getString(key: StringKeys, vars: Record<string, any> = {}) { |
| 33 | if (typeof getString === 'function') { |
| 34 | return getString(key, vars) |
| 35 | } |
| 36 | |
| 37 | const template = get(strings, key) |
| 38 | |
| 39 | if (typeof template !== 'string') { |
| 40 | throw new Error(`No valid template with id "${key}" found in any namespace`) |
| 41 | } |
| 42 | |
| 43 | return mustache.render(template, { ...vars, $: strings }) |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 |
no test coverage detected
searching dependent graphs…