• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / luma.gl / 23355601514

20 Mar 2026 05:50PM UTC coverage: 52.166% (-25.8%) from 77.934%
23355601514

push

github

web-flow
chore: Migrate to vitest (#2554)

4188 of 11561 branches covered (36.23%)

Branch coverage included in aggregate %.

613 of 632 new or added lines in 22 files covered. (96.99%)

343 existing lines in 28 files now uncovered.

7757 of 11337 relevant lines covered (68.42%)

394.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/modules/webgl/src/utils/fill-array.ts
1
// luma.gl
2
// SPDX-License-Identifier: MIT
3
// Copyright (c) vis.gl contributors
4

5
import type {NumericArray} from '@math.gl/types';
6

7
// Uses copyWithin to significantly speed up typed array value filling
8
export function fillArray(options: {
9
  target: NumericArray;
10
  source: NumericArray;
11
  start?: number;
12
  count?: number;
13
}): NumericArray {
UNCOV
14
  const {target, source, start = 0, count = 1} = options;
×
UNCOV
15
  const length = source.length;
×
UNCOV
16
  const total = count * length;
×
UNCOV
17
  let copied = 0;
×
UNCOV
18
  for (let i = start; copied < length; copied++) {
×
UNCOV
19
    target[i++] = source[copied] ?? 0;
×
20
  }
21

UNCOV
22
  while (copied < total) {
×
23
    // If we have copied less than half, copy everything we got
24
    // else copy remaining in one operation
UNCOV
25
    if (copied < total - copied) {
×
UNCOV
26
      target.copyWithin(start + copied, start, start + copied);
×
UNCOV
27
      copied *= 2;
×
28
    } else {
UNCOV
29
      target.copyWithin(start + copied, start, start + total - copied);
×
UNCOV
30
      copied = total;
×
31
    }
32
  }
33

UNCOV
34
  return options.target;
×
35
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc