jiangyi-boolean
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

jiangyi-boolean

(Chinese: 姜懿布尔型)

Type of Random Boolean.

Introduction

JyBoolean has two status: JyTrue(Chinese: 姜懿真) and JyFalse(Chinese: 姜懿假). These two status will collapse into one by random on calling the Getter bool

Get Started

install jiangyi-boolean by npm.

npm install jiangyi-boolean --save

and use it.

import {JyBoolean} from 'jiangyi-boolean';
var a:JyBoolean = new JyBoolean(2,5);
for(let i = 0;i < 5 ;++i){
	console.log(a.bool);
}

one of expected outputs:

true
true
false
true
false

Usage

constructor of JyBoolean

constructor(a:number = 1,b:number =1,enableAprilFools:boolean = false)
  • a and b: Proportion of probablity to be JyTrue or JyFalse. Default is 1:1.

  • enableAprilFools: Enable features for April Fool's day.

bool of JyBoolean

bool:boolean

Get the collapsed status of JyBoolean.

obviouslyIs of JyBoolean

obviouslyIs(isTrue:boolean|null) => void

Declare what status the JyBoolean is obviously is.

Something interesting will happen if April Fool's Day feature is enabled.

Copyright

(c) Hyperbola Studio. An open source project under WTFPL license.

/jiangyi-boolean/

    Package Sidebar

    Install

    npm i jiangyi-boolean

    Weekly Downloads

    2

    Version

    1.0.5

    License

    WTFPL

    Unpacked Size

    3.69 kB

    Total Files

    5

    Last publish

    Collaborators

    • crindzebra