MCPcopy Index your code
hub / github.com/angular/angular / interleave

Function interleave

packages/compiler/src/expression_parser/serializer.ts:201–210  ·  view source on GitHub ↗

* Interleaves the two arrays, starting with the first item on the left, then the first item * on the right, second item from the left, and so on. When the first array's items are exhausted, * the remaining items from the other array are included with no interleaving.

(left: Left[], right: Right[])

Source from the content-addressed store, hash-verified

199 * the remaining items from the other array are included with no interleaving.
200 */
201function interleave<Left, Right>(left: Left[], right: Right[]): Array<Left | Right> {
202 const result: Array<Left | Right> = [];
203
204 for (let index = 0; index < Math.max(left.length, right.length); index++) {
205 if (index < left.length) result.push(left[index]);
206 if (index < right.length) result.push(right[index]);
207 }
208
209 return result;
210}

Callers 1

visitInterpolationMethod · 0.85

Calls 2

maxMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…