marcello3d / node-tosource

Converts JavaScript objects to source
https://github.com/marcello3d/node-tosource
zlib License
101 stars 16 forks source link

Support Map when keys are strings #23

Closed EmileSonneveld closed 4 years ago

EmileSonneveld commented 4 years ago

Hi, first off: thanks for the nice piece of code!

My issue:

m = new Map
m.set("key1", 42)
m.set("key2", "some value")
toSource(m)

Returns "{}" It would be nice if it returned {"key1": 42, "key2": "some value"}

Any chance you would have time to implement something like this?

EmileSonneveld commented 4 years ago

Thanks man! I just used it to get the difference between 2 huge objects. :) JS code that I can copy/paste in the console: toSource_paste_in_console.txt