@novely/core 0.47.0 → 0.47.1
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/index.global.js +12 -2
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2392,18 +2392,28 @@ var asset = (...variants) => {
|
|
|
2392
2392
|
return assetPrivate(variants);
|
|
2393
2393
|
};
|
|
2394
2394
|
asset.image = (source) => {
|
|
2395
|
-
|
|
2395
|
+
if (assetPrivate.cache.has(source)) {
|
|
2396
|
+
return assetPrivate.cache.get(source);
|
|
2397
|
+
}
|
|
2398
|
+
const asset2 = {
|
|
2396
2399
|
type: "image",
|
|
2397
2400
|
source,
|
|
2398
2401
|
id: generateRandomId()
|
|
2399
2402
|
};
|
|
2403
|
+
assetPrivate.cache.set(source, asset2);
|
|
2404
|
+
return asset2;
|
|
2400
2405
|
};
|
|
2401
2406
|
asset.audio = (source) => {
|
|
2402
|
-
|
|
2407
|
+
if (assetPrivate.cache.has(source)) {
|
|
2408
|
+
return assetPrivate.cache.get(source);
|
|
2409
|
+
}
|
|
2410
|
+
const asset2 = {
|
|
2403
2411
|
type: "audio",
|
|
2404
2412
|
source,
|
|
2405
2413
|
id: generateRandomId()
|
|
2406
2414
|
};
|
|
2415
|
+
assetPrivate.cache.set(source, asset2);
|
|
2416
|
+
return asset2;
|
|
2407
2417
|
};
|
|
2408
2418
|
export {
|
|
2409
2419
|
EN,
|