(value: string, ...args: any[])
| 36 | * @param args replacements for {n}-entries |
| 37 | */ |
| 38 | export function format(value: string, ...args: any[]): string { |
| 39 | if (args.length === 0) { |
| 40 | return value; |
| 41 | } |
| 42 | return value.replace(_formatRegexp, function (match, group) { |
| 43 | const idx = parseInt(group, 10); |
| 44 | return isNaN(idx) || idx < 0 || idx >= args.length ? |
| 45 | match : |
| 46 | args[idx]; |
| 47 | }); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Converts HTML characters inside the string to use entities instead. Makes the string safe from |
nothing calls this directly
no outgoing calls
no test coverage detected