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

visgl / loaders.gl / 20352515932

18 Dec 2025 09:56PM UTC coverage: 35.115% (-28.4%) from 63.485%
20352515932

push

github

web-flow
feat(loader-utils): Export is-type helpers (#3258)

1188 of 1998 branches covered (59.46%)

Branch coverage included in aggregate %.

147 of 211 new or added lines in 13 files covered. (69.67%)

30011 existing lines in 424 files now uncovered.

37457 of 108056 relevant lines covered (34.66%)

0.79 hits per line

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

87.27
/modules/obj/src/obj-loader.ts
1
// loaders.gl
1✔
2
// SPDX-License-Identifier: MIT
1✔
3
// Copyright (c) vis.gl contributors
1✔
4

1✔
5
import type {Loader, LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';
1✔
6
import type {Mesh} from '@loaders.gl/schema';
1✔
7
import {OBJFormat} from './obj-format';
1✔
8
import {parseOBJ} from './lib/parse-obj';
1✔
9

1✔
10
// __VERSION__ is injected by babel-plugin-version-inline
1✔
11
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
1✔
12
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
1!
13

1✔
14
export type OBJLoaderOptions = LoaderOptions & {
1✔
15
  obj?: {
1✔
16
    /** Override the URL to the worker bundle (by default loads from unpkg.com) */
1✔
17
    workerUrl?: string;
1✔
18
  };
1✔
19
};
1✔
20

1✔
21
/**
1✔
22
 * Worker loader for the OBJ geometry format
1✔
23
 */
1✔
24
export const OBJWorkerLoader = {
1✔
25
  ...OBJFormat,
1✔
26

1✔
27
  dataType: null as unknown as Mesh,
1✔
28
  batchType: null as never,
1✔
29
  version: VERSION,
1✔
30
  worker: true,
1✔
31
  testText: testOBJFile,
1✔
32
  options: {
1✔
33
    obj: {}
1✔
34
  }
1✔
35
} as const satisfies Loader<Mesh, never, OBJLoaderOptions>;
1✔
36

1✔
37
function testOBJFile(text: string): boolean {
×
38
  // TODO - There could be comment line first
×
39
  return text[0] === 'v';
×
40
}
×
41

1✔
42
// OBJLoader
1✔
43

1✔
44
/**
1✔
45
 * Loader for the OBJ geometry format
1✔
46
 */
1✔
47
export const OBJLoader = {
1✔
48
  ...OBJWorkerLoader,
1✔
49
  parse: async (arrayBuffer: ArrayBuffer, options?: OBJLoaderOptions) =>
1✔
UNCOV
50
    parseOBJ(new TextDecoder().decode(arrayBuffer), options),
×
51
  parseTextSync: (text: string, options?: OBJLoaderOptions) => parseOBJ(text, options)
1✔
52
} as const satisfies LoaderWithParser<Mesh, never, OBJLoaderOptions>;
1✔
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