aru
If there is, without error checking.
Install or Download
yarn add arunpm i -S aru
Or access to releases page. Then, download the latest version.
Usage
;const aru = ;
or
API
aru(key, value): promise or undefined
key
:string
value
:any
Set a value
. (Do noting if catch error)
aru(key): value-type or null
key
:string
Get the value
.
aru.has(key): boolean
key
:string
Wheter key exists.
aru.left(key, cb): return-value-of-cb or null
key
:string
cb
:function
If there is no that key
, execute cb
aru.right(key, cb): type-of-return-value-of-cb or null
key
:string
cb
:function
If there is that key
, execute cb
Example
;; // 'str'aru; // truearuleft'str' 'str'; // nullaruright'str' 'str'; // 'str' ;; // 'func'aru; // truearuleft'func' 'func'; // nullaruright'func' 'func'; // 'func' await ;; // 'resolve'aru; // truearuleft'resolve' 'resolve' // nullaruright'resolve' 'resolve' // 'resolve' await ;; // nullaru // falsearuleft'reject' 'reject' // 'reject'aruright'reject' 'reject' // null
LICENSE
The MIT License (MIT)
Copyright (c) 2017 nju33 nju33.ki@gmail.com