Skip to content

Instantly share code, notes, and snippets.

@roalcantara
Last active September 6, 2020 09:09
Show Gist options
  • Save roalcantara/b28de23b68430f02f616e5a52ee6e14d to your computer and use it in GitHub Desktop.
Save roalcantara/b28de23b68430f02f616e5a52ee6e14d to your computer and use it in GitHub Desktop.
TypeScript 3.9 | Advanced Types: Returns true when there is more than one parameter
type HasTail<T extends any[]> =
T extends [] | [any]
? false
: true
type Type1 = HasTail<[age: number, single: boolean]> // true
type Type2 = HasTail<[single: boolean]>> // false
// 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