Return a deterministic stringified string str from the object obj.
options
cmp
If opts is given, you can supply an opts.cmp to have a custom comparison function for object keys. Your function opts.cmp is called with these parameters:
For example, to sort on the object key names in reverse order you could write:
which results in the output string:
Or if you wanted to sort on the object values in reverse order, you could write:
which outputs:
cycles
Pass true in opts.cycles to stringify circular property as __cycle__ - the result will not be a valid JSON string in this case.
TypeError will be thrown in case of circular object without this option.
fast-json-stable-stringify package is a part of Tidelift enterprise subscription - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers.
Security contact
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues.