nv-dict-find

1.0.0 • Public • Published

nv-dict-find

  • nv-dict-find

install

  • npm install nv-dict-find

usage

const dict_find = require("nv-dict-find")
//cond_func(v,k,i,...cond_other_func_params)

example

const dict_find = require("nv-dict-find")
var d = {a:1,b:2,c:3,d:4,e:5} 
> dict_find.all(d,r=>r%2)
{ a: 1, c: 3, e: 5 }
> dict_find.all_not(d,r=>r%2)
{ b: 2, d: 4 }
>
> dict_find.fst(d,r=>r%2)
{ a: 1 }
> dict_find.fst_not(d,r=>r%2)
{ b: 2 }
>
> dict_find.lst(d,r=>r%2)
{ e: 5 }
> dict_find.lst_not(d,r=>r%2)
{ d: 4 }
>
> dict_find.which(d,1,r=>r%2)
{ c: 3 }
> dict_find.which_not(d,1,r=>r%2)
{ d: 4 }
>
> dict_find.which_from_lst(d,1,r=>r%2)
{ c: 3 }
> dict_find.which_not_from_lst(d,1,r=>r%2)
{ b: 2 }
>

> dict_find.some(d,[0,2],r=>r%2)
{ a: 1, e: 5 }
> dict_find.some_not(d,[0,2],r=>r%2)
{ b: 2 }
>
> dict_find.some_from_lst(d,[0,2],r=>r%2)
{ e: 5, a: 1 }
> dict_find.some_not_from_lst(d,[0,2],r=>r%2)
{ d: 4 }
>
>

API

  • dict_find.fst(d,cond_func,...other_params)
  • dict_find.fst_not(d,cond_func,...other_params)
  • dict_find.lst(d,cond_func,...other_params)
  • dict_find.fst_not(d,cond_func,...other_params)
  • dict_find.which(d,which,cond_func,...other_params)
  • dict_find.which_not(d,which,cond_func,...other_params)
  • dict_find.which_from_lst(d,which,cond_func,...other_params)
  • dict_find.which_not_from_lst(d,which,cond_func,...other_params)
  • dict_find.some(d,whiches,cond_func,...other_params)
  • dict_find.some_not(d,whiches,cond_func,...other_params)
  • dict_find.some_from_lst(d,whiches,cond_func,...other_params)
  • dict_find.some_not_from_lst(d,whiches,cond_func,...other_params)
  • dict_find.all(d,cond_func,...other_params)
  • dict_find.all_not(d,cond_func,...other_params)

LICENSE

  • ISC

Readme

Keywords

none

Package Sidebar

Install

npm i nv-dict-find

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

5.91 kB

Total Files

3

Last publish

Collaborators

  • ihgazni2