Skip to content
function safeStringify(data, replacer?): string;

Stringify function that should be used in place of JSON.stringify because it handles bigints without error.

Parameters

ParameterTypeDefault valueDescription
dataunknownundefinedThe data to stringify.
replacer(key, value) => anybigIntReplacerOptional custom replacer function to override the default behavior.

Returns

string

The resulting JSON string.