function searchForEntries({ exts, cwd, exclude, name = '*' }) {
  debug(
    'search in %s with exts: %s, exclude: %s, name: %s',
    cwd,
    exts,
    exclude,
    name
  );
  const files = glob
    .sync(`@(${exts.map(ext => name + ext).join('|')})`, {
      cwd,
      ignore: exclude,
    })
    .sort(
      (a, b) => exts.indexOf(path.extname(a)) >= exts.indexOf(path.extname(b))
    );

  if (files && files[0]) {
    return files.map(file => path.join(cwd, file));
  }
  return null;
}
Search for entries
@param {Array} exts - extensions string array
@param {string} cwd - current working directory
@param {string} exclude - ignore directories
@param {string} name - entry name
@returns {(Array|null)} return absolute path of entries or null if not exist