We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d822d9 commit 37c7fc7Copy full SHA for 37c7fc7
index.js
@@ -2,6 +2,13 @@
2
const { gcd, highestFirst, formatAspectRatio } = require('./utils')
3
4
module.exports = (height, width, seperator = ':') => {
5
+ if (!height) {
6
+ throw new Error(`Invalid height: ${height}`);
7
+ }
8
+
9
+ if (!width) {
10
+ throw new Error(`Invalid width: ${width}`);
11
12
const [h, w] = highestFirst(height, width)
13
const divisor = gcd(h, w)
14
return formatAspectRatio(h, w, divisor, seperator)
0 commit comments