Skip to content

Commit

Permalink
simplify leaves
Browse files Browse the repository at this point in the history
  • Loading branch information
asmarcz committed Feb 17, 2024
1 parent 0ca8b05 commit e95e16d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/components/KategorieTool.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Get only leaves from array with ">"" notation
export function getLeaves(kategorieArray) {
let leaves = [];

[kategorieArray].forEach(kategorie => {
kategorie.forEach(item => {
let parts = item.split('>');
let leaf = parts[parts.length - 1].trim();
leaves.push(leaf);
});

kategorieArray.forEach(item => {
let parts = item.split('>');
let leaf = parts[parts.length - 1].trim();
leaves.push(leaf);
});

return leaves;
Expand Down

0 comments on commit e95e16d

Please sign in to comment.