Skip to content

Commit

Permalink
Merge pull request #126 from j9t/fix/qodana
Browse files Browse the repository at this point in the history
Include Qodana-suggested improvements
  • Loading branch information
j9t authored Sep 2, 2024
2 parents e562372 + 8be430e commit 9becec3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@j9t/imagemin-guard",
"description": "Ensure losslessly compressed JPG, PNG, GIF, WebP, and AVIF images (suitable for manual and automatic compression)",
"author": "Jens Oliver Meiert",
"version": "3.3.3",
"version": "3.3.4",
"type": "module",
"license": "Apache-2.0",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ import { hideBin } from 'yargs/helpers'

// Search for staged files
if(argv.staged){
sgf('A', async function(err, results){
if(err){
await sgf('A', async function (err, results) {
if (err) {
return console.error(err)
}

compressionFiles = results
.map(result => result.filename)
.filter(filename => files.includes(filename))

compress(compressionFiles, argv.dry)
await compress(compressionFiles, argv.dry)
})
} else {
compress(compressionFiles, argv.dry)
await compress(compressionFiles, argv.dry)
}

})()

0 comments on commit 9becec3

Please sign in to comment.