Added replacer in stringfy method to optionally use toString method for big ints. (#4745)

This commit is contained in:
arunvjn 2021-05-28 21:30:21 +05:30 committed by GitHub
parent cbca6bedd4
commit a133a320cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,7 +194,11 @@ export const removeFunctions = (value: any) => {
if (_.isFunction(value)) {
return "Function call";
} else if (_.isObject(value)) {
return JSON.parse(JSON.stringify(value));
return JSON.parse(
JSON.stringify(value, (_, v) =>
typeof v === "bigint" ? v.toString() : v,
),
);
} else {
return value;
}