UNPKG
type-samurai
Version:
latest (1.1.1)
1.1.1
1.1.0
1.0.1
1.0.0
Advanced utility types for Typescript
github.com/KamilHs/type-samurai
KamilHs/type-samurai
type-samurai
/
src
/
push.d.ts
10 lines
(9 loc)
•
233 B
TypeScript
View Raw
1
2
3
4
5
6
7
8
9
10
/** * Pushes the second argument to the first array argument *
@example
* ```ts * // [1, 2, 3, 4, 5] * type Case1 = Push<[1, 2, 3, 4], 5> * ``` */
export
type
Push
<T
extends
readonly
unknown
[], U
extends
unknown
> = [...T, U];