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

visgl / loaders.gl / 24369398061

13 Apr 2026 10:07PM UTC coverage: 55.756% (+0.004%) from 55.752%
24369398061

push

github

web-flow
chore: Warn if core is imported by loader module (#3379)

9478 of 18401 branches covered (51.51%)

Branch coverage included in aggregate %.

85 of 136 new or added lines in 33 files covered. (62.5%)

4 existing lines in 4 files now uncovered.

19703 of 33936 relevant lines covered (58.06%)

4979.77 hits per line

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

50.0
/modules/loader-utils/src/json-loader.ts
1
import type {LoaderWithParser, LoaderOptions} from './loader-types';
2
import type {Table, TableBatch} from '@loaders.gl/schema';
3

4
// __VERSION__ is injected by babel-plugin-version-inline
5
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
6
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
403!
7

8
export type JSONLoaderOptions = LoaderOptions;
9

10
/**
11
 * A JSON Micro loader (minimal bundle size)
12
 * Alternative to `@loaders.gl/json`
13
 */
14
export const JSONLoader = {
403✔
15
  dataType: null as unknown as Table,
16
  batchType: null as unknown as TableBatch,
17
  name: 'JSON',
18
  id: 'json',
19
  module: 'json',
20
  version: VERSION,
21
  extensions: ['json', 'geojson'],
22
  mimeTypes: ['application/json'],
23
  category: 'json',
24
  text: true,
25
  parseTextSync,
26
  parse: async arrayBuffer => parseTextSync(new TextDecoder().decode(arrayBuffer)),
×
27
  options: {}
28
} as const satisfies LoaderWithParser<Table, TableBatch, JSONLoaderOptions>;
29

30
// TODO - Better error handling!
31
function parseTextSync(text) {
UNCOV
32
  return JSON.parse(text);
×
33
}
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