0.5.1 • Published 1 year ago
@aurospire/jestype v0.5.1
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