babel-plugin-transform-function-to-arrow
Converts function expressions to arrow expressions
Last updated 10 years ago by boopathi .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install babel-plugin-transform-function-to-arrow 
SYNC missed versions from official npm registry.

babel-plugin-transform-function-to-arrow

Transforms functions to arrows and simplifies arrow functions with single return statement

Install

npm install babel-plugin-transform-function-to-arrow

In

const x = function (a, b) { return a + b }
const y = (x) => {
  return Math.sin(x);
}
const z = function () {
  return arguments[0];
}

Out

const x = (a,b) => a+b;
const y = x => Math.sin(x);
const z = function () {
  return arguments[0];
}

Options

  • keep_fnames: [Default: false] Don't transform functions to arrows for FunctionExpressions with names - Useful for code depending on fn.name.

Current Tags

  • 0.1.1                                ...           latest (10 years ago)

2 Versions

  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |