1.0.2 • Published 2 years ago
nv-pair-maybe v1.0.2
nv-pair-maybe
- nv-pair-maybe
- A array-of-size-2
install
- npm install nv-pair-maybe
usage
const {from_dict,from_ary,value,empty,yes,no} = require("nv-pair-maybe");
// yes is alias of value
// no is alias of empty
example
> var maybe = value(true,100)
> maybe
Maybe(2) [ true, 100 ]
>
> maybe.dict()
Dict { yes: true, val: 100 }
>
> maybe.is_empty()
false
>
> maybe.get()
100
> from_dict({ yes: true, val: 100 })
Maybe(2) [ true, 100 ]
>
> from_ary([true, 100])
Maybe(2) [ true, 100 ]
>
API
{
ERRORS: { is_empty: 'is_empty', not_empty: 'not_empty' },
Dict: [class Dict],
Maybe: [class Maybe extends Array],
from_dict: [Function: from_dict],
from_ary: [Function: from_ary],
value: [Function: value],
empty: [Function: empty],
yes: [Function: value],
no: [Function: empty]
}
LICENSE
- ISC