I have a readonly array of IDs, and I am trying to write a type UniqueArray which would return the original array type if the are no repeated values, and never otherwise. I have tried different ways of creating such a type but had no success.
I hope someone who understands TypeScript better than me would be willing to help.
Reproduction below (noop).