Safely and quickly serialize JavaScript objects
In https://github.com/visionmedia/superagent/commit/2e5d6fdbe026c1934c0a0fbe2ec933a13b60af1a the [Superagent](https://github.com/visionmedia/superagent) library changed from using `JSON.stringify` to using `fast-safe-stringify` for it's default object serializer when sending JSON data. We use [Sequelize](https://github.com/sequelize/sequelize) for our ORM. Sequelize uses their own custom object structure, which supports a `.toJSON` call. When Superagent was using `JSON.stringify`, that called the `.toJSON` method on our Sequelize objects, properly converting them to JSON. However, with the change to `fast-safe-stringify`, `.toJSON` is no longer called, even if it exists. I'm not sure how to provide a copy of the object in question since getting its JSON representation is unlikely to be helpful, since all the Sequelize specifics are stripped from that. Is there a reason this library does not call `.toJSON` if it exists?
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by MatthewHerbst and has received 16 comments.