(key: string, value: string)
| 1 | function outputDelimiter(key: string, value: string): string { |
| 2 | const normalizedKey = key.replace(/[^A-Za-z0-9_]/g, '_') |
| 3 | const baseDelimiter = `FORMATJS_${normalizedKey}_EOF` |
| 4 | const lines = new Set(value.split(/\r?\n/)) |
| 5 | let delimiter = baseDelimiter |
| 6 | let suffix = 0 |
| 7 | |
| 8 | while (lines.has(delimiter)) { |
| 9 | suffix++ |
| 10 | delimiter = `${baseDelimiter}_${suffix}` |
| 11 | } |
| 12 | |
| 13 | return delimiter |
| 14 | } |
| 15 | |
| 16 | export function githubOutputRecord(key: string, value): string { |
| 17 | const serialized = typeof value === 'string' ? value : JSON.stringify(value) |
no outgoing calls
no test coverage detected