Socket
Socket
Sign inDemoInstall

functional-augments

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    functional-augments

Augment collection prototypes with methods for functional programming, including filter(), map() and reduce().


Version published
Weekly downloads
6
Maintainers
1
Install size
22.7 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 28 Feb 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc