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

babel-plugin-transform-magic-currying

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-magic-currying

Babel transform plugin for magic auto currying

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-transform-magic-currying

The goal of this plugin is to provide magic auto currying for all function like Elm does.

Example

In

const add = function (a, b, c) { return a + b + c; }

const min = (a, b) => a - b;

add(1,2,3) === add(1,2)(3)
add(1,2,3) === add(1)(2,3)
add(1,2,3) === add(1)(2)(3)

min(1,2) === min(1)(2)

Out

const add = _magicCurrying(function add(a, b) {
  return a + b;
});

const min = _magicCurrying((a, b) => a - b);

add(1,2,3) === add(1,2)(3)
add(1,2,3) === add(1)(2,3)
add(1,2,3) === add(1)(2)(3)

min(1,2) === min(1)(2)

Installation (Not ready yet)

$ npm install babel-plugin-transform-magic-currying

Usage

.babelrc

{
  "plugins": ["transform-magic-currying"]
}

Via CLI

$ babel --plugins transform-magic-currying script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-magic-currying"]
});

Keywords

FAQs

Package last updated on 18 Oct 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