New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

curry2

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curry2

Curry a binary function.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

curry2

Curry a binary function.

Build Status Code Climate js-standard-style

npm install curry2 --save

You can also use Duo, Bower or download the files manually.

npm stats

npm NPM downloads Dependency Status

API Example

require
var curry2 = require('curry2')
function to curry
var add = curry2(function (a, b) {
  return a + b
})
full application
add(5, 2)
//=> 7
partial application
var add10 = add(10)
add(5)
//=> 15
iteratee
[100, 200, 300].map(add10)
//=> [ 110, 210, 310 ]
uncurry
var orig = add.uncurry()

typeof orig
//=> 'function'

orig.length
//=> 2

Features

  • Binary functions...that's it.
  • Will always be less than 20 LOC (not including comments).
  • No dependencies.

Anti-Features

  • Will not attempt to curry n-ary functions.
  • Will never eval your functions.

Limitations

  • You will lose fn.name.

API

curry2(fn)

arguments
  • fn: (Function) Binary function to curry.
  • [self]: (Object) Function this context.
returns
  • (Function|*) If partially applied, return unary function, otherwise, return result of full application..

.uncurry()

returns
  • (Function) returns original function.

Reference

Alternatives

Contributing

SEE: contributing.md

Licenses

GitHub license

Keywords

FAQs

Package last updated on 02 Mar 2016

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