function filterAuditsByAvailableArtifacts(audits, availableArtifacts) {
  if (!audits) return null;

  const availableArtifactIds = new Set(
    availableArtifacts.map(artifact => artifact.id).concat(baseArtifactKeys)
  );
  return audits.filter(audit => {
    const meta = audit.implementation.meta;
    return meta.requiredArtifacts.every(id => availableArtifactIds.has(id));
  });
}
Filters an array of audits down to the set that can be computed using only the specified artifacts.

@param {LH.Config.ResolvedConfig['audits']} audits
@param {Array<LH.Config.AnyArtifactDefn>} availableArtifacts
@return {LH.Config.ResolvedConfig['audits']}