Skip to content

Latest commit

 

History

History
156 lines (88 loc) · 1.99 KB

Bool.md

File metadata and controls

156 lines (88 loc) · 1.99 KB

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

  • true if x is a boolean
  • false otherwise

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

  • false if x is true
  • true if x is false

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

  • 1 if t is false
  • 0 if t is true

Defined in

src/Bool.ts:83