Skip to content

Commit

Permalink
fix: attempts to parse IntegerInput value as a BigInt
Browse files Browse the repository at this point in the history
  • Loading branch information
iPaulPro committed Jul 17, 2024
1 parent 5a65fb1 commit ea85794
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ const isJsonString = (str: string) => {
// Recursive function to deeply parse JSON strings, correctly handling nested arrays and encoded JSON strings
const deepParseValues = (value: any): any => {
if (typeof value === "string") {
try {
return BigInt(value);
} catch (e) {
// It's not a BigInt, continue
}
if (isJsonString(value)) {
const parsed = JSON.parse(value);
return deepParseValues(parsed);
Expand Down

0 comments on commit ea85794

Please sign in to comment.