pgriess/node-msgpack — Issue #21: Feature request: be compatible with toJSON functions
Author: download13
Created: 2011-10-17 09:35:04+00:00
State: open

`toJSON` is a standard function, which, if present on an object, get's called to return the contents of the object instead of a JSON serializer attempting to enumerate.
It would be nice if we could re-use our `toJSON` functions with msgpack without having to write some sort of adapter.
That is, msgpack will check each object it is ready to serialize for a `toJSON` function, and if one is present, use the data from it to build the serialized version of that object.