(message: string, customArgs: any)
| 6 | const getArgPath = (arg: string): string => arg.replace(/[{}]/g, ''); |
| 7 | |
| 8 | const parseMessage = (message: string, customArgs: any): string => { |
| 9 | const parsableArgs = getArgsToParse(message); |
| 10 | return Array.isArray(parsableArgs) |
| 11 | ? parsableArgs.reduce( |
| 12 | (customMessage, arg) => |
| 13 | customMessage.replace(arg, get(customArgs, getArgPath(arg), arg)), |
| 14 | message |
| 15 | ) |
| 16 | : message; |
| 17 | }; |
| 18 | |
| 19 | export const parseMessageWithCustomArgs = ( |
| 20 | message: string, |
no test coverage detected
searching dependent graphs…