@loaders.gl/draco 4.4.0-alpha.16 → 4.4.0-alpha.18

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.
package/dist/dist.dev.js CHANGED
@@ -109,6 +109,16 @@ var __exports__ = (() => {
109
109
 
110
110
  // ../worker-utils/src/lib/library-utils/library-utils.ts
111
111
  var loadLibraryPromises = {};
112
+ function extractLoadLibraryOptions(options = {}) {
113
+ const useLocalLibraries = options.useLocalLibraries ?? options.core?.useLocalLibraries;
114
+ const CDN = options.CDN ?? options.core?.CDN;
115
+ const modules = options.modules;
116
+ return {
117
+ ...useLocalLibraries !== void 0 ? { useLocalLibraries } : {},
118
+ ...CDN !== void 0 ? { CDN } : {},
119
+ ...modules !== void 0 ? { modules } : {}
120
+ };
121
+ }
112
122
  async function loadLibrary(libraryUrl, moduleName = null, options = {}, libraryName = null) {
113
123
  if (moduleName) {
114
124
  libraryUrl = getLibraryUrl(libraryUrl, moduleName, options, libraryName);
@@ -744,7 +754,7 @@ var __exports__ = (() => {
744
754
  encode
745
755
  };
746
756
  async function encode(data, options = {}) {
747
- const { draco } = await loadDracoEncoderModule(options.core || {});
757
+ const { draco } = await loadDracoEncoderModule(extractLoadLibraryOptions(options));
748
758
  const dracoBuilder = new DracoBuilder(draco);
749
759
  try {
750
760
  return dracoBuilder.encodeSync(data, options.draco);
@@ -13629,7 +13639,6 @@ return true;`);
13629
13639
  draco: {
13630
13640
  decoderType: typeof WebAssembly === "object" ? "wasm" : "js",
13631
13641
  // 'js' for IE11
13632
- libraryPath: "libs/",
13633
13642
  extraAttributes: {},
13634
13643
  attributeNameEntry: void 0
13635
13644
  }
@@ -13641,7 +13650,7 @@ return true;`);
13641
13650
  };
13642
13651
  async function parse(arrayBuffer, options) {
13643
13652
  const { draco } = await loadDracoDecoderModule(
13644
- options?.core,
13653
+ extractLoadLibraryOptions(options),
13645
13654
  options?.draco?.decoderType || "wasm"
13646
13655
  );
13647
13656
  const dracoParser = new DracoParser(draco);