Options
All
  • Public
  • Public/Protected
  • All
Menu

Type aliases

Type aliases

Contains

Contains<A1, A2>: Extends<A1, A2> extends 1 ? 1 : 0

Check whether A1 is part of A2 or not. It works like Extends but Boolean results are narrowed to [[False]].

Type parameters

  • A1: any
  • A2: any

returns

Boolean

example

type test0 = A.Contains<'a' | 'b', 'b'> // False
type test1 = A.Contains<'a', 'a' | 'b'> // True

type test2 = A.Contains<{a: string}, {a: string, b: number}> // False
type test3 = A.Contains<{a: string, b: number}, {a: string}> // True

type test4 = A.Contains<never, never> // False
/// Nothing cannot contain nothing, use `A.Equals`

  • Inherited
  • Protected
  • Private
  • Static
  • Module
  • Object
  • Property
  • Function
  • Variable
  • Index
  • Type
  • Class
  • Interface
  • Enum
  • Constructor
  • Getter/Setter
Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.