Typescript Count Unique Values With Condition