minerender 2.1.0-alpha.17 → 2.1.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/bundle.js CHANGED
@@ -67157,6 +67157,7 @@ return ${compiler2.callType("value", tagType)}
67157
67157
  this.rootType = rootType;
67158
67158
  this.extension = extension;
67159
67159
  this.root = root;
67160
+ this.isAssetKey = true;
67160
67161
  }
67161
67162
  static parse(assetType, str, origin) {
67162
67163
  let namespace = origin?.namespace || DEFAULT_NAMESPACE;
@@ -67172,7 +67173,10 @@ return ${compiler2.callType("value", tagType)}
67172
67173
  split.shift();
67173
67174
  }
67174
67175
  let path = split.join("/");
67175
- let extension = assetType === "textures" ? ".png" : origin?.assetType || ".json";
67176
+ const extension = assetType === "textures" ? ".png" : origin?.extension ?? ".json";
67177
+ if (extension && path.endsWith(extension)) {
67178
+ path = path.slice(0, -extension.length);
67179
+ }
67176
67180
  return new _AssetKey(namespace, path, assetType, type, "assets", extension, origin?.root);
67177
67181
  }
67178
67182
  toString() {
@@ -67202,10 +67206,10 @@ return ${compiler2.callType("value", tagType)}
67202
67206
  }
67203
67207
  };
67204
67208
  function isBasicAssetKey(obj) {
67205
- return "namespace" in obj && "path" in obj;
67209
+ return obj !== null && typeof obj === "object" && typeof obj.namespace === "string" && typeof obj.path === "string";
67206
67210
  }
67207
67211
  function isAssetKey(obj) {
67208
- return isBasicAssetKey(obj) && "parse" in obj;
67212
+ return isBasicAssetKey(obj) && obj.isAssetKey === true;
67209
67213
  }
67210
67214
 
67211
67215
  // src/model/ModelMerger.ts