(arr: any[])
| 17 | const [reset, getNow, pause] = getTimeFunctions(); |
| 18 | |
| 19 | const permute = (arr: any[]): any[] => { |
| 20 | if (arr.length == 1) { |
| 21 | return [arr[0]]; |
| 22 | } |
| 23 | const permutations: any[] = []; |
| 24 | arr.forEach((item, i) => |
| 25 | permute([...arr.slice(0, i), ...arr.slice(i + 1)]).forEach((other) => |
| 26 | permutations.push([item, other].flat()), |
| 27 | ), |
| 28 | ); |
| 29 | return permutations; |
| 30 | }; |
| 31 | |
| 32 | beforeEach(() => { |
| 33 | reset(); |
no outgoing calls
no test coverage detected
searching dependent graphs…