(arr: any[])
| 59 | |
| 60 | // Flatten if needed - items could be edges or arrays of edges |
| 61 | const flattenOnce = (arr: any[]): any[] => { |
| 62 | const flattened: any[] = []; |
| 63 | for (const item of arr) { |
| 64 | if (Array.isArray(item)) { |
| 65 | flattened.push(...item); |
| 66 | } else { |
| 67 | flattened.push(item); |
| 68 | } |
| 69 | } |
| 70 | return flattened; |
| 71 | }; |
| 72 | |
| 73 | const edges = flattenOnce(result); |
| 74 | expect(edges.length).toBeGreaterThan(0); |