function getMatchingDiffsForIndex(diffs, compareItemIndex, baseItemIndex) {
  return diffs.filter(diff => {
    const compareIndex = 'compareItemIndex' in diff ? diff.compareItemIndex : undefined;
    const baseIndex = 'baseItemIndex' in diff ? diff.baseItemIndex : undefined;
    if (typeof compareIndex === 'number') return compareIndex === compareItemIndex;
    if (typeof baseIndex === 'number') return baseIndex === baseItemIndex;
    return false;
  });
}
@param {Array<LHCI.AuditDiff>} diffs
@param {number|undefined} compareItemIndex
@param {number|undefined} baseItemIndex
@return {Array<LHCI.AuditDiff>}