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