function findAuditDetailItemsDiffs(auditId, baseItems, compareItems, headings) {
  /** @type {Array<LHCI.AuditDiff>} */
  const diffs = [];

  for (const {base, compare} of zipBaseAndCompareItems(baseItems, compareItems)) {
    if (base && compare) {
      diffs.push(...findAuditDetailItemKeyDiffs(auditId, base, compare, headings));
    } else if (compare) {
      diffs.push({type: 'itemAddition', auditId, compareItemIndex: compare.index});
    } else if (base) {
      diffs.push({type: 'itemRemoval', auditId, baseItemIndex: base.index});
    } else {
      throw new Error('Impossible');
    }
  }

  return diffs;
}
@param {string} auditId
@param {Array<Record<string, any>>} baseItems
@param {Array<Record<string, any>>} compareItems
@param {Array<{key: string | null}>} headings
@return {Array<LHCI.AuditDiff>}