MCPcopy Create free account
hub / github.com/Wscats/vscode-explore / arrayInsert

Function arrayInsert

contributes/src/vs/base/common/arrays.ts:504–508  ·  view source on GitHub ↗
(target: T[], insertIndex: number, insertArr: T[])

Source from the content-addressed store, hash-verified

502 * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array
503 */
504export function arrayInsert<T>(target: T[], insertIndex: number, insertArr: T[]): T[] {
505 const before = target.slice(0, insertIndex);
506 const after = target.slice(insertIndex);
507 return before.concat(insertArr, after);
508}
509
510/**
511 * Uses Fisher-Yates shuffle to shuffle the given array

Callers

nothing calls this directly

Calls 2

sliceMethod · 0.80
concatMethod · 0.80

Tested by

no test coverage detected