code: function findPackage(config, match) {
    var map = getPackageMap(config.relativeTo, config.packages);
  
    return _.reduce(map, function (prev, pkg) {
  
      // Resolve using last priority. Priority:
      // 1. package is a file
      // 2. package granularity (done by file depth)
      if (pkg.regexp.test(match) && (!prev || (pkg.dir && prev.dir && pkg.depth >= pkg.depth) || pkg.file)) {
        return pkg;
      } else {
        return prev;
      }
  
    }, null);
  }
docs: Try and find a package for the match