function filter(results) {
  const includeFilter = argv.filter ? new RegExp(argv.filter, 'i') : null;

  return results.filter(result => {
    if (includeFilter && !includeFilter.test(result.key)) {
      return false;
    }

    for (const propName of Object.keys(result)) {
      if (reportExcludeRegex && reportExcludeRegex.test(propName)) {
        // @ts-expect-error: propName is a key.
        delete result[propName];
      }
    }

    return true;
  });
}
@param {Array<{key: string, name: string}>} results