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

visgl / loaders.gl / 24139120841

08 Apr 2026 01:53PM UTC coverage: 65.319% (+30.2%) from 35.137%
24139120841

push

github

web-flow
chore: Replace puppeteer with playwright (#3350)

14216 of 18890 branches covered (75.26%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

3248 existing lines in 369 files now uncovered.

73509 of 115413 relevant lines covered (63.69%)

5763.45 hits per line

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

4.55
/modules/core/src/lib/api/select-source.ts
UNCOV
1
// loaders.gl
×
UNCOV
2
// SPDX-License-Identifier: MIT
×
UNCOV
3
// Copyright (c) vis.gl contributors
×
UNCOV
4

×
UNCOV
5
import type {Source} from '@loaders.gl/loader-utils';
×
UNCOV
6

×
UNCOV
7
/** Guess service type from URL */
×
UNCOV
8
export function selectSource(
×
9
  url: string | Blob,
×
10
  sources: Source[],
×
11
  options?: {
×
12
    /** Provide id of a source to select that source. Omit or provide 'auto' to test the source*/
×
13
    type?: string;
×
14
    nothrow?: boolean;
×
15
  }
×
16
): Source | null {
×
17
  const type = options?.type || 'auto';
×
18
  let selectedSource: Source | null = null;
×
19
  if (type === 'auto') {
×
20
    for (const source of sources) {
×
21
      if (typeof url === 'string' && source.testURL && source.testURL(url)) {
×
22
        return source;
×
23
      }
×
24
    }
×
25
  } else {
×
26
    selectedSource = getSourceOfType(type, sources);
×
27
  }
×
28

×
29
  if (!selectedSource && !options?.nothrow) {
×
30
    throw new Error('Not a valid image source type');
×
31
  }
×
32

×
33
  return selectedSource;
×
34
}
×
35

1✔
36
/** Guess service type from URL */
1✔
37
function getSourceOfType(type: string, sources: Source[]): Source | null {
×
38
  for (const service of sources) {
×
39
    if (service.type === type) {
×
40
      return service;
×
41
    }
×
42
  }
×
43
  return null;
×
44
}
×
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