Search Terms
Suggestion
Use Cases
TypeScript type system is highly functional.
Type level testing is required.
However, we can not easily check type equivalence.
I want a type-level equivalence operator there.
It is difficult for users to implement any when they enter.
I implemented it, but I felt it was difficult to judge the equivalence of types including any.
Examples
typeA=number== string;// falsetypeB=1==1;// truetypeC=any==1;// falsetypeD=1|2==1;// falsetypeE=Head<[1,2,3]>==1;// true(see:#24897)typeF=any==never;// falsetypeG=[any]==[number];// falsetypeH={x:1}&{y:2}=={x:1,y:2}// truefunctionassertType<_Textendstrue>(){}assertType<Head<[1,2,3]>==1>();assertType<Head<[1,2,3]>==2>();// Type ErrorChecklist
My suggestion meets these guidelines:
Search Terms
Suggestion
Use Cases
TypeScript type system is highly functional.
Type level testing is required.
However, we can not easily check type equivalence.
I want a type-level equivalence operator there.
It is difficult for users to implement any when they enter.
I implemented it, but I felt it was difficult to judge the equivalence of types including any.
Examples
Checklist
My suggestion meets these guidelines: