Skip to content

Commit

Permalink
fix: output to new directory if trailing slash (#1954)
Browse files Browse the repository at this point in the history
  • Loading branch information
SethFalco authored Feb 5, 2024
1 parent 4884d59 commit c787b9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/svgo/coa.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const regSVGFile = /\.svg$/i;
/**
* Synchronously check if path is a directory. Tolerant to errors like ENOENT.
*
* @param {string} path
* @param {string} filePath
*/
export function checkIsDir(path) {
export function checkIsDir(filePath) {
try {
return fs.lstatSync(path).isDirectory();
return fs.lstatSync(filePath).isDirectory();
} catch (e) {
return false;
return filePath.endsWith(path.sep);
}
}

Expand Down

0 comments on commit c787b9f

Please sign in to comment.