Files
javascript-packages/packages/typescript-types

Typescript Types

A utility types library for Typescript.

Types

The types included in this library are categorized by their purpose.

Test Types

Type Description
IsAny<T> true if T is any, false otherwise (null, undefined also yield false)
IsNever<T> true if T is never, false otherwise (null, undefined, any also yield false)
If<Test, TrueBranch, FalseBranch> Returns TrueBranch if Test is true, FalseBranch otherwise1 .

  1. Note the special behavior, if boolean is passed as Test the return value is a union of both branches, i.e. TrueBranch | FalseBranch. ↩︎