Function to stringify data correctly. Some data types like Error, Map, Set, etc. are not stringified correctly by JSON.stringify. This function handles those cases and avoids circular references.
The data to be stringified.
The stringified data.
Function to stringify data correctly. Some data types like Error, Map, Set, etc. are not stringified correctly by JSON.stringify. This function handles those cases and avoids circular references.