Socket
Socket
Sign inDemoInstall

watchpack

Package Overview
Dependencies
121
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.1 to 1.4.0

48

lib/DirectoryWatcher.js

@@ -59,3 +59,4 @@ /*

usePolling: options.poll ? true : undefined,
interval: typeof options.poll === "number" ? options.poll : undefined
interval: typeof options.poll === "number" ? options.poll : undefined,
disableGlobbing: true
});

@@ -123,21 +124,34 @@ this.watcher.on("add", this.onFileAdded.bind(this));

DirectoryWatcher.prototype.setDirectory = function setDirectory(directoryPath, exist, initial, type) {
var old = this.directories[directoryPath];
if(!old) {
if(exist) {
if(this.nestedWatching) {
this.createNestedWatcher(directoryPath);
} else {
this.directories[directoryPath] = true;
}
if(directoryPath === this.path) {
if(!initial && this.watchers[withoutCase(this.path)]) {
this.watchers[withoutCase(this.path)].forEach(function(w) {
w.emit("change", directoryPath, w.data, initial ? "initial" : type);
});
}
} else {
if(!exist) {
if(this.nestedWatching)
this.directories[directoryPath].close();
delete this.directories[directoryPath];
if(!initial && this.watchers[withoutCase(this.path)]) {
this.watchers[withoutCase(this.path)].forEach(function(w) {
w.emit("change", directoryPath, w.data, initial ? "initial" : type);
});
var old = this.directories[directoryPath];
if(!old) {
if(exist) {
if(this.nestedWatching) {
this.createNestedWatcher(directoryPath);
} else {
this.directories[directoryPath] = true;
}
if(!initial && this.watchers[withoutCase(this.path)]) {
this.watchers[withoutCase(this.path)].forEach(function(w) {
w.emit("change", directoryPath, w.data, initial ? "initial" : type);
});
}
}
} else {
if(!exist) {
if(this.nestedWatching)
this.directories[directoryPath].close();
delete this.directories[directoryPath];
if(!initial && this.watchers[withoutCase(this.path)]) {
this.watchers[withoutCase(this.path)].forEach(function(w) {
w.emit("change", directoryPath, w.data, initial ? "initial" : type);
});
}
}
}

@@ -144,0 +158,0 @@ }

{
"name": "watchpack",
"version": "1.3.1",
"version": "1.4.0",
"description": "",

@@ -41,5 +41,5 @@ "main": "./lib/watchpack.js",

"async": "^2.1.2",
"chokidar": "^1.4.3",
"chokidar": "^1.7.0",
"graceful-fs": "^4.1.2"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc