From a133a320cfcfc77df9b9b5e471a9b606e697893a Mon Sep 17 00:00:00 2001 From: arunvjn <32433245+arunvjn@users.noreply.github.com> Date: Fri, 28 May 2021 21:30:21 +0530 Subject: [PATCH] Added replacer in stringfy method to optionally use toString method for big ints. (#4745) --- app/client/src/workers/evaluationUtils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/client/src/workers/evaluationUtils.ts b/app/client/src/workers/evaluationUtils.ts index 1de5854492..1967e7267d 100644 --- a/app/client/src/workers/evaluationUtils.ts +++ b/app/client/src/workers/evaluationUtils.ts @@ -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; }