node-modules / serialize-json

A serialize algorithm for JSON
MIT License
23 stars 4 forks source link

Code Doesn't Compile #3

Open HoldOffHunger opened 7 years ago

HoldOffHunger commented 7 years ago

Hi, there,

It seems that the code does not compile in serialize-json.

static/js/main.7ceea777.js from UglifyJs
Unexpected token: name (JSONDecoder) [./~/serialize-json/lib/decoder.js:21,0][static/js/main.7ceea777.js:55947,6]

Thanks!

HoldOffHunger commented 7 years ago

Just a note, to others who find themselves stuck on this problem:

The following NPM package turned out to be optimal for my solution: https://www.npmjs.com/package/json-cycle

krasimir commented 6 years ago

The problem is that the decoder file uses class keyword which uglify can not understand. The module needs to be bundled via webpack or something like this so it gets transpiled to ES5.