I just want to define if two types are equals (strict). I suppose equality can be defined using the following type definition:
type EqualsType<T, U> = T extends U ? true : (U extends T ? true : false)
Now, suppose we have two type definitions:
type User = {
readonly id: number,
name: string
}
type UserReadOnly = Readonly<User>
In theory, the following assertion should be false
:
type ResultSecondReadOnly = EqualsType<UserReadOnly, User>
I cannot understand how conditional type definition works in this case.