Is there a way to define type for array with unique items in typescript?
The only possible way this could work at compile time is if your arrays are tuples composed of literals. For example, here are some arrays with the same runtime values, but with different types in TypeScript: const tupleOfLiterals: [1, 2, 2] = [1, 2, 2]; const tupleOfNonLiterals: [number, number, number] = [1, 2, 2]; const … Read more