Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "Any/Extends"

Index

Type aliases

Type aliases

Extends

Extends<A1, A2>: Extends<A1, A2>

Check whether A1 is part of A2 or not. The difference with extends is that it forces a Boolean return.

Type parameters

  • A1: any
  • A2: any

returns

Boolean

example

import {A} from 'ts-toolbelt'

type test0 = A.Extends<'a' | 'b', 'b'> // Boolean
type test1 = A.Extends<'a', 'a' | 'b'> // True

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

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

Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.