Skip to content

Commit

Permalink
ignoreDestinationFiles renamed to ignoreConflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Aslan Baryshnikov committed Apr 25, 2022
1 parent 86f51eb commit 59b0d5b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Default `false`

If true, only existing files in the destination folder will be overwritten. If your destination folder is empty, there will be no changes (because nothing to update). Only available when smartMode is enabled.

##### ignoreDestinationFiles?
##### ignoreConflicts?

Type: `Boolean`<br>
Default `false`
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const imageOptimist = async (config) => {
destinationPath: null,
smartMode: true,
overwriteMode: false,
ignoreDestinationFiles: false,
ignoreConflicts: false,
mask: '*.{jpg,jpeg,png,svg,gif}',
webp: [
imageminWebp({
Expand Down Expand Up @@ -120,7 +120,7 @@ const imageOptimist = async (config) => {
!candidateIsExists
|| !sourceFileIsExists
|| candidateSize === sourceFileSize
|| c.ignoreDestinationFiles
|| c.ignoreConflicts
) {
// eslint-disable-next-line no-nested-ternary
if (candidateIsExists ? tmpFileSize < candidateSize : true) {
Expand All @@ -134,7 +134,7 @@ const imageOptimist = async (config) => {
console.warn(`Conflict: ${sourceFile} and ${candidate}\nThe source file and the file in the`
+ ' destination folder are not the same. You should replace an'
+ ' obsolete file with a more recent one to avoid erroneous overwriting.'
+ ' You can set ignoreDestinationFiles to true if you do not care about'
+ ' You can set ignoreConflicts to true if you do not care about'
+ ' files in the destination folder.');
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "image-optimist",
"version": "1.0.14",
"version": "1.0.15",
"description": "A utility for processing and converting images to the requirements of the modern web.",
"private": false,
"main": "index.js",
Expand Down

0 comments on commit 59b0d5b

Please sign in to comment.