@loaders.gl/obj 3.1.8 → 3.2.0-alpha.3

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.
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports._typecheckMTLLoader = exports.MTLLoader = void 0;
7
- var VERSION = typeof "3.1.8" !== 'undefined' ? "3.1.8" : 'latest';
7
+ var VERSION = typeof "3.2.0-alpha.3" !== 'undefined' ? "3.2.0-alpha.3" : 'latest';
8
8
  var MTLLoader = {
9
9
  name: 'MTL',
10
10
  id: 'mtl',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/mtl-loader.ts"],"names":["VERSION","MTLLoader","name","id","module","version","worker","extensions","mimeTypes","testText","text","includes","options","mtl","_typecheckMTLLoader"],"mappings":";;;;;;AAMA,IAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE;AAUO,IAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,KADiB;AAEvBC,EAAAA,EAAE,EAAE,KAFmB;AAGvBC,EAAAA,MAAM,EAAE,KAHe;AAIvBC,EAAAA,OAAO,EAAEL,OAJc;AAKvBM,EAAAA,MAAM,EAAE,IALe;AAMvBC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANW;AAOvBC,EAAAA,SAAS,EAAE,CAAC,YAAD,CAPY;AAQvBC,EAAAA,QAAQ,EAAE,kBAACC,IAAD;AAAA,WAA2BA,IAAI,CAACC,QAAL,CAAc,QAAd,CAA3B;AAAA,GARa;AASvBC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AADE;AATc,CAAlB;;AAcA,IAAMC,mBAA2B,GAAGb,SAApC","sourcesContent":["// loaders.gl, MIT license\nimport type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ParseMTLOptions} from './lib/parse-mtl';\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 type MTLLoaderOptions = LoaderOptions & {\n mtl?: ParseMTLOptions;\n};\n\n/**\n * Loader for the MTL material format\n * Parses a Wavefront .mtl file specifying materials\n */\nexport const MTLLoader = {\n name: 'MTL',\n id: 'mtl',\n module: 'mtl',\n version: VERSION,\n worker: true,\n extensions: ['mtl'],\n mimeTypes: ['text/plain'],\n testText: (text: string): boolean => text.includes('newmtl'),\n options: {\n mtl: {}\n }\n};\n\nexport const _typecheckMTLLoader: Loader = MTLLoader;\n"],"file":"mtl-loader.js"}
1
+ {"version":3,"sources":["../../src/mtl-loader.ts"],"names":["VERSION","MTLLoader","name","id","module","version","worker","extensions","mimeTypes","testText","text","includes","options","mtl","_typecheckMTLLoader"],"mappings":";;;;;;AAMA,IAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAUO,IAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,KADiB;AAEvBC,EAAAA,EAAE,EAAE,KAFmB;AAGvBC,EAAAA,MAAM,EAAE,KAHe;AAIvBC,EAAAA,OAAO,EAAEL,OAJc;AAKvBM,EAAAA,MAAM,EAAE,IALe;AAMvBC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANW;AAOvBC,EAAAA,SAAS,EAAE,CAAC,YAAD,CAPY;AAQvBC,EAAAA,QAAQ,EAAE,kBAACC,IAAD;AAAA,WAA2BA,IAAI,CAACC,QAAL,CAAc,QAAd,CAA3B;AAAA,GARa;AASvBC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AADE;AATc,CAAlB;;AAcA,IAAMC,mBAA2B,GAAGb,SAApC","sourcesContent":["// loaders.gl, MIT license\nimport type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ParseMTLOptions} from './lib/parse-mtl';\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 type MTLLoaderOptions = LoaderOptions & {\n mtl?: ParseMTLOptions;\n};\n\n/**\n * Loader for the MTL material format\n * Parses a Wavefront .mtl file specifying materials\n */\nexport const MTLLoader = {\n name: 'MTL',\n id: 'mtl',\n module: 'mtl',\n version: VERSION,\n worker: true,\n extensions: ['mtl'],\n mimeTypes: ['text/plain'],\n testText: (text: string): boolean => text.includes('newmtl'),\n options: {\n mtl: {}\n }\n};\n\nexport const _typecheckMTLLoader: Loader = MTLLoader;\n"],"file":"mtl-loader.js"}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports._typecheckOBJLoader = exports.OBJLoader = void 0;
7
- var VERSION = typeof "3.1.8" !== 'undefined' ? "3.1.8" : 'latest';
7
+ var VERSION = typeof "3.2.0-alpha.3" !== 'undefined' ? "3.2.0-alpha.3" : 'latest';
8
8
  var OBJLoader = {
9
9
  name: 'OBJ',
10
10
  id: 'obj',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/obj-loader.ts"],"names":["VERSION","OBJLoader","name","id","module","version","worker","extensions","mimeTypes","testText","testOBJFile","options","obj","text","_typecheckOBJLoader"],"mappings":";;;;;;AAIA,IAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE;AASO,IAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,KADiB;AAEvBC,EAAAA,EAAE,EAAE,KAFmB;AAGvBC,EAAAA,MAAM,EAAE,KAHe;AAIvBC,EAAAA,OAAO,EAAEL,OAJc;AAKvBM,EAAAA,MAAM,EAAE,IALe;AAMvBC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANW;AAOvBC,EAAAA,SAAS,EAAE,CAAC,YAAD,CAPY;AAQvBC,EAAAA,QAAQ,EAAEC,WARa;AASvBC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AADE;AATc,CAAlB;;;AAcP,SAASF,WAAT,CAAqBG,IAArB,EAA4C;AAE1C,SAAOA,IAAI,CAAC,CAAD,CAAJ,KAAY,GAAnB;AACD;;AAEM,IAAMC,mBAA2B,GAAGb,SAApC","sourcesContent":["import type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\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 type OBJLoaderOptions = LoaderOptions & {\n obj?: {};\n};\n\n/**\n * Worker loader for the OBJ geometry format\n */\nexport const OBJLoader = {\n name: 'OBJ',\n id: 'obj',\n module: 'obj',\n version: VERSION,\n worker: true,\n extensions: ['obj'],\n mimeTypes: ['text/plain'],\n testText: testOBJFile,\n options: {\n obj: {}\n }\n};\n\nfunction testOBJFile(text: string): boolean {\n // TODO - There could be comment line first\n return text[0] === 'v';\n}\n\nexport const _typecheckOBJLoader: Loader = OBJLoader;\n"],"file":"obj-loader.js"}
1
+ {"version":3,"sources":["../../src/obj-loader.ts"],"names":["VERSION","OBJLoader","name","id","module","version","worker","extensions","mimeTypes","testText","testOBJFile","options","obj","text","_typecheckOBJLoader"],"mappings":";;;;;;AAIA,IAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AASO,IAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,KADiB;AAEvBC,EAAAA,EAAE,EAAE,KAFmB;AAGvBC,EAAAA,MAAM,EAAE,KAHe;AAIvBC,EAAAA,OAAO,EAAEL,OAJc;AAKvBM,EAAAA,MAAM,EAAE,IALe;AAMvBC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANW;AAOvBC,EAAAA,SAAS,EAAE,CAAC,YAAD,CAPY;AAQvBC,EAAAA,QAAQ,EAAEC,WARa;AASvBC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AADE;AATc,CAAlB;;;AAcP,SAASF,WAAT,CAAqBG,IAArB,EAA4C;AAE1C,SAAOA,IAAI,CAAC,CAAD,CAAJ,KAAY,GAAnB;AACD;;AAEM,IAAMC,mBAA2B,GAAGb,SAApC","sourcesContent":["import type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\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 type OBJLoaderOptions = LoaderOptions & {\n obj?: {};\n};\n\n/**\n * Worker loader for the OBJ geometry format\n */\nexport const OBJLoader = {\n name: 'OBJ',\n id: 'obj',\n module: 'obj',\n version: VERSION,\n worker: true,\n extensions: ['obj'],\n mimeTypes: ['text/plain'],\n testText: testOBJFile,\n options: {\n obj: {}\n }\n};\n\nfunction testOBJFile(text: string): boolean {\n // TODO - There could be comment line first\n return text[0] === 'v';\n}\n\nexport const _typecheckOBJLoader: Loader = OBJLoader;\n"],"file":"obj-loader.js"}
@@ -1,4 +1,4 @@
1
- const VERSION = typeof "3.1.8" !== 'undefined' ? "3.1.8" : 'latest';
1
+ const VERSION = typeof "3.2.0-alpha.3" !== 'undefined' ? "3.2.0-alpha.3" : 'latest';
2
2
  export const MTLLoader = {
3
3
  name: 'MTL',
4
4
  id: 'mtl',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/mtl-loader.ts"],"names":["VERSION","MTLLoader","name","id","module","version","worker","extensions","mimeTypes","testText","text","includes","options","mtl","_typecheckMTLLoader"],"mappings":"AAMA,MAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE;AAUA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,KADiB;AAEvBC,EAAAA,EAAE,EAAE,KAFmB;AAGvBC,EAAAA,MAAM,EAAE,KAHe;AAIvBC,EAAAA,OAAO,EAAEL,OAJc;AAKvBM,EAAAA,MAAM,EAAE,IALe;AAMvBC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANW;AAOvBC,EAAAA,SAAS,EAAE,CAAC,YAAD,CAPY;AAQvBC,EAAAA,QAAQ,EAAGC,IAAD,IAA2BA,IAAI,CAACC,QAAL,CAAc,QAAd,CARd;AASvBC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AADE;AATc,CAAlB;AAcP,OAAO,MAAMC,mBAA2B,GAAGb,SAApC","sourcesContent":["// loaders.gl, MIT license\nimport type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ParseMTLOptions} from './lib/parse-mtl';\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 type MTLLoaderOptions = LoaderOptions & {\n mtl?: ParseMTLOptions;\n};\n\n/**\n * Loader for the MTL material format\n * Parses a Wavefront .mtl file specifying materials\n */\nexport const MTLLoader = {\n name: 'MTL',\n id: 'mtl',\n module: 'mtl',\n version: VERSION,\n worker: true,\n extensions: ['mtl'],\n mimeTypes: ['text/plain'],\n testText: (text: string): boolean => text.includes('newmtl'),\n options: {\n mtl: {}\n }\n};\n\nexport const _typecheckMTLLoader: Loader = MTLLoader;\n"],"file":"mtl-loader.js"}
1
+ {"version":3,"sources":["../../src/mtl-loader.ts"],"names":["VERSION","MTLLoader","name","id","module","version","worker","extensions","mimeTypes","testText","text","includes","options","mtl","_typecheckMTLLoader"],"mappings":"AAMA,MAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AAUA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,KADiB;AAEvBC,EAAAA,EAAE,EAAE,KAFmB;AAGvBC,EAAAA,MAAM,EAAE,KAHe;AAIvBC,EAAAA,OAAO,EAAEL,OAJc;AAKvBM,EAAAA,MAAM,EAAE,IALe;AAMvBC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANW;AAOvBC,EAAAA,SAAS,EAAE,CAAC,YAAD,CAPY;AAQvBC,EAAAA,QAAQ,EAAGC,IAAD,IAA2BA,IAAI,CAACC,QAAL,CAAc,QAAd,CARd;AASvBC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AADE;AATc,CAAlB;AAcP,OAAO,MAAMC,mBAA2B,GAAGb,SAApC","sourcesContent":["// loaders.gl, MIT license\nimport type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {ParseMTLOptions} from './lib/parse-mtl';\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 type MTLLoaderOptions = LoaderOptions & {\n mtl?: ParseMTLOptions;\n};\n\n/**\n * Loader for the MTL material format\n * Parses a Wavefront .mtl file specifying materials\n */\nexport const MTLLoader = {\n name: 'MTL',\n id: 'mtl',\n module: 'mtl',\n version: VERSION,\n worker: true,\n extensions: ['mtl'],\n mimeTypes: ['text/plain'],\n testText: (text: string): boolean => text.includes('newmtl'),\n options: {\n mtl: {}\n }\n};\n\nexport const _typecheckMTLLoader: Loader = MTLLoader;\n"],"file":"mtl-loader.js"}
@@ -1,4 +1,4 @@
1
- const VERSION = typeof "3.1.8" !== 'undefined' ? "3.1.8" : 'latest';
1
+ const VERSION = typeof "3.2.0-alpha.3" !== 'undefined' ? "3.2.0-alpha.3" : 'latest';
2
2
  export const OBJLoader = {
3
3
  name: 'OBJ',
4
4
  id: 'obj',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/obj-loader.ts"],"names":["VERSION","OBJLoader","name","id","module","version","worker","extensions","mimeTypes","testText","testOBJFile","options","obj","text","_typecheckOBJLoader"],"mappings":"AAIA,MAAMA,OAAO,GAAG,mBAAuB,WAAvB,aAAmD,QAAnE;AASA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,KADiB;AAEvBC,EAAAA,EAAE,EAAE,KAFmB;AAGvBC,EAAAA,MAAM,EAAE,KAHe;AAIvBC,EAAAA,OAAO,EAAEL,OAJc;AAKvBM,EAAAA,MAAM,EAAE,IALe;AAMvBC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANW;AAOvBC,EAAAA,SAAS,EAAE,CAAC,YAAD,CAPY;AAQvBC,EAAAA,QAAQ,EAAEC,WARa;AASvBC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AADE;AATc,CAAlB;;AAcP,SAASF,WAAT,CAAqBG,IAArB,EAA4C;AAE1C,SAAOA,IAAI,CAAC,CAAD,CAAJ,KAAY,GAAnB;AACD;;AAED,OAAO,MAAMC,mBAA2B,GAAGb,SAApC","sourcesContent":["import type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\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 type OBJLoaderOptions = LoaderOptions & {\n obj?: {};\n};\n\n/**\n * Worker loader for the OBJ geometry format\n */\nexport const OBJLoader = {\n name: 'OBJ',\n id: 'obj',\n module: 'obj',\n version: VERSION,\n worker: true,\n extensions: ['obj'],\n mimeTypes: ['text/plain'],\n testText: testOBJFile,\n options: {\n obj: {}\n }\n};\n\nfunction testOBJFile(text: string): boolean {\n // TODO - There could be comment line first\n return text[0] === 'v';\n}\n\nexport const _typecheckOBJLoader: Loader = OBJLoader;\n"],"file":"obj-loader.js"}
1
+ {"version":3,"sources":["../../src/obj-loader.ts"],"names":["VERSION","OBJLoader","name","id","module","version","worker","extensions","mimeTypes","testText","testOBJFile","options","obj","text","_typecheckOBJLoader"],"mappings":"AAIA,MAAMA,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AASA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,KADiB;AAEvBC,EAAAA,EAAE,EAAE,KAFmB;AAGvBC,EAAAA,MAAM,EAAE,KAHe;AAIvBC,EAAAA,OAAO,EAAEL,OAJc;AAKvBM,EAAAA,MAAM,EAAE,IALe;AAMvBC,EAAAA,UAAU,EAAE,CAAC,KAAD,CANW;AAOvBC,EAAAA,SAAS,EAAE,CAAC,YAAD,CAPY;AAQvBC,EAAAA,QAAQ,EAAEC,WARa;AASvBC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE;AADE;AATc,CAAlB;;AAcP,SAASF,WAAT,CAAqBG,IAArB,EAA4C;AAE1C,SAAOA,IAAI,CAAC,CAAD,CAAJ,KAAY,GAAnB;AACD;;AAED,OAAO,MAAMC,mBAA2B,GAAGb,SAApC","sourcesContent":["import type {Loader, LoaderOptions} from '@loaders.gl/loader-utils';\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 type OBJLoaderOptions = LoaderOptions & {\n obj?: {};\n};\n\n/**\n * Worker loader for the OBJ geometry format\n */\nexport const OBJLoader = {\n name: 'OBJ',\n id: 'obj',\n module: 'obj',\n version: VERSION,\n worker: true,\n extensions: ['obj'],\n mimeTypes: ['text/plain'],\n testText: testOBJFile,\n options: {\n obj: {}\n }\n};\n\nfunction testOBJFile(text: string): boolean {\n // TODO - There could be comment line first\n return text[0] === 'v';\n}\n\nexport const _typecheckOBJLoader: Loader = OBJLoader;\n"],"file":"obj-loader.js"}
@@ -35,16 +35,33 @@
35
35
  }
36
36
 
37
37
  // ../worker-utils/src/lib/worker-farm/worker-body.ts
38
+ function getParentPort() {
39
+ let parentPort;
40
+ try {
41
+ eval("globalThis.parentPort = require('worker_threads').parentPort");
42
+ parentPort = globalThis.parentPort;
43
+ } catch {
44
+ }
45
+ return parentPort;
46
+ }
38
47
  var onMessageWrapperMap = new Map();
39
48
  var WorkerBody = class {
49
+ static inWorkerThread() {
50
+ return typeof self !== "undefined" || Boolean(getParentPort());
51
+ }
40
52
  static set onmessage(onMessage) {
41
- self.onmessage = (message) => {
42
- if (!isKnownMessage(message)) {
43
- return;
44
- }
45
- const { type, payload } = message.data;
53
+ function handleMessage(message) {
54
+ const parentPort3 = getParentPort();
55
+ const { type, payload } = parentPort3 ? message : message.data;
46
56
  onMessage(type, payload);
47
- };
57
+ }
58
+ const parentPort2 = getParentPort();
59
+ if (parentPort2) {
60
+ parentPort2.on("message", handleMessage);
61
+ parentPort2.on("exit", () => console.debug("Node worker closing"));
62
+ } else {
63
+ globalThis.onmessage = handleMessage;
64
+ }
48
65
  }
49
66
  static addEventListener(onMessage) {
50
67
  let onMessageWrapper = onMessageWrapperMap.get(onMessage);
@@ -53,22 +70,36 @@
53
70
  if (!isKnownMessage(message)) {
54
71
  return;
55
72
  }
56
- const { type, payload } = message.data;
73
+ const parentPort3 = getParentPort();
74
+ const { type, payload } = parentPort3 ? message : message.data;
57
75
  onMessage(type, payload);
58
76
  };
59
77
  }
60
- self.addEventListener("message", onMessageWrapper);
78
+ const parentPort2 = getParentPort();
79
+ if (parentPort2) {
80
+ console.error("not implemented");
81
+ } else {
82
+ globalThis.addEventListener("message", onMessageWrapper);
83
+ }
61
84
  }
62
85
  static removeEventListener(onMessage) {
63
86
  const onMessageWrapper = onMessageWrapperMap.get(onMessage);
64
87
  onMessageWrapperMap.delete(onMessage);
65
- self.removeEventListener("message", onMessageWrapper);
88
+ const parentPort2 = getParentPort();
89
+ if (parentPort2) {
90
+ console.error("not implemented");
91
+ } else {
92
+ globalThis.removeEventListener("message", onMessageWrapper);
93
+ }
66
94
  }
67
95
  static postMessage(type, payload) {
68
- if (self) {
69
- const data = { source: "loaders.gl", type, payload };
70
- const transferList = getTransferList(payload);
71
- self.postMessage(data, transferList);
96
+ const data = { source: "loaders.gl", type, payload };
97
+ const transferList = getTransferList(payload);
98
+ const parentPort2 = getParentPort();
99
+ if (parentPort2) {
100
+ parentPort2.postMessage(data, transferList);
101
+ } else {
102
+ globalThis.postMessage(data, transferList);
72
103
  }
73
104
  }
74
105
  };
@@ -80,19 +111,20 @@
80
111
  // ../loader-utils/src/lib/worker-loader-utils/create-loader-worker.ts
81
112
  var requestId = 0;
82
113
  function createLoaderWorker(loader) {
83
- if (typeof self === "undefined") {
114
+ if (!WorkerBody.inWorkerThread()) {
84
115
  return;
85
116
  }
86
117
  WorkerBody.onmessage = async (type, payload) => {
87
118
  switch (type) {
88
119
  case "process":
89
120
  try {
90
- const { input, options = {} } = payload;
121
+ const { input, options = {}, context = {} } = payload;
91
122
  const result = await parseData({
92
123
  loader,
93
124
  arrayBuffer: input,
94
125
  options,
95
126
  context: {
127
+ ...context,
96
128
  parse: parseOnMainThread
97
129
  }
98
130
  });
@@ -1173,7 +1205,7 @@
1173
1205
  }
1174
1206
 
1175
1207
  // src/obj-loader.ts
1176
- var VERSION = true ? "3.1.8" : "latest";
1208
+ var VERSION = true ? "3.2.0-alpha.3" : "latest";
1177
1209
  var OBJLoader = {
1178
1210
  name: "OBJ",
1179
1211
  id: "obj",
@@ -1192,7 +1224,7 @@
1192
1224
  }
1193
1225
 
1194
1226
  // src/mtl-loader.ts
1195
- var VERSION2 = true ? "3.1.8" : "latest";
1227
+ var VERSION2 = true ? "3.2.0-alpha.3" : "latest";
1196
1228
  var MTLLoader = {
1197
1229
  name: "MTL",
1198
1230
  id: "mtl",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/obj",
3
- "version": "3.1.8",
3
+ "version": "3.2.0-alpha.3",
4
4
  "description": "Framework-independent loader for the OBJ format",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.3.1",
37
- "@loaders.gl/loader-utils": "3.1.8",
38
- "@loaders.gl/schema": "3.1.8"
37
+ "@loaders.gl/loader-utils": "3.2.0-alpha.3",
38
+ "@loaders.gl/schema": "3.2.0-alpha.3"
39
39
  },
40
- "gitHead": "0ef07b4e9fc20f5a882224cf241c6fd1bad898d8"
40
+ "gitHead": "f0d4b801efeb7094283106352ee759eccfb21f10"
41
41
  }