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
/
unshift.d.ts
10 lines
(9 loc)
•
238 B
TypeScript
View Raw
1
2
3
4
5
6
7
8
9
10
/** * Adds the second argument to the beginning of the first array argument. *
@example
* ```ts * // ['foo', 'bar'] * type Result = Unshift<['bar'], 'foo'> * ``` */
export
type
Unshift
<T
extends
readonly
unknown
[], U> = [U, ...T];