Options
All
  • Public
  • Public/Protected
  • All
Menu

Type aliases

Type aliases

Is

Is<A, A1, match>: object[match]

Check whether A is similar to A1 or not. In other words, it is a compact type that bundles Equals, Extends, Contains, comparison types.

Type parameters

  • A: any

    to be compared

  • A1: any

    to compare to

  • match: Match

    (?='default') to change precision

returns

Boolean

example

import {A} from 'ts-toolbelt'

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

type test2 = A.Is<'a', 'a' | 'b', '<-extends'> // Boolean
type test3 = A.Is<'a' | 'b', 'a', '<-extends'> // True

type test4 = A.Is<'a', 'a' | 'b', 'contains->'> // True
type test5 = A.Is<'a' | 'b', 'a', 'contains->'> // False

type test6 = A.Is<'a', 'a' | 'b', '<-contains'> // False
type test7 = A.Is<'a' | 'b', 'a', '<-contains'> // True

type test8 = A.Is<'a', 'a' | 'b', 'equals'>      // False
type test9 = A.Is<'b' |'a', 'a' | 'b', 'equals'> // True

  • 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.