v2.3.0
- Accept the
Error
constructor ascircularValue
option to throw on circular references as the regular JSON.stringify would:
import { configure } from 'safe-stable-stringify'
const object = {}
object.circular = object;
const stringify = configure({ circularValue: TypeError })
stringify(object)
// TypeError: Converting circular structure to JSON
- Fixed escaping wrong surrogates. Only lone surrogates are now escaped.