Imagine I have a sorting function with
type sortingType =
string | number | boolean | { [key: string]: unknown }; // basically unknown
const mySortFun = (a: sortingType, b: sortingType) => { /* do the thing */ };
But I know, that if a is type X, then b is also type X. How can I tell typeScript?