substack/json-stable-stringify — pull request #5 by RickEyre (2014-02-04 22:53:03+00:00)
Title: Should call 'toJSON' if it is defined on the object being stringified.

Call `toJSON` if it is defined as a property on the object and is a function.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON_behavior

I'm currently using this module and have had to do a workaround to get this behaviour.