@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.global.js
CHANGED
|
@@ -2727,18 +2727,28 @@ var Novely = (() => {
|
|
|
2727
2727
|
return assetPrivate(variants);
|
|
2728
2728
|
};
|
|
2729
2729
|
asset.image = (source) => {
|
|
2730
|
-
|
|
2730
|
+
if (assetPrivate.cache.has(source)) {
|
|
2731
|
+
return assetPrivate.cache.get(source);
|
|
2732
|
+
}
|
|
2733
|
+
const asset2 = {
|
|
2731
2734
|
type: "image",
|
|
2732
2735
|
source,
|
|
2733
2736
|
id: generateRandomId()
|
|
2734
2737
|
};
|
|
2738
|
+
assetPrivate.cache.set(source, asset2);
|
|
2739
|
+
return asset2;
|
|
2735
2740
|
};
|
|
2736
2741
|
asset.audio = (source) => {
|
|
2737
|
-
|
|
2742
|
+
if (assetPrivate.cache.has(source)) {
|
|
2743
|
+
return assetPrivate.cache.get(source);
|
|
2744
|
+
}
|
|
2745
|
+
const asset2 = {
|
|
2738
2746
|
type: "audio",
|
|
2739
2747
|
source,
|
|
2740
2748
|
id: generateRandomId()
|
|
2741
2749
|
};
|
|
2750
|
+
assetPrivate.cache.set(source, asset2);
|
|
2751
|
+
return asset2;
|
|
2742
2752
|
};
|
|
2743
2753
|
return __toCommonJS(src_exports);
|
|
2744
2754
|
})();
|