Skip to content

Commit

Permalink
Refactor a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Feb 5, 2019
1 parent fb8ef5e commit 60c15f4
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions lib/nodefs-handler.js
Expand Up @@ -264,22 +264,18 @@ function(file, stats, initialAdd, callback) {
if (error) {
this._remove(dirname, basename);
} else {
// check that change event was not fired coz of changed accessTime
if (
!newStats.atime.getTime() ||
newStats.atime.getTime() <= newStats.mtime.getTime()
) {
// Check that change event was not fired because of changed accessTime.
var at = newStats.atime.getTime();
if (!at || at <= newStats.mtime.getTime()) {
this._emit('change', file, newStats);
}
}
}.bind(this));
// add is about to be emitted if file not already tracked in parent
} else if (parent.has(basename)) {
// check that change event was not fired coz of changed accessTime
if (
!newStats.atime.getTime() ||
newStats.atime.getTime() <= newStats.mtime.getTime()
) {
// Check that change event was not fired because of changed accessTime.
var at = newStats.atime.getTime();
if (!at || at <= newStats.mtime.getTime()) {
this._emit('change', file, newStats);
}
}
Expand Down

0 comments on commit 60c15f4

Please sign in to comment.