Skip to content

v2.3.0

Compare
Choose a tag to compare
@BridgeAR BridgeAR released this 29 Nov 01:51
· 29 commits to main since this release
  • Accept the Error constructor as circularValue 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.