1.0.0 • Published 4 years ago

nv-dict-pop-with-function v1.0.0

Weekly downloads
46
License
ISC
Repository
-
Last release
4 years ago

nv-dict-pop-with-function

  • nv-dict-pop-with-function

install

  • npm install nv-dict-pop-with-function

usage

example

const {
    fst,
    fst_not,
    lst,
    lst_not,
    which,
    which_not,
    which_from_lst,
    which_not_from_lst,
    some,
    some_not,
    some_from_lst,
    some_not_from_lst,
    all,
    all_not
} = require("nv-dict-pop-with-function");


var d = {a:100,b:200,c:300,d:400}
var nd = all(d,(v,k,i)=>v>250 || k==='b')
> d
{ a: 100 }
> nd
{ b: 200, c: 300, d: 400 }
>

var d = {a:100,b:200,c:100,d:200}
var nd = fst(d,(v,k,i)=>v===100)
> d
{ b: 200, c: 100, d: 200 }
> nd
{ a: 100 }
>

var d = {a:100,b:200,c:100,d:200}
var nd = lst(d,(v,k,i)=>v===100)
> d
{ a: 100, b: 200, d: 200 }
> nd
{ c: 100 }
>

API

  • dict_fpop.gen_from_fst(d)
  • dict_fpop.gen_from_lst(d)
  • dict_fpop.fst(d,cond_func,...cond_other_func_params)
  • dict_fpop.fst_not(d,cond_func,...cond_other_func_params)
  • dict_fpop.which(d,index,cond_func,...cond_other_func_params)
  • dict_fpop.which_not(d,index,cond_func,...cond_other_func_params)
  • dict_fpop.which_from_lst(d,index,cond_func,...cond_other_func_params)
  • dict_fpop.which_not_from_lst(d,index,cond_func,...cond_other_func_params)
  • dict_fpop.lst(d,cond_func,...cond_other_func_params)
  • dict_fpop.lst_not(d,cond_func,...cond_other_func_params)
  • dict_fpop.some(d,whiches,cond_func,...cond_other_func_params)
  • dict_fpop.some_not(d,whiches,cond_func,...cond_other_func_params)
  • dict_fpop.some_from_lst(d,whiches,cond_func,...cond_other_func_params)
  • dict_fpop.some_not_from_lst(d,whiches,cond_func,...cond_other_func_params)
  • dict_fpop.all(d,cond_func,...cond_other_func_params)
  • dict_fpop.all_not(d,cond_func,...cond_other_func_params)

LICENSE

  • ISC