“Tuple” 方法
_.TupleByUnionPush<tuple, type>
TupleByPush
的 Union
情况专用处理函数
将一个类型添加元组的末尾,并返回「暴力枚举后」的「元组联合类型」
参数
tuple (Tuple): 需要处理的元组
type (unknown): 需要被添加到元组中的类型
返回
tuple (Tuple): 返回新类型被添加到最后一项之后元组
例子
type TupleAfterUnionPush = _.TupleByUnionPush<['angular'], 'react' | 'vue'>;
// => ['angular', 'react'] | ['angular', 'vue']
type TupleAfterUnionPush = _.TupleByUnionPush<['angular'] | ['solid'], 'react' | 'vue'>;
// => ['angular', 'react'] | ['angular', 'vue'] | ['solid', 'react'] | ['solid', 'vue']
// diff with TupleByPush
type TupleAfterPush = _.TupleByPush<['angular'], 'react' | 'vue'>;
// => ['angular', 'react' | 'vue']