Skip to content

Commit

Permalink
#1863 unreachable code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dk1844 committed Oct 18, 2021
1 parent adb2b4d commit 96124c1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions menas/ui/components/mappingTable/filterEdit/FilterEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,17 @@ class FilterEdit {
switch (field.type) {
case "struct":
case "array":
const children = FilterEdit.extractFieldNamesInDepth(field.children);
const prefix = field.name;
// add prefix to all
const prefixedChildren = children.map(child => {
const children = FilterEdit.extractFieldNamesInDepth(field.children);
const prefix = field.name;

// add prefix to all
const prefixedChildren = children.map(child => {
let childCopy = $.extend(true, {}, child); // being immutable
childCopy.name = `${prefix}.${child.name}`; // prepending "parentName." for this recursion level
return childCopy;
});

return prefixedChildren;
break;

return prefixedChildren; // no break needed
default:
return [{name: field.name, type: field.type}]; // leaf field
}
Expand Down

0 comments on commit 96124c1

Please sign in to comment.