• 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

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

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

1✔
8
export type JSONLoaderOptions = LoaderOptions;
1✔
9

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

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