Open
Description
Relevant code, I think: https://github.com/cognitect/transit-js/blob/master/src/com/cognitect/transit/handlers.js#L126-L128
Encoding {1.5: 3.14}
results in (verbosely) "{\"~i1.5\":3.14}"
, instead of "{\"~d1.5\":3.14}"
, so it round-trips to {1: 3.14}
.
I think a fix would just involve setting the tag above based on whether the Number
is an int. Naturally JavaScript has no built-in way to do this, though. I'm not much of a JS guy, but maybe Math.round(x) === x
would do?
Metadata
Assignees
Labels
No labels