@loaders.gl/shapefile 4.2.0-alpha.5 → 4.2.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { parseDBF, parseDBFInBatches } from "./lib/parsers/parse-dbf.js";
2
2
  // __VERSION__ is injected by babel-plugin-version-inline
3
3
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
4
- const VERSION = typeof "4.2.0-alpha.4" !== 'undefined' ? "4.2.0-alpha.4" : 'latest';
4
+ const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
5
5
  /**
6
6
  * DBFLoader - DBF files are used to contain non-geometry columns in Shapefiles
7
7
  */
@@ -2,6 +2,10 @@
2
2
  (() => {
3
3
  // src/lib/streaming/binary-chunk-reader.ts
4
4
  var BinaryChunkReader = class {
5
+ offset;
6
+ arrayBuffers;
7
+ ended;
8
+ maxRewindBytes;
5
9
  constructor(options) {
6
10
  const { maxRewindBytes = 0 } = options || {};
7
11
  this.offset = 0;
@@ -144,12 +148,13 @@
144
148
  var LITTLE_ENDIAN = true;
145
149
  var DBF_HEADER_SIZE = 32;
146
150
  var DBFParser = class {
151
+ binaryReader = new BinaryChunkReader();
152
+ textDecoder;
153
+ state = 0 /* START */;
154
+ result = {
155
+ data: []
156
+ };
147
157
  constructor(options) {
148
- this.binaryReader = new BinaryChunkReader();
149
- this.state = 0 /* START */;
150
- this.result = {
151
- data: []
152
- };
153
158
  this.textDecoder = new TextDecoder(options.encoding);
154
159
  }
155
160
  /**
@@ -372,7 +377,7 @@
372
377
  }
373
378
 
374
379
  // src/dbf-loader.ts
375
- var VERSION = true ? "4.2.0-alpha.4" : "latest";
380
+ var VERSION = true ? "4.2.0-alpha.5" : "latest";
376
381
  var DBFWorkerLoader = {
377
382
  name: "DBF",
378
383
  id: "dbf",
@@ -456,7 +461,9 @@
456
461
  }
457
462
  getParentPort().then((parentPort2) => {
458
463
  if (parentPort2) {
459
- parentPort2.on("message", handleMessage);
464
+ parentPort2.on("message", (message) => {
465
+ handleMessage(message);
466
+ });
460
467
  parentPort2.on("exit", () => console.debug("Node worker closing"));
461
468
  } else {
462
469
  globalThis.onmessage = handleMessage;
package/dist/dist.dev.js CHANGED
@@ -61,6 +61,10 @@ var __exports__ = (() => {
61
61
 
62
62
  // src/lib/streaming/binary-chunk-reader.ts
63
63
  var BinaryChunkReader = class {
64
+ offset;
65
+ arrayBuffers;
66
+ ended;
67
+ maxRewindBytes;
64
68
  constructor(options) {
65
69
  const { maxRewindBytes = 0 } = options || {};
66
70
  this.offset = 0;
@@ -418,21 +422,21 @@ var __exports__ = (() => {
418
422
  ERROR: 3
419
423
  };
420
424
  var SHPParser = class {
425
+ options = {};
426
+ binaryReader = new BinaryChunkReader({ maxRewindBytes: SHP_RECORD_HEADER_SIZE });
427
+ state = STATE.EXPECTING_HEADER;
428
+ result = {
429
+ geometries: [],
430
+ // Initialize with number values to make TS happy
431
+ // These are initialized for real in STATE.EXPECTING_HEADER
432
+ progress: {
433
+ bytesTotal: NaN,
434
+ bytesUsed: NaN,
435
+ rows: NaN
436
+ },
437
+ currentIndex: NaN
438
+ };
421
439
  constructor(options) {
422
- this.options = {};
423
- this.binaryReader = new BinaryChunkReader({ maxRewindBytes: SHP_RECORD_HEADER_SIZE });
424
- this.state = STATE.EXPECTING_HEADER;
425
- this.result = {
426
- geometries: [],
427
- // Initialize with number values to make TS happy
428
- // These are initialized for real in STATE.EXPECTING_HEADER
429
- progress: {
430
- bytesTotal: NaN,
431
- bytesUsed: NaN,
432
- rows: NaN
433
- },
434
- currentIndex: NaN
435
- };
436
440
  this.options = options;
437
441
  }
438
442
  write(arrayBuffer) {
@@ -6143,12 +6147,13 @@ var __exports__ = (() => {
6143
6147
  var LITTLE_ENDIAN4 = true;
6144
6148
  var DBF_HEADER_SIZE = 32;
6145
6149
  var DBFParser = class {
6150
+ binaryReader = new BinaryChunkReader();
6151
+ textDecoder;
6152
+ state = 0 /* START */;
6153
+ result = {
6154
+ data: []
6155
+ };
6146
6156
  constructor(options) {
6147
- this.binaryReader = new BinaryChunkReader();
6148
- this.state = 0 /* START */;
6149
- this.result = {
6150
- data: []
6151
- };
6152
6157
  this.textDecoder = new TextDecoder(options.encoding);
6153
6158
  }
6154
6159
  /**
@@ -6609,6 +6614,8 @@ var __exports__ = (() => {
6609
6614
 
6610
6615
  // src/lib/streaming/binary-reader.ts
6611
6616
  var BinaryReader = class {
6617
+ offset;
6618
+ arrayBuffer;
6612
6619
  constructor(arrayBuffer) {
6613
6620
  this.offset = 0;
6614
6621
  this.arrayBuffer = arrayBuffer;