robbyson-frontend-library 1.0.66 → 1.0.68
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.
|
@@ -97,7 +97,11 @@ export function getCroppedImg(imageSrc, pixelCrop, flip, type) {
|
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
export function checkExpiresPublicUrl(publicUrl) {
|
|
100
|
-
var
|
|
100
|
+
var _a, _b;
|
|
101
|
+
var expiresIn = parseInt((_b = (_a = publicUrl.split("Expires=")[1]) === null || _a === void 0 ? void 0 : _a.split("&")) === null || _b === void 0 ? void 0 : _b[0]);
|
|
102
|
+
if (!expiresIn) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
101
105
|
var currentTime = Math.floor(new Date().getTime() / 1000);
|
|
102
106
|
return currentTime > expiresIn;
|
|
103
107
|
}
|
package/package.json
CHANGED
package/src/utils/image.utils.ts
CHANGED
|
@@ -74,7 +74,11 @@ export async function getCroppedImg(
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export function checkExpiresPublicUrl(publicUrl: string): boolean {
|
|
77
|
-
const expiresIn = parseInt(publicUrl.split("Expires=")[1]
|
|
77
|
+
const expiresIn = parseInt(publicUrl.split("Expires=")[1]?.split("&")?.[0]);
|
|
78
|
+
|
|
79
|
+
if (!expiresIn) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
78
82
|
|
|
79
83
|
const currentTime = Math.floor(new Date().getTime() / 1000);
|
|
80
84
|
|