ABenassi87 / ngx-text-diff

A Text Diff component for Angular
https://ngx-text-diff.herokuapp.com/home
50 stars 44 forks source link

Possible Typo #25

Open chipallen2 opened 4 years ago

chipallen2 commented 4 years ago

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

ABenassi87 commented 4 years ago

@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.

chipallen2 commented 4 years ago

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.