◐ Shell
clean mode source ↗

encoder: Encode instances of Number as numbers, not maps by FlorianDenis · Pull Request #271 · msgpack/msgpack-javascript

I am not going to go too much into the details of my project because this is not the place, but it turns out that I have a need for representing a integer using an object instance rather than a primitive type, a need which Number was built into the language to fulfill. This is a deliberate choice, not a bug.

My goal with this PR is merely to point out that Number does exist today as a core part of the language (has since ES1, really), and so the question this poses here is:

  • Do we consider the MessagePack representation of it should be a map
  • Or do we consider it should be a int/float?