(list, listPattern)
| 30 | |
| 31 | // Logic to format the literal length rules (e.g. "2": "{0} and {1}") |
| 32 | function formatLiteralPattern(list, listPattern) { |
| 33 | // The string we'll build up |
| 34 | var result = listPattern; |
| 35 | |
| 36 | // This means we have a special handling for just this number of elements |
| 37 | list.forEach(function(listItem, idx) { |
| 38 | result = result.replace('{' + idx + '}', listItem); |
| 39 | }); |
| 40 | |
| 41 | return result; |
| 42 | } |
| 43 | |
| 44 | function listPatternFormatter(list, _config) { |
| 45 | // Use the default config patternType by default… |
no outgoing calls
no test coverage detected