docs: function isDir(fp, stat) {
    if (endsWith(fp, '/')) {
      return true;
    }
  
    if (stat === null) {
      // try to get the directory info if it hasn't been done yet
      // to ensure directories containing dots are well handle
      stat = tryStats(fp);
    }
  
    if (isObject(stat) && typeof stat.isDirectory === 'function') {
      return stat.isDirectory();
    }
  
    var segs = fp.split('/');
    var last = segs[segs.length - 1];
    if (last && last.indexOf('.') !== -1) {
      return false;
    }
    return true;
  }