1.0.3 • Published 2 years ago

nv-bool-cond v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

nv-bool-cond

  • nv-bool-cond
  • just a instance extends of Boolean, which can carry reason

install

  • npm install nv-bool-cond

usage

example

    > const {tru,fls} = require("nv-bool-cond")
    > var t = tru()
    > t
    [Boolean (NvCond): true] { '#reason': null }
    > 
    > var f = fls("not-matched")
    > f
    [Boolean (NvCond): false] { '#reason': 'not-matched' }
    > 
    > t == true
    true
    > f == false
    true
    > 

API

            {
              creat: [Function: creat],
              from_pair: [Function: from_pair],
              from_dict: [Function: from_dict],
              tru: [Function: tru],
              fls: [Function: fls],
              is_true: [Function: is_true],
              is_false: [Function: is_false]
            }

METHODS

     cond.cond_            cond.dict                  cond.pair                  cond.reason_

LICENSE

  • ISC