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.
@@ -1126,6 +1126,7 @@ var AssetKey = class _AssetKey extends BasicAssetKey {
1126
1126
  this.rootType = rootType;
1127
1127
  this.extension = extension;
1128
1128
  this.root = root;
1129
+ this.isAssetKey = true;
1129
1130
  }
1130
1131
  static parse(assetType, str, origin) {
1131
1132
  let namespace = origin?.namespace || DEFAULT_NAMESPACE;
@@ -1141,7 +1142,10 @@ var AssetKey = class _AssetKey extends BasicAssetKey {
1141
1142
  split.shift();
1142
1143
  }
1143
1144
  let path = split.join("/");
1144
- let extension = assetType === "textures" ? ".png" : origin?.assetType || ".json";
1145
+ const extension = assetType === "textures" ? ".png" : origin?.extension ?? ".json";
1146
+ if (extension && path.endsWith(extension)) {
1147
+ path = path.slice(0, -extension.length);
1148
+ }
1145
1149
  return new _AssetKey(namespace, path, assetType, type, "assets", extension, origin?.root);
1146
1150
  }
1147
1151
  toString() {
@@ -1171,10 +1175,10 @@ var AssetKey = class _AssetKey extends BasicAssetKey {
1171
1175
  }
1172
1176
  };
1173
1177
  function isBasicAssetKey(obj) {
1174
- return "namespace" in obj && "path" in obj;
1178
+ return obj !== null && typeof obj === "object" && typeof obj.namespace === "string" && typeof obj.path === "string";
1175
1179
  }
1176
1180
  function isAssetKey(obj) {
1177
- return isBasicAssetKey(obj) && "parse" in obj;
1181
+ return isBasicAssetKey(obj) && obj.isAssetKey === true;
1178
1182
  }
1179
1183
 
1180
1184
  // src/model/ModelMerger.ts