You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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 maybeMath.round(x) === x
would do?The text was updated successfully, but these errors were encountered: