1.0.2 • Published 2 years ago

nv-facutil-add v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

nv-facutil-add

  • same as apply reduce on a array, but just for "+"
  • repl/cli tool using

install

  • npm install nv-facutil-add

splitted

usage

  const { s,a}   = require("nv-facutil-add");

example

sync

0_0

        var ary = [1,2,3,4]
        var dict = {a:1,b:2,c:3,d:4}
        var st  = new Set(ary);
        var mp = new Map([
           ["a",1],
           ["b",2],
           ["c",3],
           ["d",4]
        ]);

       var iter = st.values();

       var abvw  = new Uint8Array(ary);

      
       function * sgen(){
          yield 1;
          yield 2;
          yield 3;
          yield 4; 
       }
       var sg = sgen();

       s(ary); 
       s(dict);
       s(st);
       s(mp);
       s(abvw);
       s(iter);
       s(sg)

			/*
			> s(ary);
			10
			> s(dict);
			10
			> s(st);
			10
			> s(mp);
			10
			> s(abvw);
			10
			> s(iter);
			10
			> s(sg)
			10
			> 
			*/

async

1_0

   //others same as sync
   //  just support AsyncGenerator
       async function * agen(){
          yield 1;
          yield 2;
          yield 3;
          yield 4;
       }
       var ag = agen();

       await a(ag)      

1_1

METHODS

APIS

LICENSE

  • ISC