import { curryN } from "@unboxing/function"; import { CurriedFunction2 } from '@unboxing/core' interface Remove { (start: number, count: number, list: ArrayLike): T[]; (start: number, count: number): (list: ArrayLike) => T[]; (start: number): CurriedFunction2, T[]>; } /** * Removes the sub-list of `list` starting at index `start` and containing * `count` elements. _Note that this is not destructive_: it returns a copy of * the list with the changes. */ export const removeArray = curryN(3, (start: number, count: number, list: ArrayLike) => { const result = Array.prototype.slice.call(list, 0); result.splice(start, count); return result; }) as Remove