index.js
function format(obj, opts, fn) {
  if (typeof opts === 'function') {
    fn = opts; opts = {};
  }

  opts = opts || {};
  if (Array.isArray(opts.filter) || typeof opts.filter === 'string') {
    obj = filter(obj, opts.filter);
  }

  var keys = Object.keys(obj);
  var len = keys.length, i = 0;
  var str = '';
  var total = len;

  while (len--) {
    var fp = keys[i++];
    var ctx = context(read(fp), fn);
    var name = basename(fp);
    str += heading(name, fp);

    var list = obj[fp];
    var methods = Object.keys(list);
    total += methods.length;

    str += listify(fp, methods, ctx);
  }

  var res = {};
  res.list = str;
  res.total = total;
  return res;
}
function format(obj, opts, fn) {
  if (typeof opts === 'function') {
    fn = opts; opts = {};
  }

  opts = opts || {};
  if (Array.isArray(opts.filter) || typeof opts.filter === 'string') {
    obj = filter(obj, opts.filter);
  }

  var keys = Object.keys(obj);
  var len = keys.length, i = 0;
  var str = '';
  var total = len;

  while (len--) {
    var fp = keys[i++];
    var ctx = context(read(fp), fn);
    var name = basename(fp);
    str += heading(name, fp);

    var list = obj[fp];
    var methods = Object.keys(list);
    total += methods.length;

    str += listify(fp, methods, ctx);
  }

  var res = {};
  res.list = str;
  res.total = total;
  return res;
}
function format ( obj , opts , fn ) { if ( typeof opts === 'function' ) { fn = opts ; opts = { } ; } opts = opts || { } ; if ( Array . isArray ( opts . filter ) || typeof opts . filter === 'string' ) { obj = filter ( obj , opts . filter ) ; } var keys = Object . keys ( obj ) ; var len = keys . length , i = 0 ; var str = '' ; var total = len ; while ( len -- ) { var fp = keys [ i ++ ] ; var ctx = context ( read ( fp ) , fn ) ; var name = basename ( fp ) ; str += heading ( name , fp ) ; var list = obj [ fp ] ; var methods = Object . keys ( list ) ; total += methods . length ; str += listify ( fp , methods , ctx ) ; } var res = { } ; res . list = str ; res . total = total ; return res ; }
Generate a formatted list that includes the given files,
and their respective methods. Uses code context to build
the list.

@param  {Object} `obj` Object, The key is a file name and the properties are the methods.
@return {Object}
Generate a formatted list that includes the given files and their respective methods . Uses code context to build the list .