refactor: more TS code

This commit is contained in:
Tristan Yang
2022-08-03 08:50:27 +08:00
parent bba42f2f45
commit 0254b50a04
21 changed files with 77 additions and 52 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ export const isTreatAsImage = (file: File) => {
return false;
};
export function getDefaultSize(size = null, min = 480) {
export function getDefaultSize(size?: { width: number; height: number }, min = 480) {
if (!size) return { width: 0, height: 0 };
const { width: oWidth, height: oHeight } = size;
if (oWidth == oHeight) {