spec-tools
spec-tools copied to clipboard
Coerce JS objects?
I was trying to coerce some data that came from JS land. After you do js-clj
it works nicely, but of course this creates a bunch of extra intermediate values. For example a JS array first gets converted to a vector, and then again to a set.
Would it be possible to add a few transforms that coerce JS values directly?
sure, PR welcome!
Awesome. Any pointers on what this would entail? I found this code but I'm not really sure how it works and what I'd need to add to support JS objects. https://github.com/metosin/spec-tools/blob/d05e6e3c76c3c6ff847aa3f8e66344df2705aeae/src/spec_tools/transform.cljc#L207