Typescript Count Unique Values With Condition That