Comparing version 2.0.0-beta.12 to 2.0.0-beta.13
@@ -67,2 +67,4 @@ /* | ||
this.files = new Map(); | ||
/** @type {Map<string, number>} */ | ||
this.filesWithoutCase = new Map(); | ||
this.directories = new Map(); | ||
@@ -158,4 +160,11 @@ this.lastWatchEvent = 0; | ||
this.files.delete(itemPath); | ||
const key = withoutCase(itemPath); | ||
const count = this.filesWithoutCase.get(key) - 1; | ||
if (count <= 0) { | ||
this.filesWithoutCase.delete(key); | ||
this.forEachWatcher(itemPath, w => w.emit("remove", type)); | ||
} else { | ||
this.filesWithoutCase.set(key, count); | ||
} | ||
this.forEachWatcher(itemPath, w => w.emit("remove", type)); | ||
if (!initial) { | ||
@@ -203,2 +212,14 @@ this.forEachWatcher(this.path, w => | ||
if (!old) { | ||
const key = withoutCase(filePath); | ||
const count = this.filesWithoutCase.get(key); | ||
this.filesWithoutCase.set(key, (count || 0) + 1); | ||
if (count !== undefined) { | ||
// There is already a file with case-insenstive-equal name | ||
// On a case-insenstive filesystem we may miss the renaming | ||
// when only casing is changed. | ||
// To be sure that our information is correct | ||
// we trigger a rescan here | ||
this.doScan(false); | ||
} | ||
this.forEachWatcher(filePath, w => { | ||
@@ -205,0 +226,0 @@ if (!initial || w.checkStartTime(safeTime, initial)) { |
{ | ||
"name": "watchpack", | ||
"version": "2.0.0-beta.12", | ||
"version": "2.0.0-beta.13", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/watchpack.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40594
1131