serialize-javascript icon indicating copy to clipboard operation
serialize-javascript copied to clipboard

ES6 & standardJS syntax

Open mesqueeb opened this issue 5 years ago • 1 comments

I'd love an option to render functions in modern ES6 and standardJS syntax.

Eg. instead of

const echo = function (arg) { return arg; }

I'd want

const echo = arg => arg

standardJS is about small details like single vs double quotes, no semicolons, etc.

mesqueeb avatar Dec 06 '19 22:12 mesqueeb

I don't think it's serialize-javascript's role to rewrite the syntax. You would be better to pass your source code written in the syntax you want to serialize?

okuryu avatar Dec 07 '19 09:12 okuryu