Last active
September 6, 2020 09:05
-
-
Save roalcantara/370386662d01de8da008203d53e4ac3b to your computer and use it in GitHub Desktop.
TypeScript 3.9 | Advanced Types: Removes the first entry of a tuple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Tail<T extends any[]> = ((...t: T) => any) extends ( | |
_: any, | |
...tail: infer TT | |
) => any | |
? TT | |
: [] | |
type Type1 = Tail<[age: number, single: boolean]> // [single: boolean] | |
type Type2 = Tail<Type1> // [] | |
// https://medium.com/free-code-camp/typescript-curry-ramda-types-f747e99744ab | |
// https://github.com/millsp/medium/blob/master/types-curry-ramda/src/index.ts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment