(arrayLike: ArrayLike<any>)
| 107 | }; |
| 108 | |
| 109 | const copyArrayLike = (arrayLike: ArrayLike<any>) => { |
| 110 | if (!arrayLike) { |
| 111 | return []; |
| 112 | } else if (Array.isArray(arrayLike)) { |
| 113 | return [...arrayLike]; |
| 114 | } else { |
| 115 | const maxIndex = Object.keys(arrayLike) |
| 116 | .map(key => parseInt(key)) |
| 117 | .reduce((max, el) => (el > max ? el : max), 0); |
| 118 | return Array.from({ ...arrayLike, length: maxIndex + 1 }); |
| 119 | } |
| 120 | }; |
| 121 | |
| 122 | const createAlterationHandler = ( |
| 123 | alteration: boolean | Function, |
no outgoing calls
no test coverage detected
searching dependent graphs…