Skip to content

Commit 3ad99b1

Browse files
committed
fix: parse nested json strings in case there are any, while not breaking normal json structures
1 parent 078c4ca commit 3ad99b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kleros-sdk/src/dataMappings/utils/replacePlaceholdersWithValues.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ export const replacePlaceholdersWithValues = (mapping: any, context: any) => {
99
}
1010
});
1111

12-
return JSON.parse(replacedMapping);
12+
const parsedReplacedMapping = JSON.parse(replacedMapping.replace(/"(\{.*?\})"/g, "$1"));
13+
return parsedReplacedMapping;
1314
};

0 commit comments

Comments
 (0)