roman01la / javascript-to-clojurescript

JavaScript to ClojureScript translator
https://roman01la.github.io/javascript-to-clojurescript/
102 stars 6 forks source link

JSON objects not recognized #10

Closed unison3 closed 2 years ago

unison3 commented 4 years ago

I am not an advanced developer otherwise I would attempt a fix myself...

Through trial and error using your amazing translator, I whittled down one of the possible reasons why the large block of js code I tried was not working, it seems to not recognise the JSON formatting, as follows;

const assetData = { "type": "MyType", "item": mydata };

It would be great if you could add a translation rule to deal with JSON

Keep up the good work

Thanks

roman01la commented 2 years ago

works great

const assetData = { "type": "MyType", "item": mydata };
(def assetData #js {:type "MyType", :item mydata})