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/browser/index.d.mts +1 -0
- package/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.js +7 -3
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +7 -3
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +7 -3
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +1 -0
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +7 -3
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +7 -3
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.d.mts
CHANGED
|
@@ -174,6 +174,7 @@ declare class AssetKey extends BasicAssetKey {
|
|
|
174
174
|
rootType: "assets" | "data" | string;
|
|
175
175
|
extension: ".json" | ".png" | string;
|
|
176
176
|
root?: string | undefined;
|
|
177
|
+
readonly isAssetKey: true;
|
|
177
178
|
constructor(namespace: string, path: string, assetType?: AssetType | undefined, type?: string | undefined, rootType?: "assets" | "data" | string, extension?: ".json" | ".png" | string, root?: string | undefined);
|
|
178
179
|
static parse(assetType: AssetType, str: string, origin?: AssetKey): AssetKey;
|
|
179
180
|
toString(): string;
|
package/dist/node/index.d.ts
CHANGED
|
@@ -174,6 +174,7 @@ declare class AssetKey extends BasicAssetKey {
|
|
|
174
174
|
rootType: "assets" | "data" | string;
|
|
175
175
|
extension: ".json" | ".png" | string;
|
|
176
176
|
root?: string | undefined;
|
|
177
|
+
readonly isAssetKey: true;
|
|
177
178
|
constructor(namespace: string, path: string, assetType?: AssetType | undefined, type?: string | undefined, rootType?: "assets" | "data" | string, extension?: ".json" | ".png" | string, root?: string | undefined);
|
|
178
179
|
static parse(assetType: AssetType, str: string, origin?: AssetKey): AssetKey;
|
|
179
180
|
toString(): string;
|
package/dist/node/index.js
CHANGED
|
@@ -1281,6 +1281,7 @@ var AssetKey = class _AssetKey extends BasicAssetKey {
|
|
|
1281
1281
|
this.rootType = rootType;
|
|
1282
1282
|
this.extension = extension;
|
|
1283
1283
|
this.root = root;
|
|
1284
|
+
this.isAssetKey = true;
|
|
1284
1285
|
}
|
|
1285
1286
|
static parse(assetType, str, origin) {
|
|
1286
1287
|
let namespace = origin?.namespace || DEFAULT_NAMESPACE;
|
|
@@ -1296,7 +1297,10 @@ var AssetKey = class _AssetKey extends BasicAssetKey {
|
|
|
1296
1297
|
split.shift();
|
|
1297
1298
|
}
|
|
1298
1299
|
let path = split.join("/");
|
|
1299
|
-
|
|
1300
|
+
const extension = assetType === "textures" ? ".png" : origin?.extension ?? ".json";
|
|
1301
|
+
if (extension && path.endsWith(extension)) {
|
|
1302
|
+
path = path.slice(0, -extension.length);
|
|
1303
|
+
}
|
|
1300
1304
|
return new _AssetKey(namespace, path, assetType, type, "assets", extension, origin?.root);
|
|
1301
1305
|
}
|
|
1302
1306
|
toString() {
|
|
@@ -1326,10 +1330,10 @@ var AssetKey = class _AssetKey extends BasicAssetKey {
|
|
|
1326
1330
|
}
|
|
1327
1331
|
};
|
|
1328
1332
|
function isBasicAssetKey(obj) {
|
|
1329
|
-
return "
|
|
1333
|
+
return obj !== null && typeof obj === "object" && typeof obj.namespace === "string" && typeof obj.path === "string";
|
|
1330
1334
|
}
|
|
1331
1335
|
function isAssetKey(obj) {
|
|
1332
|
-
return isBasicAssetKey(obj) &&
|
|
1336
|
+
return isBasicAssetKey(obj) && obj.isAssetKey === true;
|
|
1333
1337
|
}
|
|
1334
1338
|
|
|
1335
1339
|
// src/model/ModelMerger.ts
|