Closed younho9 closed 2 years ago
I'm not sure this is a good idea. It would work fine for simple things, but for most custom objects, the type would just be Object
, which means it would be true even when the objects differ.
Your point is right... To correctly infer the object type, a deep identity comparison is required, but I think it's too expensive for type inference.
It would be useful as a type guard function of inferring the type of another variable compared to the type of one variable.
It would be not strict type level equal.
Related: https://github.com/sindresorhus/ts-extras/issues/2