0.0.1 • Published 5 years ago

babel-plugin-preserve-arrow-function-to-string v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Build Status #babel-plugin-preserve-arrow-function-to-string

Babel plugin to preserve arrow function toString

Install

$ npm install babel-plugin-preserve-arrow-function-to-string --save-dev

Usage

.babelrc

{
  "plugins": [
    "preserve-arrow-function-to-string"
  ]
}

Motivation

Library how use metadata reflection to analyze code not work with es5 transpiled arrow function (and default parameters value, rest parameters, deconstruction ecc...). This plugin replace the native toString to match the behavior of no transpiled arrow function.

This plugin is useful with library like z how use the toString result to analyze arrow function metadata.