1.0.1 • Published 4 years ago
nv-dict-setter v1.0.1
nv-dict-setter
- nv-dict-setter
install
- npm install nv-dict-setter
usage
example
const dict_setter = require("nv-dict-setter")
var d = {a:1,b:2,c:3}
> dict_setter.all(d,100)
{ a: 100, b: 100, c: 100 }
>
var d = {a:1,b:2,c:3}
dict_setter.some(d,100,'a','c')
{ a: 100, b: 2, c: 100 }
>
var d = {a:1,b:2,c:3}
dict_setter.some_not(d,100,'a','c')
{ a: 1, b: 100, c: 3 }
var d = {a:1,b:2,c:3,d:3}
dict_setter.filter(d,100,(v,k,i)=>(v>2)&&(k!=='d'))
{ a: 1, b: 2, c: 100, d: 3 }
API
- dict_setter.all(d,val)
- dict_setter.some(d,val,...ks)
- dict_setter.some_not(d,val,...ks)
- dict_setter.filter_map(d,val_map_func,cond_func,...other_args)
- dict_setter.filter(d,val,cond_func,...other_args)
- dict_setter.kfilter(d,val,cond_func,...other_args)
- dict_setter.vfilter(d,val,cond_func,...other_args)
- dict_setter.ifilter(d,val,cond_func,...other_args)
LICENSE
- ISC