@veritree/ui 0.16.4 → 0.16.5
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/package.json +1 -1
- package/src/utils/images.js +9 -10
package/package.json
CHANGED
package/src/utils/images.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export const handleImageResizing = (url, width) => {
|
|
2
|
+
// early exit if url is null for whatever reason
|
|
3
|
+
if (!url) {
|
|
4
|
+
return '';
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
let cdn;
|
|
8
|
+
|
|
2
9
|
try {
|
|
3
|
-
// early exit if url is null for whatever reason
|
|
4
|
-
if (!url) {
|
|
5
|
-
return '';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
let cdn;
|
|
9
|
-
|
|
10
10
|
if (typeof url === 'object') {
|
|
11
11
|
cdn = url.cdn_url;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
if (typeof url === 'string') {
|
|
15
15
|
cdn = JSON.parse(url).cdn_url;
|
|
16
16
|
}
|
|
@@ -39,7 +39,6 @@ export const handleImageResizing = (url, width) => {
|
|
|
39
39
|
|
|
40
40
|
return encodedUrl
|
|
41
41
|
} catch(error) {
|
|
42
|
-
console.
|
|
43
|
-
console.log(error);
|
|
42
|
+
console.error(`${error} in ${cdn}`);
|
|
44
43
|
}
|
|
45
44
|
};
|