UNPKG

@surveycake/utils

Version:

SurveyCake Javascript Utils

11 lines (10 loc) 338 B
/** * Insert items into specific index of source. * * ```ts * insertIndex([1, 2, 3], 0, [4, 5]) => [4, 5, 1, 2, 3] * insertIndex([1, 2, 3], 1, [4, 5]) => [1, 4, 5, 2, 3] * insertIndex([1, 2, 3], 2, [4, 5]) => [1, 2, 4, 5, 3] * ``` */ export declare function insertIndex<T>(source: T[], index: number, items?: T[]): T[];