lib/io.js
function resolveDirMatches(directory, match) {
  if (validateDirectorySync(directory)) {
    return fs.readdirSync(directory)
      .filter(function eachDirectoryItem(item) {
        var resolved = path.resolve(path.join(directory, item));
        return match.test(item) && fs.statSync(resolved).isDirectory();
      })
      .sort(compareHigher);
  } else {
    return [];
  }
}
function resolveDirMatches(directory, match) {
  if (validateDirectorySync(directory)) {
    return fs.readdirSync(directory)
      .filter(function eachDirectoryItem(item) {
        var resolved = path.resolve(path.join(directory, item));
        return match.test(item) && fs.statSync(resolved).isDirectory();
      })
      .sort(compareHigher);
  } else {
    return [];
  }
}
For a given directory find all files that match, the result will be sorted with highest numeric index first.
@param directory
@param match
@returns {T[]}