Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

cumpa

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Issues
File Explorer

Advanced tools

cumpa

Minimal function composition implementation

    1.0.1latest
    GitHub

Version published
Maintainers
1
Weekly downloads
610
decreased by-47.64%

Weekly downloads

Readme

Source

cumpa

Minimal function composition implementation

cumpa

cumpá in some Italian :it: dialects means fellow

Build Status

NPM version NPM downloads MIT License

Usage

import compose from 'cumpa' const add2 = x => x + 2 const multiplyBy3 = x => x * 3 const add2AndMultiplyBy3 = compose(multiplyBy3, add2) console.log(add2AndMultiplyBy3(1)) // ((1 + 2) * 3) = 9

API

Table of Contents

composeRight

Similar to compose but performs from left-to-right function composition.
see also

Parameters
  • fns ...[function] ) - list of unary fynctions

Returns any result of the computation

compose

Performs right-to-left function composition. Use Array.prototype.reduce() to perform right-to-left function composition. The last (rightmost) function can accept one or more arguments; the remaining functions must be unary.
source code

Parameters
  • fns ...[function] ) - list of unary fynctions

Returns any result of the computation

Keywords

FAQs

Last updated on 30 Mar 2019

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • 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