0.5.1 • Published 1 year ago

@aurospire/jestype v0.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

jestype

A Jest Utility for Compile Time Type Assertions

Logical Types


Switch

  • Ability to prohibit function call with rest final parameter
    Switch<Condition: boolean, Inverted: boolean = false> => 
        (Condition !== Inverted && Condition !== boolean) =>
            true    => []
            default => [never]

If

    If<Condition: boolean, Then: any, Else: any> =>      
        true    => Then
        false   => Else
        default => Then | Else

Not

    Not<Value: boolean> => 
        true    => false
        false   => true
        boolean => boolean

And

    And<Left: boolean, Right: right> => 
        (Left & Right === true) =>
            true    => true
            default => false

Nand

    Nand<Left: boolean, Right: boolean> => 
        (Left & Right !== true) =>
            true    => true
            default => false

Or

    And<Left: boolean, Right: boolean> => 
        (Left | Right === true) =>
            true    => true
            default => false

Nor

    And<Left: boolean, Right: boolean> => 
        (Left | Right !== true) =>
            true    => true
            default => false

Xor

    And<Left: boolean, Right: boolean> => 
        (Left ^ Right === true) =>
            true    => true
            default => false

Eq

    And<Left: boolean, Right: boolean> => 
        (Left ^ Right !== true) =>
            true    => true
            default => false

All

    And<Items: boolean[]> => 
        (AND(...Items) === true) =>
            true    => true
            default => false

Any

    And<Items: boolean[]> => 
        (OR(...Items) === true) =>
            true    => true
            default => false

None

    And<Items: boolean[]> => 
        (OR(...Items) !== true) =>
            true    => true
            default => false
0.5.1

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.2.0

1 year ago

0.1.2

1 year ago

0.1.2-2

1 year ago

0.1.2-1

1 year ago

0.1.2-0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago