Skip to content

Commit

Permalink
feat(api): added the Prepend type
Browse files Browse the repository at this point in the history
  • Loading branch information
prescientmoon committed Jan 5, 2020
1 parent fa59ff3 commit 7bfe7a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/api/src/tuple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ export type Tail<T extends unknown[]> = ((...a: T) => void) extends (
) => void
? R
: never;

/**
* Add an element at the start of an tuple.
*/
export type Prepend<T, U extends unknown[]> = Parameters<
(v: T, ...args: U) => void
>;

0 comments on commit 7bfe7a8

Please sign in to comment.