@loaders.gl/shapefile 3.1.6 → 3.2.0-alpha.1

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.
@@ -732,7 +732,7 @@
732
732
  }
733
733
 
734
734
  // src/dbf-loader.ts
735
- var VERSION = true ? "3.1.6" : "latest";
735
+ var VERSION = true ? "3.2.0-alpha.1" : "latest";
736
736
  var DBFWorkerLoader = {
737
737
  name: "DBF",
738
738
  id: "dbf",
@@ -791,16 +791,33 @@
791
791
  }
792
792
 
793
793
  // ../worker-utils/src/lib/worker-farm/worker-body.ts
794
+ function getParentPort() {
795
+ let parentPort;
796
+ try {
797
+ eval("globalThis.parentPort = require('worker_threads').parentPort");
798
+ parentPort = globalThis.parentPort;
799
+ } catch {
800
+ }
801
+ return parentPort;
802
+ }
794
803
  var onMessageWrapperMap = new Map();
795
804
  var WorkerBody = class {
805
+ static inWorkerThread() {
806
+ return typeof self !== "undefined" || Boolean(getParentPort());
807
+ }
796
808
  static set onmessage(onMessage) {
797
- self.onmessage = (message) => {
798
- if (!isKnownMessage(message)) {
799
- return;
800
- }
801
- const { type, payload } = message.data;
809
+ function handleMessage(message) {
810
+ const parentPort3 = getParentPort();
811
+ const { type, payload } = parentPort3 ? message : message.data;
802
812
  onMessage(type, payload);
803
- };
813
+ }
814
+ const parentPort2 = getParentPort();
815
+ if (parentPort2) {
816
+ parentPort2.on("message", handleMessage);
817
+ parentPort2.on("exit", () => console.debug("Node worker closing"));
818
+ } else {
819
+ globalThis.onmessage = handleMessage;
820
+ }
804
821
  }
805
822
  static addEventListener(onMessage) {
806
823
  let onMessageWrapper = onMessageWrapperMap.get(onMessage);
@@ -809,22 +826,36 @@
809
826
  if (!isKnownMessage(message)) {
810
827
  return;
811
828
  }
812
- const { type, payload } = message.data;
829
+ const parentPort3 = getParentPort();
830
+ const { type, payload } = parentPort3 ? message : message.data;
813
831
  onMessage(type, payload);
814
832
  };
815
833
  }
816
- self.addEventListener("message", onMessageWrapper);
834
+ const parentPort2 = getParentPort();
835
+ if (parentPort2) {
836
+ console.error("not implemented");
837
+ } else {
838
+ globalThis.addEventListener("message", onMessageWrapper);
839
+ }
817
840
  }
818
841
  static removeEventListener(onMessage) {
819
842
  const onMessageWrapper = onMessageWrapperMap.get(onMessage);
820
843
  onMessageWrapperMap.delete(onMessage);
821
- self.removeEventListener("message", onMessageWrapper);
844
+ const parentPort2 = getParentPort();
845
+ if (parentPort2) {
846
+ console.error("not implemented");
847
+ } else {
848
+ globalThis.removeEventListener("message", onMessageWrapper);
849
+ }
822
850
  }
823
851
  static postMessage(type, payload) {
824
- if (self) {
825
- const data = { source: "loaders.gl", type, payload };
826
- const transferList = getTransferList(payload);
827
- self.postMessage(data, transferList);
852
+ const data = { source: "loaders.gl", type, payload };
853
+ const transferList = getTransferList(payload);
854
+ const parentPort2 = getParentPort();
855
+ if (parentPort2) {
856
+ parentPort2.postMessage(data, transferList);
857
+ } else {
858
+ globalThis.postMessage(data, transferList);
828
859
  }
829
860
  }
830
861
  };
@@ -836,7 +867,7 @@
836
867
  // ../loader-utils/src/lib/worker-loader-utils/create-loader-worker.ts
837
868
  var requestId = 0;
838
869
  function createLoaderWorker(loader) {
839
- if (typeof self === "undefined") {
870
+ if (!WorkerBody.inWorkerThread()) {
840
871
  return;
841
872
  }
842
873
  WorkerBody.onmessage = async (type, payload) => {
@@ -19,7 +19,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
19
19
 
20
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21
21
 
22
- var VERSION = typeof "3.1.6" !== 'undefined' ? "3.1.6" : 'latest';
22
+ var VERSION = typeof "3.2.0-alpha.1" !== 'undefined' ? "3.2.0-alpha.1" : 'latest';
23
23
  var DBFWorkerLoader = {
24
24
  name: 'DBF',
25
25
  id: 'dbf',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/dbf-loader.ts"],"names":["VERSION","DBFWorkerLoader","name","id","module","version","worker","category","extensions","mimeTypes","options","dbf","encoding","DBFLoader","parse","arrayBuffer","parseSync","parseDBF","parseInBatches","parseDBFInBatches"],"mappings":";;;;;;;;;;;;;;;AACA;;;;;;AAIA,IAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE;AAKO,IAAMC,eAAuB,GAAG;AACrCC,EAAAA,IAAI,EAAE,KAD+B;AAErCC,EAAAA,EAAE,EAAE,KAFiC;AAGrCC,EAAAA,MAAM,EAAE,WAH6B;AAIrCC,EAAAA,OAAO,EAAEL,OAJ4B;AAKrCM,EAAAA,MAAM,EAAE,IAL6B;AAMrCC,EAAAA,QAAQ,EAAE,OAN2B;AAOrCC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAPyB;AAQrCC,EAAAA,SAAS,EAAE,CAAC,mBAAD,CAR0B;AASrCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,QAAQ,EAAE;AADP;AADE;AAT4B,CAAhC;;;AAiBA,IAAMC,SAA2B,mCACnCZ,eADmC;AAEtCa,EAAAA,KAAK;AAAA,2EAAE,iBAAOC,WAAP,EAAoBL,OAApB;AAAA;AAAA;AAAA;AAAA;AAAA,+CAAgC,wBAASK,WAAT,EAAsBL,OAAtB,CAAhC;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAAF;;AAAA;AAAA;AAAA;;AAAA;AAAA,KAFiC;AAGtCM,EAAAA,SAAS,EAAEC,kBAH2B;AAItCC,EAAAA,cAAc,EAAEC;AAJsB,EAAjC","sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {parseDBF, parseDBFInBatches} from './lib/parsers/parse-dbf';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * DBFLoader - DBF files are used to contain non-geometry columns in Shapefiles\n */\nexport const DBFWorkerLoader: Loader = {\n name: 'DBF',\n id: 'dbf',\n module: 'shapefile',\n version: VERSION,\n worker: true,\n category: 'table',\n extensions: ['dbf'],\n mimeTypes: ['application/x-dbf'],\n options: {\n dbf: {\n encoding: 'latin1'\n }\n }\n};\n\n/** DBF file loader */\nexport const DBFLoader: LoaderWithParser = {\n ...DBFWorkerLoader,\n parse: async (arrayBuffer, options) => parseDBF(arrayBuffer, options),\n parseSync: parseDBF,\n parseInBatches: parseDBFInBatches\n};\n"],"file":"dbf-loader.js"}
1
+ {"version":3,"sources":["../../src/dbf-loader.ts"],"names":["VERSION","DBFWorkerLoader","name","id","module","version","worker","category","extensions","mimeTypes","options","dbf","encoding","DBFLoader","parse","arrayBuffer","parseSync","parseDBF","parseInBatches","parseDBFInBatches"],"mappings":";;;;;;;;;;;;;;;AACA;;;;;;AAIA,IAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAKO,IAAMC,eAAuB,GAAG;AACrCC,EAAAA,IAAI,EAAE,KAD+B;AAErCC,EAAAA,EAAE,EAAE,KAFiC;AAGrCC,EAAAA,MAAM,EAAE,WAH6B;AAIrCC,EAAAA,OAAO,EAAEL,OAJ4B;AAKrCM,EAAAA,MAAM,EAAE,IAL6B;AAMrCC,EAAAA,QAAQ,EAAE,OAN2B;AAOrCC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAPyB;AAQrCC,EAAAA,SAAS,EAAE,CAAC,mBAAD,CAR0B;AASrCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,QAAQ,EAAE;AADP;AADE;AAT4B,CAAhC;;;AAiBA,IAAMC,SAA2B,mCACnCZ,eADmC;AAEtCa,EAAAA,KAAK;AAAA,2EAAE,iBAAOC,WAAP,EAAoBL,OAApB;AAAA;AAAA;AAAA;AAAA;AAAA,+CAAgC,wBAASK,WAAT,EAAsBL,OAAtB,CAAhC;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAAF;;AAAA;AAAA;AAAA;;AAAA;AAAA,KAFiC;AAGtCM,EAAAA,SAAS,EAAEC,kBAH2B;AAItCC,EAAAA,cAAc,EAAEC;AAJsB,EAAjC","sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {parseDBF, parseDBFInBatches} from './lib/parsers/parse-dbf';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * DBFLoader - DBF files are used to contain non-geometry columns in Shapefiles\n */\nexport const DBFWorkerLoader: Loader = {\n name: 'DBF',\n id: 'dbf',\n module: 'shapefile',\n version: VERSION,\n worker: true,\n category: 'table',\n extensions: ['dbf'],\n mimeTypes: ['application/x-dbf'],\n options: {\n dbf: {\n encoding: 'latin1'\n }\n }\n};\n\n/** DBF file loader */\nexport const DBFLoader: LoaderWithParser = {\n ...DBFWorkerLoader,\n parse: async (arrayBuffer, options) => parseDBF(arrayBuffer, options),\n parseSync: parseDBF,\n parseInBatches: parseDBFInBatches\n};\n"],"file":"dbf-loader.js"}
@@ -9,7 +9,7 @@ var _shpLoader = require("./shp-loader");
9
9
 
10
10
  var _parseShapefile = require("./lib/parsers/parse-shapefile");
11
11
 
12
- var VERSION = typeof "3.1.6" !== 'undefined' ? "3.1.6" : 'latest';
12
+ var VERSION = typeof "3.2.0-alpha.1" !== 'undefined' ? "3.2.0-alpha.1" : 'latest';
13
13
  var ShapefileLoader = {
14
14
  name: 'Shapefile',
15
15
  id: 'shapefile',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shapefile-loader.ts"],"names":["VERSION","ShapefileLoader","name","id","module","version","category","extensions","mimeTypes","tests","Uint8Array","SHP_MAGIC_NUMBER","buffer","options","shapefile","shp","_maxDimensions","parse","parseShapefile","parseInBatches","parseShapefileInBatches","_typecheckShapefileLoader"],"mappings":";;;;;;;AACA;;AACA;;AAIA,IAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE;AAMO,IAAMC,eAAe,GAAG;AAC7BC,EAAAA,IAAI,EAAE,WADuB;AAE7BC,EAAAA,EAAE,EAAE,WAFyB;AAG7BC,EAAAA,MAAM,EAAE,WAHqB;AAI7BC,EAAAA,OAAO,EAAEL,OAJoB;AAK7BM,EAAAA,QAAQ,EAAE,UALmB;AAM7BC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANiB;AAO7BC,EAAAA,SAAS,EAAE,CAAC,0BAAD,CAPkB;AAQ7BC,EAAAA,KAAK,EAAE,CAAC,IAAIC,UAAJ,CAAeC,2BAAf,EAAiCC,MAAlC,CARsB;AAS7BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,SAAS,EAAE,EADJ;AAEPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,cAAc,EAAE;AADb;AAFE,GAToB;AAe7BC,EAAAA,KAAK,EAAEC,8BAfsB;AAgB7BC,EAAAA,cAAc,EAAEC;AAhBa,CAAxB;;AAmBA,IAAMC,yBAA2C,GAAGpB,eAApD","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {SHP_MAGIC_NUMBER} from './shp-loader';\nimport {parseShapefile, parseShapefileInBatches} from './lib/parsers/parse-shapefile';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Shapefile loader\n * @note Shapefile is multifile format and requires providing additional files\n */\nexport const ShapefileLoader = {\n name: 'Shapefile',\n id: 'shapefile',\n module: 'shapefile',\n version: VERSION,\n category: 'geometry',\n extensions: ['shp'],\n mimeTypes: ['application/octet-stream'],\n tests: [new Uint8Array(SHP_MAGIC_NUMBER).buffer],\n options: {\n shapefile: {},\n shp: {\n _maxDimensions: 4\n }\n },\n parse: parseShapefile,\n parseInBatches: parseShapefileInBatches\n};\n\nexport const _typecheckShapefileLoader: LoaderWithParser = ShapefileLoader;\n"],"file":"shapefile-loader.js"}
1
+ {"version":3,"sources":["../../src/shapefile-loader.ts"],"names":["VERSION","ShapefileLoader","name","id","module","version","category","extensions","mimeTypes","tests","Uint8Array","SHP_MAGIC_NUMBER","buffer","options","shapefile","shp","_maxDimensions","parse","parseShapefile","parseInBatches","parseShapefileInBatches","_typecheckShapefileLoader"],"mappings":";;;;;;;AACA;;AACA;;AAIA,IAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAMO,IAAMC,eAAe,GAAG;AAC7BC,EAAAA,IAAI,EAAE,WADuB;AAE7BC,EAAAA,EAAE,EAAE,WAFyB;AAG7BC,EAAAA,MAAM,EAAE,WAHqB;AAI7BC,EAAAA,OAAO,EAAEL,OAJoB;AAK7BM,EAAAA,QAAQ,EAAE,UALmB;AAM7BC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANiB;AAO7BC,EAAAA,SAAS,EAAE,CAAC,0BAAD,CAPkB;AAQ7BC,EAAAA,KAAK,EAAE,CAAC,IAAIC,UAAJ,CAAeC,2BAAf,EAAiCC,MAAlC,CARsB;AAS7BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,SAAS,EAAE,EADJ;AAEPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,cAAc,EAAE;AADb;AAFE,GAToB;AAe7BC,EAAAA,KAAK,EAAEC,8BAfsB;AAgB7BC,EAAAA,cAAc,EAAEC;AAhBa,CAAxB;;AAmBA,IAAMC,yBAA2C,GAAGpB,eAApD","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {SHP_MAGIC_NUMBER} from './shp-loader';\nimport {parseShapefile, parseShapefileInBatches} from './lib/parsers/parse-shapefile';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Shapefile loader\n * @note Shapefile is multifile format and requires providing additional files\n */\nexport const ShapefileLoader = {\n name: 'Shapefile',\n id: 'shapefile',\n module: 'shapefile',\n version: VERSION,\n category: 'geometry',\n extensions: ['shp'],\n mimeTypes: ['application/octet-stream'],\n tests: [new Uint8Array(SHP_MAGIC_NUMBER).buffer],\n options: {\n shapefile: {},\n shp: {\n _maxDimensions: 4\n }\n },\n parse: parseShapefile,\n parseInBatches: parseShapefileInBatches\n};\n\nexport const _typecheckShapefileLoader: LoaderWithParser = ShapefileLoader;\n"],"file":"shapefile-loader.js"}
@@ -19,7 +19,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
19
19
 
20
20
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21
21
 
22
- var VERSION = typeof "3.1.6" !== 'undefined' ? "3.1.6" : 'latest';
22
+ var VERSION = typeof "3.2.0-alpha.1" !== 'undefined' ? "3.2.0-alpha.1" : 'latest';
23
23
  var SHP_MAGIC_NUMBER = [0x00, 0x00, 0x27, 0x0a];
24
24
  exports.SHP_MAGIC_NUMBER = SHP_MAGIC_NUMBER;
25
25
  var SHPWorkerLoader = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shp-loader.ts"],"names":["VERSION","SHP_MAGIC_NUMBER","SHPWorkerLoader","name","id","module","version","worker","category","extensions","mimeTypes","tests","Uint8Array","buffer","options","shp","_maxDimensions","SHPLoader","parse","arrayBuffer","parseSync","parseSHP","parseInBatches","parseSHPInBatches"],"mappings":";;;;;;;;;;;;;;;AACA;;;;;;AAIA,IAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE;AAEO,IAAMC,gBAAgB,GAAG,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAAzB;;AAKA,IAAMC,eAAuB,GAAG;AACrCC,EAAAA,IAAI,EAAE,KAD+B;AAErCC,EAAAA,EAAE,EAAE,KAFiC;AAGrCC,EAAAA,MAAM,EAAE,WAH6B;AAIrCC,EAAAA,OAAO,EAAEN,OAJ4B;AAKrCO,EAAAA,MAAM,EAAE,IAL6B;AAMrCC,EAAAA,QAAQ,EAAE,UAN2B;AAOrCC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAPyB;AAQrCC,EAAAA,SAAS,EAAE,CAAC,0BAAD,CAR0B;AAUrCC,EAAAA,KAAK,EAAE,CAAC,IAAIC,UAAJ,CAAeX,gBAAf,EAAiCY,MAAlC,CAV8B;AAWrCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,cAAc,EAAE;AADb;AADE;AAX4B,CAAhC;;;AAmBA,IAAMC,SAA2B,mCACnCf,eADmC;AAEtCgB,EAAAA,KAAK;AAAA,2EAAE,iBAAOC,WAAP,EAAoBL,OAApB;AAAA;AAAA;AAAA;AAAA;AAAA,+CAAiC,wBAASK,WAAT,EAAsBL,OAAtB,CAAjC;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAAF;;AAAA;AAAA;AAAA;;AAAA;AAAA,KAFiC;AAGtCM,EAAAA,SAAS,EAAEC,kBAH2B;AAItCC,EAAAA,cAAc,EAAEC;AAJsB,EAAjC","sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {parseSHP, parseSHPInBatches} from './lib/parsers/parse-shp';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport const SHP_MAGIC_NUMBER = [0x00, 0x00, 0x27, 0x0a];\n\n/**\n * SHP file loader\n */\nexport const SHPWorkerLoader: Loader = {\n name: 'SHP',\n id: 'shp',\n module: 'shapefile',\n version: VERSION,\n worker: true,\n category: 'geometry',\n extensions: ['shp'],\n mimeTypes: ['application/octet-stream'],\n // ISSUE: This also identifies SHX files, which are identical to SHP for the first 100 bytes...\n tests: [new Uint8Array(SHP_MAGIC_NUMBER).buffer],\n options: {\n shp: {\n _maxDimensions: 4\n }\n }\n};\n\n/** SHP file loader */\nexport const SHPLoader: LoaderWithParser = {\n ...SHPWorkerLoader,\n parse: async (arrayBuffer, options?) => parseSHP(arrayBuffer, options),\n parseSync: parseSHP,\n parseInBatches: parseSHPInBatches\n};\n"],"file":"shp-loader.js"}
1
+ {"version":3,"sources":["../../src/shp-loader.ts"],"names":["VERSION","SHP_MAGIC_NUMBER","SHPWorkerLoader","name","id","module","version","worker","category","extensions","mimeTypes","tests","Uint8Array","buffer","options","shp","_maxDimensions","SHPLoader","parse","arrayBuffer","parseSync","parseSHP","parseInBatches","parseSHPInBatches"],"mappings":";;;;;;;;;;;;;;;AACA;;;;;;AAIA,IAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAEO,IAAMC,gBAAgB,GAAG,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAAzB;;AAKA,IAAMC,eAAuB,GAAG;AACrCC,EAAAA,IAAI,EAAE,KAD+B;AAErCC,EAAAA,EAAE,EAAE,KAFiC;AAGrCC,EAAAA,MAAM,EAAE,WAH6B;AAIrCC,EAAAA,OAAO,EAAEN,OAJ4B;AAKrCO,EAAAA,MAAM,EAAE,IAL6B;AAMrCC,EAAAA,QAAQ,EAAE,UAN2B;AAOrCC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAPyB;AAQrCC,EAAAA,SAAS,EAAE,CAAC,0BAAD,CAR0B;AAUrCC,EAAAA,KAAK,EAAE,CAAC,IAAIC,UAAJ,CAAeX,gBAAf,EAAiCY,MAAlC,CAV8B;AAWrCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,cAAc,EAAE;AADb;AADE;AAX4B,CAAhC;;;AAmBA,IAAMC,SAA2B,mCACnCf,eADmC;AAEtCgB,EAAAA,KAAK;AAAA,2EAAE,iBAAOC,WAAP,EAAoBL,OAApB;AAAA;AAAA;AAAA;AAAA;AAAA,+CAAiC,wBAASK,WAAT,EAAsBL,OAAtB,CAAjC;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAAF;;AAAA;AAAA;AAAA;;AAAA;AAAA,KAFiC;AAGtCM,EAAAA,SAAS,EAAEC,kBAH2B;AAItCC,EAAAA,cAAc,EAAEC;AAJsB,EAAjC","sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {parseSHP, parseSHPInBatches} from './lib/parsers/parse-shp';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport const SHP_MAGIC_NUMBER = [0x00, 0x00, 0x27, 0x0a];\n\n/**\n * SHP file loader\n */\nexport const SHPWorkerLoader: Loader = {\n name: 'SHP',\n id: 'shp',\n module: 'shapefile',\n version: VERSION,\n worker: true,\n category: 'geometry',\n extensions: ['shp'],\n mimeTypes: ['application/octet-stream'],\n // ISSUE: This also identifies SHX files, which are identical to SHP for the first 100 bytes...\n tests: [new Uint8Array(SHP_MAGIC_NUMBER).buffer],\n options: {\n shp: {\n _maxDimensions: 4\n }\n }\n};\n\n/** SHP file loader */\nexport const SHPLoader: LoaderWithParser = {\n ...SHPWorkerLoader,\n parse: async (arrayBuffer, options?) => parseSHP(arrayBuffer, options),\n parseSync: parseSHP,\n parseInBatches: parseSHPInBatches\n};\n"],"file":"shp-loader.js"}
@@ -1,5 +1,5 @@
1
1
  import { parseDBF, parseDBFInBatches } from './lib/parsers/parse-dbf';
2
- const VERSION = typeof "3.1.6" !== 'undefined' ? "3.1.6" : 'latest';
2
+ const VERSION = typeof "3.2.0-alpha.1" !== 'undefined' ? "3.2.0-alpha.1" : 'latest';
3
3
  export const DBFWorkerLoader = {
4
4
  name: 'DBF',
5
5
  id: 'dbf',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/dbf-loader.ts"],"names":["parseDBF","parseDBFInBatches","VERSION","DBFWorkerLoader","name","id","module","version","worker","category","extensions","mimeTypes","options","dbf","encoding","DBFLoader","parse","arrayBuffer","parseSync","parseInBatches"],"mappings":"AACA,SAAQA,QAAR,EAAkBC,iBAAlB,QAA0C,yBAA1C;AAIA,MAAMC,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE;AAKA,OAAO,MAAMC,eAAuB,GAAG;AACrCC,EAAAA,IAAI,EAAE,KAD+B;AAErCC,EAAAA,EAAE,EAAE,KAFiC;AAGrCC,EAAAA,MAAM,EAAE,WAH6B;AAIrCC,EAAAA,OAAO,EAAEL,OAJ4B;AAKrCM,EAAAA,MAAM,EAAE,IAL6B;AAMrCC,EAAAA,QAAQ,EAAE,OAN2B;AAOrCC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAPyB;AAQrCC,EAAAA,SAAS,EAAE,CAAC,mBAAD,CAR0B;AASrCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,QAAQ,EAAE;AADP;AADE;AAT4B,CAAhC;AAiBP,OAAO,MAAMC,SAA2B,GAAG,EACzC,GAAGZ,eADsC;AAEzCa,EAAAA,KAAK,EAAE,OAAOC,WAAP,EAAoBL,OAApB,KAAgCZ,QAAQ,CAACiB,WAAD,EAAcL,OAAd,CAFN;AAGzCM,EAAAA,SAAS,EAAElB,QAH8B;AAIzCmB,EAAAA,cAAc,EAAElB;AAJyB,CAApC","sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {parseDBF, parseDBFInBatches} from './lib/parsers/parse-dbf';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * DBFLoader - DBF files are used to contain non-geometry columns in Shapefiles\n */\nexport const DBFWorkerLoader: Loader = {\n name: 'DBF',\n id: 'dbf',\n module: 'shapefile',\n version: VERSION,\n worker: true,\n category: 'table',\n extensions: ['dbf'],\n mimeTypes: ['application/x-dbf'],\n options: {\n dbf: {\n encoding: 'latin1'\n }\n }\n};\n\n/** DBF file loader */\nexport const DBFLoader: LoaderWithParser = {\n ...DBFWorkerLoader,\n parse: async (arrayBuffer, options) => parseDBF(arrayBuffer, options),\n parseSync: parseDBF,\n parseInBatches: parseDBFInBatches\n};\n"],"file":"dbf-loader.js"}
1
+ {"version":3,"sources":["../../src/dbf-loader.ts"],"names":["parseDBF","parseDBFInBatches","VERSION","DBFWorkerLoader","name","id","module","version","worker","category","extensions","mimeTypes","options","dbf","encoding","DBFLoader","parse","arrayBuffer","parseSync","parseInBatches"],"mappings":"AACA,SAAQA,QAAR,EAAkBC,iBAAlB,QAA0C,yBAA1C;AAIA,MAAMC,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAKA,OAAO,MAAMC,eAAuB,GAAG;AACrCC,EAAAA,IAAI,EAAE,KAD+B;AAErCC,EAAAA,EAAE,EAAE,KAFiC;AAGrCC,EAAAA,MAAM,EAAE,WAH6B;AAIrCC,EAAAA,OAAO,EAAEL,OAJ4B;AAKrCM,EAAAA,MAAM,EAAE,IAL6B;AAMrCC,EAAAA,QAAQ,EAAE,OAN2B;AAOrCC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAPyB;AAQrCC,EAAAA,SAAS,EAAE,CAAC,mBAAD,CAR0B;AASrCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,QAAQ,EAAE;AADP;AADE;AAT4B,CAAhC;AAiBP,OAAO,MAAMC,SAA2B,GAAG,EACzC,GAAGZ,eADsC;AAEzCa,EAAAA,KAAK,EAAE,OAAOC,WAAP,EAAoBL,OAApB,KAAgCZ,QAAQ,CAACiB,WAAD,EAAcL,OAAd,CAFN;AAGzCM,EAAAA,SAAS,EAAElB,QAH8B;AAIzCmB,EAAAA,cAAc,EAAElB;AAJyB,CAApC","sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {parseDBF, parseDBFInBatches} from './lib/parsers/parse-dbf';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * DBFLoader - DBF files are used to contain non-geometry columns in Shapefiles\n */\nexport const DBFWorkerLoader: Loader = {\n name: 'DBF',\n id: 'dbf',\n module: 'shapefile',\n version: VERSION,\n worker: true,\n category: 'table',\n extensions: ['dbf'],\n mimeTypes: ['application/x-dbf'],\n options: {\n dbf: {\n encoding: 'latin1'\n }\n }\n};\n\n/** DBF file loader */\nexport const DBFLoader: LoaderWithParser = {\n ...DBFWorkerLoader,\n parse: async (arrayBuffer, options) => parseDBF(arrayBuffer, options),\n parseSync: parseDBF,\n parseInBatches: parseDBFInBatches\n};\n"],"file":"dbf-loader.js"}
@@ -1,6 +1,6 @@
1
1
  import { SHP_MAGIC_NUMBER } from './shp-loader';
2
2
  import { parseShapefile, parseShapefileInBatches } from './lib/parsers/parse-shapefile';
3
- const VERSION = typeof "3.1.6" !== 'undefined' ? "3.1.6" : 'latest';
3
+ const VERSION = typeof "3.2.0-alpha.1" !== 'undefined' ? "3.2.0-alpha.1" : 'latest';
4
4
  export const ShapefileLoader = {
5
5
  name: 'Shapefile',
6
6
  id: 'shapefile',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shapefile-loader.ts"],"names":["SHP_MAGIC_NUMBER","parseShapefile","parseShapefileInBatches","VERSION","ShapefileLoader","name","id","module","version","category","extensions","mimeTypes","tests","Uint8Array","buffer","options","shapefile","shp","_maxDimensions","parse","parseInBatches","_typecheckShapefileLoader"],"mappings":"AACA,SAAQA,gBAAR,QAA+B,cAA/B;AACA,SAAQC,cAAR,EAAwBC,uBAAxB,QAAsD,+BAAtD;AAIA,MAAMC,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE;AAMA,OAAO,MAAMC,eAAe,GAAG;AAC7BC,EAAAA,IAAI,EAAE,WADuB;AAE7BC,EAAAA,EAAE,EAAE,WAFyB;AAG7BC,EAAAA,MAAM,EAAE,WAHqB;AAI7BC,EAAAA,OAAO,EAAEL,OAJoB;AAK7BM,EAAAA,QAAQ,EAAE,UALmB;AAM7BC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANiB;AAO7BC,EAAAA,SAAS,EAAE,CAAC,0BAAD,CAPkB;AAQ7BC,EAAAA,KAAK,EAAE,CAAC,IAAIC,UAAJ,CAAeb,gBAAf,EAAiCc,MAAlC,CARsB;AAS7BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,SAAS,EAAE,EADJ;AAEPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,cAAc,EAAE;AADb;AAFE,GAToB;AAe7BC,EAAAA,KAAK,EAAElB,cAfsB;AAgB7BmB,EAAAA,cAAc,EAAElB;AAhBa,CAAxB;AAmBP,OAAO,MAAMmB,yBAA2C,GAAGjB,eAApD","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {SHP_MAGIC_NUMBER} from './shp-loader';\nimport {parseShapefile, parseShapefileInBatches} from './lib/parsers/parse-shapefile';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Shapefile loader\n * @note Shapefile is multifile format and requires providing additional files\n */\nexport const ShapefileLoader = {\n name: 'Shapefile',\n id: 'shapefile',\n module: 'shapefile',\n version: VERSION,\n category: 'geometry',\n extensions: ['shp'],\n mimeTypes: ['application/octet-stream'],\n tests: [new Uint8Array(SHP_MAGIC_NUMBER).buffer],\n options: {\n shapefile: {},\n shp: {\n _maxDimensions: 4\n }\n },\n parse: parseShapefile,\n parseInBatches: parseShapefileInBatches\n};\n\nexport const _typecheckShapefileLoader: LoaderWithParser = ShapefileLoader;\n"],"file":"shapefile-loader.js"}
1
+ {"version":3,"sources":["../../src/shapefile-loader.ts"],"names":["SHP_MAGIC_NUMBER","parseShapefile","parseShapefileInBatches","VERSION","ShapefileLoader","name","id","module","version","category","extensions","mimeTypes","tests","Uint8Array","buffer","options","shapefile","shp","_maxDimensions","parse","parseInBatches","_typecheckShapefileLoader"],"mappings":"AACA,SAAQA,gBAAR,QAA+B,cAA/B;AACA,SAAQC,cAAR,EAAwBC,uBAAxB,QAAsD,+BAAtD;AAIA,MAAMC,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAMA,OAAO,MAAMC,eAAe,GAAG;AAC7BC,EAAAA,IAAI,EAAE,WADuB;AAE7BC,EAAAA,EAAE,EAAE,WAFyB;AAG7BC,EAAAA,MAAM,EAAE,WAHqB;AAI7BC,EAAAA,OAAO,EAAEL,OAJoB;AAK7BM,EAAAA,QAAQ,EAAE,UALmB;AAM7BC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANiB;AAO7BC,EAAAA,SAAS,EAAE,CAAC,0BAAD,CAPkB;AAQ7BC,EAAAA,KAAK,EAAE,CAAC,IAAIC,UAAJ,CAAeb,gBAAf,EAAiCc,MAAlC,CARsB;AAS7BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,SAAS,EAAE,EADJ;AAEPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,cAAc,EAAE;AADb;AAFE,GAToB;AAe7BC,EAAAA,KAAK,EAAElB,cAfsB;AAgB7BmB,EAAAA,cAAc,EAAElB;AAhBa,CAAxB;AAmBP,OAAO,MAAMmB,yBAA2C,GAAGjB,eAApD","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {SHP_MAGIC_NUMBER} from './shp-loader';\nimport {parseShapefile, parseShapefileInBatches} from './lib/parsers/parse-shapefile';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Shapefile loader\n * @note Shapefile is multifile format and requires providing additional files\n */\nexport const ShapefileLoader = {\n name: 'Shapefile',\n id: 'shapefile',\n module: 'shapefile',\n version: VERSION,\n category: 'geometry',\n extensions: ['shp'],\n mimeTypes: ['application/octet-stream'],\n tests: [new Uint8Array(SHP_MAGIC_NUMBER).buffer],\n options: {\n shapefile: {},\n shp: {\n _maxDimensions: 4\n }\n },\n parse: parseShapefile,\n parseInBatches: parseShapefileInBatches\n};\n\nexport const _typecheckShapefileLoader: LoaderWithParser = ShapefileLoader;\n"],"file":"shapefile-loader.js"}
@@ -1,5 +1,5 @@
1
1
  import { parseSHP, parseSHPInBatches } from './lib/parsers/parse-shp';
2
- const VERSION = typeof "3.1.6" !== 'undefined' ? "3.1.6" : 'latest';
2
+ const VERSION = typeof "3.2.0-alpha.1" !== 'undefined' ? "3.2.0-alpha.1" : 'latest';
3
3
  export const SHP_MAGIC_NUMBER = [0x00, 0x00, 0x27, 0x0a];
4
4
  export const SHPWorkerLoader = {
5
5
  name: 'SHP',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shp-loader.ts"],"names":["parseSHP","parseSHPInBatches","VERSION","SHP_MAGIC_NUMBER","SHPWorkerLoader","name","id","module","version","worker","category","extensions","mimeTypes","tests","Uint8Array","buffer","options","shp","_maxDimensions","SHPLoader","parse","arrayBuffer","parseSync","parseInBatches"],"mappings":"AACA,SAAQA,QAAR,EAAkBC,iBAAlB,QAA0C,yBAA1C;AAIA,MAAMC,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE;AAEA,OAAO,MAAMC,gBAAgB,GAAG,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAAzB;AAKP,OAAO,MAAMC,eAAuB,GAAG;AACrCC,EAAAA,IAAI,EAAE,KAD+B;AAErCC,EAAAA,EAAE,EAAE,KAFiC;AAGrCC,EAAAA,MAAM,EAAE,WAH6B;AAIrCC,EAAAA,OAAO,EAAEN,OAJ4B;AAKrCO,EAAAA,MAAM,EAAE,IAL6B;AAMrCC,EAAAA,QAAQ,EAAE,UAN2B;AAOrCC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAPyB;AAQrCC,EAAAA,SAAS,EAAE,CAAC,0BAAD,CAR0B;AAUrCC,EAAAA,KAAK,EAAE,CAAC,IAAIC,UAAJ,CAAeX,gBAAf,EAAiCY,MAAlC,CAV8B;AAWrCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,cAAc,EAAE;AADb;AADE;AAX4B,CAAhC;AAmBP,OAAO,MAAMC,SAA2B,GAAG,EACzC,GAAGf,eADsC;AAEzCgB,EAAAA,KAAK,EAAE,OAAOC,WAAP,EAAoBL,OAApB,KAAiChB,QAAQ,CAACqB,WAAD,EAAcL,OAAd,CAFP;AAGzCM,EAAAA,SAAS,EAAEtB,QAH8B;AAIzCuB,EAAAA,cAAc,EAAEtB;AAJyB,CAApC","sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {parseSHP, parseSHPInBatches} from './lib/parsers/parse-shp';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport const SHP_MAGIC_NUMBER = [0x00, 0x00, 0x27, 0x0a];\n\n/**\n * SHP file loader\n */\nexport const SHPWorkerLoader: Loader = {\n name: 'SHP',\n id: 'shp',\n module: 'shapefile',\n version: VERSION,\n worker: true,\n category: 'geometry',\n extensions: ['shp'],\n mimeTypes: ['application/octet-stream'],\n // ISSUE: This also identifies SHX files, which are identical to SHP for the first 100 bytes...\n tests: [new Uint8Array(SHP_MAGIC_NUMBER).buffer],\n options: {\n shp: {\n _maxDimensions: 4\n }\n }\n};\n\n/** SHP file loader */\nexport const SHPLoader: LoaderWithParser = {\n ...SHPWorkerLoader,\n parse: async (arrayBuffer, options?) => parseSHP(arrayBuffer, options),\n parseSync: parseSHP,\n parseInBatches: parseSHPInBatches\n};\n"],"file":"shp-loader.js"}
1
+ {"version":3,"sources":["../../src/shp-loader.ts"],"names":["parseSHP","parseSHPInBatches","VERSION","SHP_MAGIC_NUMBER","SHPWorkerLoader","name","id","module","version","worker","category","extensions","mimeTypes","tests","Uint8Array","buffer","options","shp","_maxDimensions","SHPLoader","parse","arrayBuffer","parseSync","parseInBatches"],"mappings":"AACA,SAAQA,QAAR,EAAkBC,iBAAlB,QAA0C,yBAA1C;AAIA,MAAMC,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAEA,OAAO,MAAMC,gBAAgB,GAAG,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAAzB;AAKP,OAAO,MAAMC,eAAuB,GAAG;AACrCC,EAAAA,IAAI,EAAE,KAD+B;AAErCC,EAAAA,EAAE,EAAE,KAFiC;AAGrCC,EAAAA,MAAM,EAAE,WAH6B;AAIrCC,EAAAA,OAAO,EAAEN,OAJ4B;AAKrCO,EAAAA,MAAM,EAAE,IAL6B;AAMrCC,EAAAA,QAAQ,EAAE,UAN2B;AAOrCC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAPyB;AAQrCC,EAAAA,SAAS,EAAE,CAAC,0BAAD,CAR0B;AAUrCC,EAAAA,KAAK,EAAE,CAAC,IAAIC,UAAJ,CAAeX,gBAAf,EAAiCY,MAAlC,CAV8B;AAWrCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AACHC,MAAAA,cAAc,EAAE;AADb;AADE;AAX4B,CAAhC;AAmBP,OAAO,MAAMC,SAA2B,GAAG,EACzC,GAAGf,eADsC;AAEzCgB,EAAAA,KAAK,EAAE,OAAOC,WAAP,EAAoBL,OAApB,KAAiChB,QAAQ,CAACqB,WAAD,EAAcL,OAAd,CAFP;AAGzCM,EAAAA,SAAS,EAAEtB,QAH8B;AAIzCuB,EAAAA,cAAc,EAAEtB;AAJyB,CAApC","sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {parseSHP, parseSHPInBatches} from './lib/parsers/parse-shp';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport const SHP_MAGIC_NUMBER = [0x00, 0x00, 0x27, 0x0a];\n\n/**\n * SHP file loader\n */\nexport const SHPWorkerLoader: Loader = {\n name: 'SHP',\n id: 'shp',\n module: 'shapefile',\n version: VERSION,\n worker: true,\n category: 'geometry',\n extensions: ['shp'],\n mimeTypes: ['application/octet-stream'],\n // ISSUE: This also identifies SHX files, which are identical to SHP for the first 100 bytes...\n tests: [new Uint8Array(SHP_MAGIC_NUMBER).buffer],\n options: {\n shp: {\n _maxDimensions: 4\n }\n }\n};\n\n/** SHP file loader */\nexport const SHPLoader: LoaderWithParser = {\n ...SHPWorkerLoader,\n parse: async (arrayBuffer, options?) => parseSHP(arrayBuffer, options),\n parseSync: parseSHP,\n parseInBatches: parseSHPInBatches\n};\n"],"file":"shp-loader.js"}
@@ -424,7 +424,7 @@
424
424
  }
425
425
 
426
426
  // src/shp-loader.ts
427
- var VERSION = true ? "3.1.6" : "latest";
427
+ var VERSION = true ? "3.2.0-alpha.1" : "latest";
428
428
  var SHP_MAGIC_NUMBER2 = [0, 0, 39, 10];
429
429
  var SHPWorkerLoader = {
430
430
  name: "SHP",
@@ -485,16 +485,33 @@
485
485
  }
486
486
 
487
487
  // ../worker-utils/src/lib/worker-farm/worker-body.ts
488
+ function getParentPort() {
489
+ let parentPort;
490
+ try {
491
+ eval("globalThis.parentPort = require('worker_threads').parentPort");
492
+ parentPort = globalThis.parentPort;
493
+ } catch {
494
+ }
495
+ return parentPort;
496
+ }
488
497
  var onMessageWrapperMap = new Map();
489
498
  var WorkerBody = class {
499
+ static inWorkerThread() {
500
+ return typeof self !== "undefined" || Boolean(getParentPort());
501
+ }
490
502
  static set onmessage(onMessage) {
491
- self.onmessage = (message) => {
492
- if (!isKnownMessage(message)) {
493
- return;
494
- }
495
- const { type, payload } = message.data;
503
+ function handleMessage(message) {
504
+ const parentPort3 = getParentPort();
505
+ const { type, payload } = parentPort3 ? message : message.data;
496
506
  onMessage(type, payload);
497
- };
507
+ }
508
+ const parentPort2 = getParentPort();
509
+ if (parentPort2) {
510
+ parentPort2.on("message", handleMessage);
511
+ parentPort2.on("exit", () => console.debug("Node worker closing"));
512
+ } else {
513
+ globalThis.onmessage = handleMessage;
514
+ }
498
515
  }
499
516
  static addEventListener(onMessage) {
500
517
  let onMessageWrapper = onMessageWrapperMap.get(onMessage);
@@ -503,22 +520,36 @@
503
520
  if (!isKnownMessage(message)) {
504
521
  return;
505
522
  }
506
- const { type, payload } = message.data;
523
+ const parentPort3 = getParentPort();
524
+ const { type, payload } = parentPort3 ? message : message.data;
507
525
  onMessage(type, payload);
508
526
  };
509
527
  }
510
- self.addEventListener("message", onMessageWrapper);
528
+ const parentPort2 = getParentPort();
529
+ if (parentPort2) {
530
+ console.error("not implemented");
531
+ } else {
532
+ globalThis.addEventListener("message", onMessageWrapper);
533
+ }
511
534
  }
512
535
  static removeEventListener(onMessage) {
513
536
  const onMessageWrapper = onMessageWrapperMap.get(onMessage);
514
537
  onMessageWrapperMap.delete(onMessage);
515
- self.removeEventListener("message", onMessageWrapper);
538
+ const parentPort2 = getParentPort();
539
+ if (parentPort2) {
540
+ console.error("not implemented");
541
+ } else {
542
+ globalThis.removeEventListener("message", onMessageWrapper);
543
+ }
516
544
  }
517
545
  static postMessage(type, payload) {
518
- if (self) {
519
- const data = { source: "loaders.gl", type, payload };
520
- const transferList = getTransferList(payload);
521
- self.postMessage(data, transferList);
546
+ const data = { source: "loaders.gl", type, payload };
547
+ const transferList = getTransferList(payload);
548
+ const parentPort2 = getParentPort();
549
+ if (parentPort2) {
550
+ parentPort2.postMessage(data, transferList);
551
+ } else {
552
+ globalThis.postMessage(data, transferList);
522
553
  }
523
554
  }
524
555
  };
@@ -530,7 +561,7 @@
530
561
  // ../loader-utils/src/lib/worker-loader-utils/create-loader-worker.ts
531
562
  var requestId = 0;
532
563
  function createLoaderWorker(loader) {
533
- if (typeof self === "undefined") {
564
+ if (!WorkerBody.inWorkerThread()) {
534
565
  return;
535
566
  }
536
567
  WorkerBody.onmessage = async (type, payload) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loaders.gl/shapefile",
3
3
  "description": "Loader for the Shapefile Format",
4
- "version": "3.1.6",
4
+ "version": "3.2.0-alpha.1",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -37,10 +37,10 @@
37
37
  "build-worker-dbf": "esbuild src/workers/dbf-worker.ts --bundle --outfile=dist/dbf-worker.js --define:__VERSION__=\\\"$npm_package_version\\\""
38
38
  },
39
39
  "dependencies": {
40
- "@loaders.gl/gis": "3.1.6",
41
- "@loaders.gl/loader-utils": "3.1.6",
42
- "@loaders.gl/schema": "3.1.6",
40
+ "@loaders.gl/gis": "3.2.0-alpha.1",
41
+ "@loaders.gl/loader-utils": "3.2.0-alpha.1",
42
+ "@loaders.gl/schema": "3.2.0-alpha.1",
43
43
  "@math.gl/proj4": "^3.5.1"
44
44
  },
45
- "gitHead": "4fe0724b942697a95ff3eb3af47b7a7c18556c52"
45
+ "gitHead": "423a2815092b08dcf93ad5b7dc2940b167305afe"
46
46
  }