Ƭ T: boolean
Represents a boolean value
Example
import { Bool } from 'tiinvo'
let x: Bool.T = true;
Since
4.0.0
▸ guard(x
): x is boolean
Checks if parameter x
is boolean
Example
import { Bool } from 'tiinvo'
Bool.guard(true) // true
Bool.guard(1000) // false
Since
4.0.0
Name | Type | Description |
---|---|---|
x |
unknown |
the value to check if is a boolean |
x is boolean
true
if x
is a boolean
false
otherwise▸ flip(a
): boolean
Flips a boolean value
Example
import { Bool } from 'tiinvo'
Bool.flip(true) // false
Since
4.0.0
Name | Type |
---|---|
a |
boolean |
boolean
false
if x
is true
true
if x
is false
▸ toNumber(t
): 1
| 0
Returns 1 if true, 0 otherwise
Example
import { Bool } from 'tiinvo'
Bool.toNumber(true) // 1
Bool.toNumber(false) // 0
Since
4.0.0
Name | Type | Description |
---|---|---|
t |
boolean |
the bool |
1
| 0
1
if t
is false
0
if t
is true