lib/hook.js
function patch(obj, method, optionsArgIndex) {
    var orig = obj[method];
    if (!orig) return;
    obj[method] = function () {
      var opts = arguments[optionsArgIndex];
      var file = null;
      if (opts) {
        file = typeof opts == 'string' ? opts : opts.filename;
      }
      if (file) callback(file);
      return orig.apply(this, arguments);
    };
  }
function patch(obj, method, optionsArgIndex) {
    var orig = obj[method];
    if (!orig) return;
    obj[method] = function () {
      var opts = arguments[optionsArgIndex];
      var file = null;
      if (opts) {
        file = typeof opts == 'string' ? opts : opts.filename;
      }
      if (file) callback(file);
      return orig.apply(this, arguments);
    };
  }
function patch ( obj , method , optionsArgIndex ) { var orig = obj [ method ] ; if ( ! orig ) return ; obj [ method ] = function ( ) { var opts = arguments [ optionsArgIndex ] ; var file = null ; if ( opts ) { file = typeof opts == 'string' ? opts : opts . filename ; } if ( file ) callback ( file ) ; return orig . apply ( this , arguments ) ; } ; }
Patch the specified method to watch the file at the given argument
index.
Patch the specified method to watch the file at the given argument index .