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

visgl / loaders.gl / 24153816851

08 Apr 2026 07:17PM UTC coverage: 53.247% (-12.1%) from 65.319%
24153816851

push

github

web-flow
chore: Move from tape to vitest (#3351)

8651 of 17291 branches covered (50.03%)

Branch coverage included in aggregate %.

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

2031 existing lines in 296 files now uncovered.

17563 of 31940 relevant lines covered (54.99%)

5279.54 hits per line

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

66.67
/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';
348!
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 = {
348✔
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,
UNCOV
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) {
32
  return JSON.parse(text);
3✔
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