(data: T[], indexes: number[])
| 3 | import isUndefined from './isUndefined'; |
| 4 | |
| 5 | function removeAtIndexes<T>(data: T[], indexes: number[]): T[] { |
| 6 | let i = 0; |
| 7 | const temp = [...data]; |
| 8 | |
| 9 | for (const index of indexes) { |
| 10 | temp.splice(index - i, 1); |
| 11 | i++; |
| 12 | } |
| 13 | |
| 14 | return compact(temp).length ? temp : []; |
| 15 | } |
| 16 | |
| 17 | export default <T>(data: T[], index?: number | number[]): T[] => |
| 18 | isUndefined(index) |