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

visgl / loaders.gl / 25070233425

28 Apr 2026 06:20PM UTC coverage: 59.434% (+0.01%) from 59.423%
25070233425

push

github

web-flow
website: Add tabs for navigating between format docs (#3407)

11310 of 20887 branches covered (54.15%)

Branch coverage included in aggregate %.

89 of 136 new or added lines in 13 files covered. (65.44%)

1742 existing lines in 132 files now uncovered.

23500 of 37682 relevant lines covered (62.36%)

16296.63 hits per line

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

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

5
import type {Loader, LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';
6
import type {MTLMaterial, ParseMTLOptions} from './lib/parse-mtl';
7
import {parseMTL} from './lib/parse-mtl';
8
import {MTLWorkerLoader as MTLWorkerLoaderMetadata} from './mtl-loader';
9
import {MTLLoader as MTLLoaderMetadata} from './mtl-loader';
10

11
const {preload: _MTLWorkerLoaderPreload, ...MTLWorkerLoaderMetadataWithoutPreload} =
12
  MTLWorkerLoaderMetadata;
2✔
13
const {preload: _MTLLoaderPreload, ...MTLLoaderMetadataWithoutPreload} = MTLLoaderMetadata;
2✔
14

15
export type MTLLoaderOptions = LoaderOptions & {
16
  mtl?: ParseMTLOptions;
17
};
18

19
/**
20
 * Loader for the MTL material format
21
 * Parses a Wavefront .mtl file specifying materials
22
 */
23
export const MTLWorkerLoaderWithParser = {
2✔
24
  ...MTLWorkerLoaderMetadataWithoutPreload
25
} as const satisfies Loader<MTLMaterial[], never, LoaderOptions>;
26

27
// MTLLoaderWithParser
28

29
/**
30
 * Loader for the MTL material format
31
 */
32
export const MTLLoaderWithParser = {
2✔
33
  ...MTLLoaderMetadataWithoutPreload,
UNCOV
34
  parse: async (arrayBuffer: ArrayBuffer, options?: MTLLoaderOptions) =>
35
    parseMTL(new TextDecoder().decode(arrayBuffer), options?.mtl),
36
  parseTextSync: (text: string, options?: MTLLoaderOptions) => parseMTL(text, options?.mtl)
2✔
37
} as const satisfies LoaderWithParser<MTLMaterial[], never, MTLLoaderOptions>;
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