index.js
function recorder(opts, fn) {
  var group = stack[stack.length - 1];
  var response = null;

  assert(group, 'please specify copycat group');
  recordings = load(group) || [];

  recordings.forEach(function(recording) {
    if (!deepEqual(recording.opts, opts)) return;
    response = recording;
  });

  if (response) {
    return fn(response.err, response.res, response.body);
  }

  request(opts, function(err, res, body) {
    requests = requests || [];
    requests.push({ opts: opts, err: err, res: res, body: body });
    fn.apply(null, arguments);
  });
}
function recorder(opts, fn) {
  var group = stack[stack.length - 1];
  var response = null;

  assert(group, 'please specify copycat group');
  recordings = load(group) || [];

  recordings.forEach(function(recording) {
    if (!deepEqual(recording.opts, opts)) return;
    response = recording;
  });

  if (response) {
    return fn(response.err, response.res, response.body);
  }

  request(opts, function(err, res, body) {
    requests = requests || [];
    requests.push({ opts: opts, err: err, res: res, body: body });
    fn.apply(null, arguments);
  });
}
function recorder ( opts , fn ) { var group = stack [ stack . length - 1 ] ; var response = null ; assert ( group , 'please specify copycat group' ) ; recordings = load ( group ) || [ ] ; recordings . forEach ( function ( recording ) { if ( ! deepEqual ( recording . opts , opts ) ) return ; response = recording ; } ) ; if ( response ) { return fn ( response . err , response . res , response . body ) ; } request ( opts , function ( err , res , body ) { requests = requests || [ ] ; requests . push ( { opts : opts , err : err , res : res , body : body } ) ; fn . apply ( null , arguments ) ; } ) ; }
Request copycat.

@param {Object} options
@param {Function} fn
@api public
Request copycat .