API ReferenceAdvanced utilities and typesFunction
safeStringify()
function safeStringify(data, replacer?): string;Stringify function that should be used in place of JSON.stringify because it handles bigints without error.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
data | unknown | undefined | The data to stringify. |
replacer | (key, value) => any | bigIntReplacer | Optional custom replacer function to override the default behavior. |
Returns
string
The resulting JSON string.