@iterable-iterator/reduce

1.0.1 • Public • Published

🥣 @iterable-iterator/reduce

Iterable reducers for JavaScript. See docs.

⚠️ Depending on your environment, the code may require regeneratorRuntime to be defined, for instance by importing regenerator-runtime/runtime.

import {range} from '@iterable-iterator/range';
import {reduce} from '@iterable-iterator/reduce';
import {mul, add} from '@functional-abstraction/operator';

reduce( mul , range( 2 , 6 ) , 1 ) ; // 120
reduce( add , range( 2 , 6 ) , 1 ) ; // 15

import {sum} from '@iterable-iterator/reduce';
sum( range( 6 ) ) ; // 15

import {any, all, some} from '@iterable-iterator/reduce';
any( [ false* , true , ... ] ) ; // T
any( [ false* ] ) ; // F
all( [ true* , false , ... ] ) ; // F
all( [ true* ] ) ; // T
some( [ true , true , false , true , ... ] , 3 ) ; // T
some( [ true , false , true , false* ] , 3 ) ; // F

import {increasing, decreasing} from "@total-order/primitive" ;
import {min, max} from '@iterable-iterator/reduce';
min( increasing , [ 2 , 1 , 3 ] ) ; // 1
max( increasing , [ 2 , 1 , 3 ] ) ; // 3

License Version Tests Dependencies Dev dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

Dependencies (1)

Dev Dependencies (25)

Package Sidebar

Install

npm i @iterable-iterator/reduce

Weekly Downloads

45

Version

1.0.1

License

AGPL-3.0

Unpacked Size

543 kB

Total Files

14

Last publish

Collaborators

  • raskat
  • aureooms