nv-dict-find-key

1.0.0 • Public • Published

nv-dict-find-key

  • nv-dict-find-key

install

  • npm install nv-dict-find-key

usage

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

example

const dict_findk = require("nv-dict-find-key")
var d = {a:1,b:2,c:3,d:4,e:5} 
> dict_findk.all(d,r=>r%2)
['a','c','e']
>
> dict_findk.all_not(d,r=>r%2)
[ 'b','d' ]
>

> dict_findk.fst(d,r=>r%2)
'a'
> dict_findk.fst_not(d,r=>r%2)
'b'
>
> dict_findk.lst(d,r=>r%2)
'e'
>
> dict_findk.lst_not(d,r=>r%2)
'd'
>
> dict_findk.some(d,[0,2],r=>r%2)
[ 'a','e']
>
> dict_findk.some_not(d,[0,2],r=>r%2)
[ 'b']
>
> dict_findk.some_from_lst(d,[0,2],r=>r%2)
[ 'e','a']
>
> dict_findk.some_not_from_lst(d,[0,2],r=>r%2)
[ 'd']
>
> dict_findk.which(d,1,r=>r%2)
'c'
> dict_findk.which_not(d,1,r=>r%2)
'd'
> dict_findk.which_from_lst(d,1,r=>r%2)
'c'
> dict_findk.which_not_from_lst(d,1,r=>r%2)
'b'
>

API

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

LICENSE

  • ISC

Readme

Keywords

none

Package Sidebar

Install

npm i nv-dict-find-key

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

5.84 kB

Total Files

3

Last publish

Collaborators

  • ihgazni2