lib/watch.js
function filter(location) {
    var file = path.basename(location)
      , vim = file.charAt(file.length - 1) === '~'
      , extension = path.extname(location).slice(1);

    // filter out the duplicates
    if (~changes.indexOf(location) || vim) return;

    changes.push(location);
    process.nextTick(limited);
  }
function filter(location) {
    var file = path.basename(location)
      , vim = file.charAt(file.length - 1) === '~'
      , extension = path.extname(location).slice(1);

    // filter out the duplicates
    if (~changes.indexOf(location) || vim) return;

    changes.push(location);
    process.nextTick(limited);
  }
function filter ( location ) { var file = path . basename ( location ) , vim = file . charAt ( file . length - 1 ) === '~' , extension = path . extname ( location ) . slice ( 1 ) ; // filter out the duplicates if ( ~ changes . indexOf ( location ) || vim ) return ; changes . push ( location ) ; process . nextTick ( limited ) ; }
Filter out the bad files and try to remove some noise. For example vim
generates some silly swap files in directories or other silly thumb files

The this context of this file will be set the current directory that we are
watching.

@param {String} file
@api private
Filter out the bad files and try to remove some noise . For example vim generates some silly swap files in directories or other silly thumb files