chore: format

This commit is contained in:
Nathan Walker
2020-07-05 14:57:06 -07:00
parent 8f2900ad0b
commit da3c0b973d
379 changed files with 71587 additions and 54582 deletions

View File

@@ -1,27 +1,27 @@
export function getScaledDimensions(
width: number,
height: number,
maxSize: number
width: number,
height: number,
maxSize: number
) {
if (height >= width) {
if (height <= maxSize) {
// if image already smaller than the required height
return { width, height };
}
if (height >= width) {
if (height <= maxSize) {
// if image already smaller than the required height
return { width, height };
}
return {
width: Math.round((maxSize * width) / height),
height: maxSize
};
}
return {
width: Math.round((maxSize * width) / height),
height: maxSize,
};
}
if (width <= maxSize) {
// if image already smaller than the required width
return { width, height };
}
if (width <= maxSize) {
// if image already smaller than the required width
return { width, height };
}
return {
width: maxSize,
height: Math.round((maxSize * height) / width)
};
return {
width: maxSize,
height: Math.round((maxSize * height) / width),
};
}