Skip to content

Commit 78dbbf6

Browse files
committed
fix: allow replacing more than one array
1 parent f6f1e4e commit 78dbbf6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const createResultObject = (sourceData, seek: string[], populate: string[
44
const getNestedValue = (obj: any, path: string) => {
55
return path.split(".").reduce((acc, part) => {
66
if (acc && part.includes("[")) {
7-
const [key, index] = part.replace("]", "").split("[");
7+
const [key, index] = part.replace(/\]/g, "").split("[");
88
return acc[key]?.[index];
99
}
1010
return acc ? acc[part] : undefined;

0 commit comments

Comments
 (0)