Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tinify.validate(function(err) {
if (err) {
reject(new TinyPngValidateError())
}
const compressionsThisMonth = tinify.compressionCount
if (compressionsThisMonth + images.length > 500) {
console.log(
colors.red("compressions this month is over follow (> 500).")
)
} else {
const left = 500 - compressionsThisMonth
console.log(colors.yellow("compressions this month left " + left))
}
resolve("tinyPng is valid.")
})
})
const checkCompressionCount = (count = 0)=> {
return (500 - tinify.compressionCount - count) >> 0;
}