Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daniel-ac-martin/functional-augments
Augment ES6 collection prototypes with methods for functional programming, including filter(), map() and reduce().
https://github.com/daniel-ac-martin/functional-augments
Last synced: about 8 hours ago
JSON representation
Augment ES6 collection prototypes with methods for functional programming, including filter(), map() and reduce().
- Host: GitHub
- URL: https://github.com/daniel-ac-martin/functional-augments
- Owner: daniel-ac-martin
- License: isc
- Created: 2018-01-15T23:29:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-28T22:28:40.000Z (over 6 years ago)
- Last Synced: 2024-11-01T12:37:14.405Z (5 days ago)
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Functional Augments for ES6 objects
===================================
[![Build Status][ci-badge]][ci]This package augments the prototypes of the following collections in ES6 with
methods for functional programming similar to Arrays:* Map
* Object
* Set
* StringCurrently the following methods are provided:
* filter()
* map()
* reduce()Functions provided to methods on keyed collections take an optional third
parameter for the key.Installation
------------```bash
$ npm install --save functional-augments
```Usage
-----```js
'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
```[ci]: https://travis-ci.org/daniel-ac-martin/functional-augments
[ci-badge]: https://travis-ci.org/daniel-ac-martin/functional-augments.svg?branch=master