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

babel-plugin-function-composition

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-function-composition

Babel plugin to compose functions with piping using the & operator

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-plugin-function-composition

This plugin is made to work with point-free (tacit) functional programming by composing functions over piping. It is inspired by the work of babel-plugin-pipe-operator-curry, but with a very different purpose, with focus on omitting arguments. I've overloaded the operator & for that. You can built more complex functions from simple ones.

Examples

import { add, multiply } from 'ramda';

const add5AndMul5 = add(5) & multiply(5);

Turn into

import { add, multiply } from 'ramda';

const add5AndMul5 = (...args) => multiply(5)(add(5)(...args));

Disabling in current scope

If you want to use the original bitwise and operator, you can disable this plugin in current scope (and it children scopes) using 'no composition directive.

Installation

$ npm install --save-dev babel-plugin-function-composition

Usage

.babelrc

{
  "plugins": ["function-composition"]
}

Via CLI

$ babel --plugins function-composition script.js

Via Node API

require('babel-core').transform('code', {
  plugins: ['function-composition']
});

License

MIT

Keywords

FAQs

Package last updated on 03 Jan 2018

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