minify
minify copied to clipboard
Remove parentheses around anonymous functions
It seems that currently, this adds parentheses around every arrow function, such as giving:
arr.reduce(((e,t)=>e+t),0)
which could be:
arr.reduce((e,t)=>e+t,0)
Looks like default options are missing https://github.com/terser/terser, do you have any ideas what should be added?
Hm, I'm not really sure. Providing all of them is a bit much -- at some point, you just use terser directly. To address the issue, you should at least provide the format options wrap_iife and wrap_func_args, and probably also the compress option negate_iife.
Sounds reasonable, are you willing for a PR?
Sure, if I get the chance I would like to, but I'm not sure whether I'd be able to in a reasonable amount of time.
Looks like this is no longer an issue, since Minify v10:
$ echo 'arr.reduce(((e,t)=>e+t),0)'| bin/minify.js --js
arr.reduce((e, t)=>e+t,0);