JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10410
  • Score
    100M100P100Q148621F

flexible but simple curry function

Package Exports

  • curry

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (curry) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

CURRY

#curry function without anything too clever (... because hunger is the finest spice)

can curry left an right and pass in a context object in one easy call.

var fn = curry([left],function,[right],self)

wrap your curry args in Arrays

calling fn(x) will stick x in between left and right curry ingredients.

left and right are Arrays, and are optional.

i.e.

var fn = curry(funx,[1,2,3])

is the same as

var fn = curry([],funx,[1,2,3])

this makes fn(X) call funx(X,1,2,3)

##calling styles:

in all, there are 8 ways to call the function.

curry([left],fn,[right])
curry(fn,[right])
curry([left],fn)
curry(fn)

curry([left],fn,[right],self)
curry(fn,[right],self)
curry([left],fn,self)
curry(fn,self)

#full test coverage for documented usuage!

> expresso test/curry.expresso.js