Skip to content

Commit

Permalink
Don't normalize events for Windows or it might lost essential events.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanchuan committed Oct 22, 2020
1 parent aab7a4a commit f83b7b5
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions lib/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,6 @@ function getMessages(cache) {
}
}

// Prevent redundant event for its parent when creating file/directory.
// The operation is kinda expensive so only be triggered under Windows.
// https://github.com/yuanchuan/node-watch/issues/79
if (is.windows()) {
var parents = filtered.map(function(n) {
return path.parse(n).dir;
});
filtered = filtered.filter(function(n) {
// Skip on removal
if (!is.exists(n)) {
return true;
}
// Ignore the parent directory
return !parents.some(function(m) {
return is.samePath(n, m);
});
});
}

return composeMessage(filtered);
}

Expand Down

0 comments on commit f83b7b5

Please sign in to comment.