Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cumpa

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cumpa

Minimal function composition implementation

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
961
increased by3.22%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 30 Mar 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc