( line: string, isFirstOrLast: boolean, color: DiffOptionsColor, indicator: string, trailingSpaceFormatter: DiffOptionsColor, emptyFirstOrLastLinePlaceholder: string, )
| 19 | ): string => line.replace(/\s+$/, match => trailingSpaceFormatter(match)); |
| 20 | |
| 21 | const printDiffLine = ( |
| 22 | line: string, |
| 23 | isFirstOrLast: boolean, |
| 24 | color: DiffOptionsColor, |
| 25 | indicator: string, |
| 26 | trailingSpaceFormatter: DiffOptionsColor, |
| 27 | emptyFirstOrLastLinePlaceholder: string, |
| 28 | ): string => |
| 29 | line.length === 0 |
| 30 | ? indicator === ' ' |
| 31 | ? isFirstOrLast && emptyFirstOrLastLinePlaceholder.length > 0 |
| 32 | ? color(`${indicator} ${emptyFirstOrLastLinePlaceholder}`) |
| 33 | : '' |
| 34 | : color(indicator) |
| 35 | : color( |
| 36 | `${indicator} ${formatTrailingSpaces(line, trailingSpaceFormatter)}`, |
| 37 | ); |
| 38 | |
| 39 | const printDeleteLine = ( |
| 40 | line: string, |
no test coverage detected