docs: function resolveUp(patterns, options) {
    if (!isValidGlob(patterns)) {
      throw new Error('resolve-up expects a string or array as the first argument.');
    }
  
    var opts = extend({fast: true}, options);
    var dirs = paths(opts).concat(opts.paths || []);
    var len = dirs.length;
    var idx = -1;
    var res = [];
  
    while (++idx < len) {
      opts.cwd = dirs[idx];
      if (!opts.cwd) continue;
      opts.cwd = path.resolve(opts.cwd);
      var key = opts.cwd + '=' + patterns;
      if (cache[key]) {
        res.push.apply(res, cache[key]);
      } else {
        var files = resolve(glob.sync(patterns, opts), opts);
        cache[key] = files;
        res.push.apply(res, files);
      }
    }
    return unique(res);
  }