Skip to content

Commit

Permalink
Merge branch 'master-portable'
Browse files Browse the repository at this point in the history
  • Loading branch information
oas committed Dec 11, 2023
2 parents 2adfade + 73ab7cf commit 1e2f2b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/src/components/json/json-builder-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,11 @@ export default {

const mergedArray = [];

for (let i = 0; i < existingElements.length; i++) {
mergedArray.push(this.merge(JSON.parse(JSON.stringify(existingElements[i])), updateElements[useFirstUpdateElement ? 0 : i]));
const length = Math.max(existingElements.length, updateElements.length);
for (let i = 0; i < length; i++) {
const existingElement = existingElements[i] === undefined ? (useFirstUpdateElement ? existingElements[0] : undefined) : JSON.parse(JSON.stringify(existingElements[i]));
const updateElement = updateElements[i] === undefined ? (useFirstUpdateElement ? updateElements[0] : undefined) : updateElements[i];
mergedArray.push(this.merge(existingElement, updateElement));
}

return {
Expand Down

0 comments on commit 1e2f2b4

Please sign in to comment.