tiinvo

tiinvo / Exports / Bool

Namespace: Bool

Table of contents

Type Aliases

Functions

Serializables

Type Aliases

T

Ƭ T: boolean

Represents a boolean value

Example

import { Bool } from 'tiinvo'

let x: Bool.T = true;

Since

4.0.0

Defined in

src/Bool.ts:17

Functions

guard

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

Parameters

Name Type Description
x unknown the value to check if is a boolean

Returns

x is boolean

Defined in

src/Functors.ts:338


flip

flip(a): boolean

Flips a boolean value

Example

import { Bool } from 'tiinvo'

Bool.flip(true)      // false

Since

4.0.0

Parameters

Name Type
a boolean

Returns

boolean

Defined in

src/Functors.ts:465

Serializables

toNumber

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

Parameters

Name Type Description
t boolean the bool

Returns

1 | 0

Defined in

src/Bool.ts:83