From f83b7b541c241f6c526cf3387943bcca4f2e35e3 Mon Sep 17 00:00:00 2001 From: yuanchuan Date: Fri, 16 Oct 2020 10:53:25 +0800 Subject: [PATCH] Don't normalize events for Windows or it might lost essential events. Fix #103 --- lib/watch.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/watch.js b/lib/watch.js index 1758084..6fe04ff 100644 --- a/lib/watch.js +++ b/lib/watch.js @@ -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); }