ngx-text-diff icon indicating copy to clipboard operation
ngx-text-diff copied to clipboard

Possible Typo

Open chipallen2 opened this issue 6 years ago • 2 comments

Should this second if line be if (result.rightContent)?

    if (result.leftContent) {
      diffCount += result.leftContent.lineDiffs.filter(diff => diff.isDiff).length;
    }
    if (result.leftContent) {
      diffCount += result.rightContent.lineDiffs.filter(diff => diff.isDiff).length;
    }

https://github.com/ABenassi87/ngx-text-diff/blob/34fa1d9a3aac9a1268f9041fde40871a34cadc52/projects/ngx-text-diff/src/lib/ngx-text-diff.service.ts#L182

chipallen2 avatar Sep 15 '19 19:09 chipallen2

@chipallen2 Hi Chip, how are you? thank you for submitting the ticket. It looks like an issue. I will review the code and if it is an issue, I will push a fix for it. I was a little busy this year so I was not able to spend much time to work on this lib. My idea is to come back to work on this lib as soon as possible. Regards.

ABenassi87 avatar Sep 18 '19 15:09 ABenassi87

It seems to work fine cause it still sets the right content. So I'm guessing that it can be combined into a single if and set both left and right together.

chipallen2 avatar Sep 19 '19 19:09 chipallen2