MCPcopy
hub / github.com/microsoft/SandDance / patchCubeArray

Function patchCubeArray

packages/vega-deck.gl/src/patchedCubeArray.ts:5–12  ·  view source on GitHub ↗
(allocatedSize: number, empty: Partial<Cube>, cubes: Cube[])

Source from the content-addressed store, hash-verified

3import { Cube } from './interfaces';
4
5export function patchCubeArray(allocatedSize: number, empty: Partial<Cube>, cubes: Cube[]) {
6 const patched: Cube[] = new Array<Cube>(allocatedSize);
7 patched.fill(empty as Cube);
8
9 cubes.forEach(cube => patched[cube.ordinal] = cube);
10
11 return patched;
12}

Callers 1

presentMethod · 0.90

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected