• 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

93.88
/modules/obj/src/mtl-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, LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';
1✔
6
import type {MTLMaterial, ParseMTLOptions} from './lib/parse-mtl';
1✔
7
import {parseMTL} from './lib/parse-mtl';
1✔
8
import {MTLFormat} from './mtl-format';
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 MTLLoaderOptions = LoaderOptions & {
1✔
15
  mtl?: ParseMTLOptions;
1✔
16
};
1✔
17

1✔
18
/**
1✔
19
 * Loader for the MTL material format
1✔
20
 * Parses a Wavefront .mtl file specifying materials
1✔
21
 */
1✔
22
export const MTLWorkerLoader = {
1✔
23
  ...MTLFormat,
1✔
24

1✔
25
  dataType: null as unknown as MTLMaterial[],
1✔
26
  batchType: null as never,
1✔
27

1✔
28
  version: VERSION,
1✔
29
  worker: true,
1✔
30
  testText: (text: string): boolean => text.includes('newmtl'),
1✔
31
  options: {
1✔
32
    mtl: {}
1✔
33
  }
1✔
34
} as const satisfies Loader<MTLMaterial[], never, LoaderOptions>;
1✔
35

1✔
36
// MTLLoader
1✔
37

1✔
38
/**
1✔
39
 * Loader for the MTL material format
1✔
40
 */
1✔
41
export const MTLLoader = {
1✔
42
  ...MTLWorkerLoader,
1✔
43
  parse: async (arrayBuffer: ArrayBuffer, options?: MTLLoaderOptions) =>
1✔
UNCOV
44
    parseMTL(new TextDecoder().decode(arrayBuffer), options?.mtl),
×
45
  parseTextSync: (text: string, options?: MTLLoaderOptions) => parseMTL(text, options?.mtl)
1✔
46
} as const satisfies LoaderWithParser<MTLMaterial[], never, MTLLoaderOptions>;
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