Type Alias Flavor<F, T>

Flavor: [T] extends [null] | [undefined] | [symbol] | [void]
    ? FlavoredUnit<F, T>
    : Flavored<F> & T

Create a "flavored" version of a type. TypeScript will disallow mixing flavors, but will allow unflavored values of that type to be passed in where a flavored version is expected. This is a less restrictive form of branding.

Type Parameters

  • F extends string
  • T