MCPcopy Create free account
hub / github.com/babel/babel / _arrayLikeToArray

Function _arrayLikeToArray

packages/babel-helpers/src/helpers/arrayLikeToArray.ts:3–10  ·  view source on GitHub ↗
(
  arr: ArrayLike<T>,
  len?: number | null,
)

Source from the content-addressed store, hash-verified

1/* @minVersion 7.9.0 */
2
3export default function _arrayLikeToArray<T>(
4 arr: ArrayLike<T>,
5 len?: number | null,
6) {
7 if (len == null || len > arr.length) len = arr.length;
8 for (var i = 0, arr2 = new Array<T>(len); i < len; i++) arr2[i] = arr[i];
9 return arr2;
10}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected