@@ -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)) { |
+1
-1
| { | ||
| "name": "watchpack", | ||
| "version": "2.0.0-beta.12", | ||
| "version": "2.0.0-beta.13", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/watchpack.js", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
40594
1.83%1131
1.8%