lighterio/cedar — pull request #4 by zerious (2014-10-30 20:13:34+00:00)
Title: Made the stringify lib wrap JSON.stringify

The native JSON.stringify is not circular-safe. There are 3 possible solutions for dealing with this:

* Use something else (like a wrapper) in each place where you want to stringify.
* Pass a `replacer` as the 2nd argument each time JSON.stringify is called.
* Wrap JSON.stringify with a function that calls JSON.stringify with a default replacer if none is provided.

I've decided to go with option 3, and all libraries that use Cedar (such as Lighter) will benefit from the wrapper.