@tradly/asset 1.0.12 → 1.0.13
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.
|
@@ -70,7 +70,14 @@ var compressImage = function compressImage(file) {
|
|
|
70
70
|
resolve(file);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
|
|
74
|
+
// If we converted to WebP, normalize extension in the file name
|
|
75
|
+
var newName = file.name;
|
|
76
|
+
if (targetType === "image/webp") {
|
|
77
|
+
var dotIndex = file.name.lastIndexOf(".");
|
|
78
|
+
newName = dotIndex > 0 ? "".concat(file.name.slice(0, dotIndex), ".webp") : "".concat(file.name, ".webp");
|
|
79
|
+
}
|
|
80
|
+
var compressedFile = new File([blob], newName, {
|
|
74
81
|
type: targetType,
|
|
75
82
|
lastModified: Date.now()
|
|
76
83
|
});
|
|
@@ -64,7 +64,14 @@ var compressImage = function compressImage(file) {
|
|
|
64
64
|
resolve(file);
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
|
|
68
|
+
// If we converted to WebP, normalize extension in the file name
|
|
69
|
+
var newName = file.name;
|
|
70
|
+
if (targetType === "image/webp") {
|
|
71
|
+
var dotIndex = file.name.lastIndexOf(".");
|
|
72
|
+
newName = dotIndex > 0 ? "".concat(file.name.slice(0, dotIndex), ".webp") : "".concat(file.name, ".webp");
|
|
73
|
+
}
|
|
74
|
+
var compressedFile = new File([blob], newName, {
|
|
68
75
|
type: targetType,
|
|
69
76
|
lastModified: Date.now()
|
|
70
77
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradly/asset",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "A reusable media gallery component for uploading and selecting images, videos, and files with Tradly authentication",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|