Socket
Socket
Sign inDemoInstall

watchpack

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

watchpack - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

20

lib/DirectoryWatcher.js

@@ -47,4 +47,4 @@ /*

this.path = directoryPath;
this.files = {};
this.directories = {};
this.files = Object.create(null);
this.directories = Object.create(null);
this.watcher = chokidar.watch(directoryPath, {

@@ -72,3 +72,3 @@ ignoreInitial: true,

this.doInitialScan();
this.watchers = {};
this.watchers = Object.create(null);
this.refs = 0;

@@ -108,3 +108,2 @@ }

} else if(!initial && !mtime) {
delete this.files[filePath];
if(this.watchers[withoutCase(filePath)]) {

@@ -293,12 +292,15 @@ this.watchers[withoutCase(filePath)].forEach(function(w) {

DirectoryWatcher.prototype.getTimes = function() {
var obj = {};
var obj = Object.create(null);
var selfTime = 0;
Object.keys(this.files).forEach(function(file) {
var data = this.files[file];
var time;
if(data[1]) {
var time = Math.max(data[0], data[1] + FS_ACCURACY);
obj[file] = time;
if(time > selfTime)
selfTime = time;
time = Math.max(data[0], data[1] + FS_ACCURACY);
} else {
time = data[0];
}
obj[file] = time;
if(time > selfTime)
selfTime = time;
}, this);

@@ -305,0 +307,0 @@ if(this.nestedWatching) {

@@ -19,3 +19,2 @@ /*

this.dirWatchers = [];
this.mtimes = {};
this.paused = false;

@@ -86,3 +85,3 @@ this.aggregatedChanges = [];

addWatchersToArray(this.fileWatchers.concat(this.dirWatchers), directoryWatchers);
var obj = {};
var obj = Object.create(null);
directoryWatchers.forEach(function(w) {

@@ -116,3 +115,2 @@ var times = w.getTimes();

file = file || item;
this.mtimes[file] = mtime;
if(this.paused) return;

@@ -129,3 +127,2 @@ this.emit("change", file, mtime);

file = file || item;
delete this.mtimes[item];
if(this.paused) return;

@@ -132,0 +129,0 @@ this.emit("remove", item);

{
"name": "watchpack",
"version": "1.2.1",
"version": "1.3.0",
"description": "",

@@ -36,3 +36,3 @@ "main": "./lib/watchpack.js",

"mocha": "^2.1.0",
"rimraf": "^2.2.8",
"rimraf": "~2.5.0",
"should": "^8.3.1"

@@ -39,0 +39,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc