functional-augments

1.0.0 • Public • Published

Functional Augments for ES6 objects

Build Status

This package augments the prototypes of the following collections in ES6 with methods for functional programming similar to Arrays:

  • Map
  • Object
  • Set
  • String

Currently the following methods are provided:

  • filter()
  • map()
  • reduce()

Functions provided to methods on keyed collections take an optional third parameter for the key.

Installation

$ npm install --save functional-augments

Usage

'use strict';
 
require('functional-augments');
 
const object = {
  one: 1,
  two: 2,
  three: 3
};
 
const reduction = object.reduce((acc, v) => acc + v);
 
console.log(reduction); // 6

/functional-augments/

    Package Sidebar

    Install

    npm i functional-augments

    Weekly Downloads

    3

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    23.2 kB

    Total Files

    19

    Last publish

    Collaborators

    • daniel-ac-martin