(node: any)
| 55 | const pathsSet = new Set(invalid_router_name_list) |
| 56 | |
| 57 | function processNode(node: any): boolean { |
| 58 | if (node.name && pathsSet.has(node.name)) { |
| 59 | return true |
| 60 | } |
| 61 | if (node.children) { |
| 62 | const newChildren: any[] = [] |
| 63 | |
| 64 | for (const child of node.children) { |
| 65 | const shouldRemove = processNode(child) |
| 66 | if (!shouldRemove) { |
| 67 | newChildren.push(child) |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | if (newChildren.length > 0) { |
| 72 | node.children = newChildren |
| 73 | return false |
| 74 | } else { |
| 75 | node.children = undefined |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | return false |
| 80 | } |
| 81 | |
| 82 | let i = 0 |
| 83 | while (i < tree.length) { |
no test coverage detected