BundlerMinifier icon indicating copy to clipboard operation
BundlerMinifier copied to clipboard

Cannot Minify lamba with lots of valid bracket types

Open CreepyGnome opened this issue 3 years ago • 0 comments

Installed product versions

  • CLI .NET 5.0

Description

This line of code breaks the minifier:

result.data.reduce((a,x) => ({...a, [x.Id]: x}), {});

It doesn't like one or all of those various brackets to the right of the fat arrow.

Gives this output:

  Expected ')': ...
  Expected ')': ...
  Expected ';'
  Expected ';'
  Expected expression: :
  Expected ';'
  Expected expression: )
  Expected expression: ,
  Expected identifier: (
  Expected expression: )
  Expected ')': }

When not minified everything works, not sure why this isn't supported as it is valid JS.

Steps to recreate

  1. Minify this result.data.reduce((a,x) => ({...a, [x.Id]: x}), {});

Current behavior

Fails with the above errors

Expected behavior

Minify the valid line of JS.

CreepyGnome avatar Apr 15 '21 16:04 CreepyGnome