yahoo / serialize-javascript

Serialize JavaScript to a superset of JSON that includes regular expressions and functions.
Other
2.83k stars 182 forks source link

ES6 & standardJS syntax #63

Open mesqueeb opened 4 years ago

mesqueeb commented 4 years ago

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.

okuryu commented 4 years ago

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?