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

visgl / loaders.gl / 24907303489

24 Apr 2026 07:12PM UTC coverage: 59.423% (+0.09%) from 59.334%
24907303489

push

github

web-flow
feat: Dynamic import loaders (#3405)

11252 of 20783 branches covered (54.14%)

Branch coverage included in aggregate %.

1164 of 1518 new or added lines in 244 files covered. (76.68%)

41 existing lines in 18 files now uncovered.

23432 of 37585 relevant lines covered (62.34%)

16317.58 hits per line

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

83.33
/modules/shapefile/src/dbf-arrow-loader-with-parser.ts
1
// loaders.gl
2
// SPDX-License-Identifier: MIT
3
// Copyright (c) vis.gl contributors
4

5
import type {Loader, LoaderWithParser, StrictLoaderOptions} from '@loaders.gl/loader-utils';
6
import type {ArrowTable, ArrowTableBatch} from '@loaders.gl/schema';
7
import {parseDBF, parseDBFInBatches} from './lib/parsers/parse-dbf-to-arrow';
8
import {DBFArrowWorkerLoader as DBFArrowWorkerLoaderMetadata} from './dbf-arrow-loader';
9
import {DBFArrowLoader as DBFArrowLoaderMetadata} from './dbf-arrow-loader';
10

11
const {preload: _DBFArrowWorkerLoaderPreload, ...DBFArrowWorkerLoaderMetadataWithoutPreload} =
12
  DBFArrowWorkerLoaderMetadata;
6✔
13
const {preload: _DBFArrowLoaderPreload, ...DBFArrowLoaderMetadataWithoutPreload} =
14
  DBFArrowLoaderMetadata;
6✔
15

16
export type DBFLoaderOptions = StrictLoaderOptions & {
17
  dbf?: {
18
    encoding?: string;
19
    /** Override the URL to the worker bundle (by default loads from unpkg.com) */
20
    workerUrl?: string;
21
  };
22
};
23

24
/**
25
 * DBFLoader - DBF files are used to contain non-geometry columns in Shapefiles
26
 */
27
export const DBFArrowWorkerLoaderWithParser = {
6✔
28
  ...DBFArrowWorkerLoaderMetadataWithoutPreload
29
} as const satisfies Loader<ArrowTable, ArrowTableBatch, DBFLoaderOptions>;
30

31
/** DBF file loader */
32
export const DBFArrowLoaderWithParser = {
6✔
33
  ...DBFArrowLoaderMetadataWithoutPreload,
34
  parse: async (arrayBuffer, options) => parseDBF(arrayBuffer, options),
50✔
35
  parseSync: parseDBF,
36
  parseInBatches(
37
    arrayBufferIterator:
38
      | AsyncIterable<ArrayBufferLike | ArrayBufferView>
39
      | Iterable<ArrayBufferLike | ArrayBufferView>,
40
    options
41
  ) {
NEW
42
    return parseDBFInBatches(arrayBufferIterator, options);
×
43
  }
44
} as const satisfies LoaderWithParser<ArrowTable, ArrowTableBatch, DBFLoaderOptions>;
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