-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add isEqualType
method?
#2
Comments
I've wanted this for a long time! |
Hello there @sindresorhus and @bradgarropy, I would try to work on this enhancement. I am clear about |
@ritikbheda The mixed one is comparing the generic type against the value, which means you just need to get the type of the input value before comparing. |
Could |
@younho9 I don't see why it would. It's about comparing type, not structure. |
Sorry. Could object structure comparison be performed deeply at runtime? For declare const a: number;
declare const b: unknown;
if (isEqualType(a, b) {
b
// => number
} |
That's not the goal of this type. |
The goal of this is to work with known types at compile time. |
|
To ensure a type is correct. Can be useful for testing.
We could use this type for it: https://github.com/sindresorhus/type-fest/blob/98158e0fcb354e36c8aaf4b6808ca1498156f1f4/source/internal.d.ts#L1-L11
Example:
Thoughts?
The text was updated successfully, but these errors were encountered: