to be compared
to compare to
(?='default'
) to change precision
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
Check whether
A
is similar toA1
or not. In other words, it is a compact type that bundles Equals, Extends, Contains, comparison types.