create an element-wise intersection between two tuples. note that the intersection any & T typically produces any, but when put through this utility type, it will produce T for convenience of usage with function parameters intersection.
any & T
any
T
type A = TupleIntersect<[number, unknown, string, any], [5, number, string, boolean, 99]>// A === [5, number, string, boolean] Copy
type A = TupleIntersect<[number, unknown, string, any], [5, number, string, boolean, 99]>// A === [5, number, string, boolean]
create an element-wise intersection between two tuples.
note that the intersection
any & T
typically producesany
, but when put through this utility type, it will produceT
for convenience of usage with function parameters intersection.