/**
 * Shared issue counting utility for validators
 *
 * Consolidates duplicate implementations from:
 * - blazor-validator.js
 * - blazor-state-validator.js
 * - blazor-concurrency-analyzer.js
 *
 * @param {Array} issues - Array of validation issues with type property
 * @returns {{errors: number, warnings: number, infos: number}} Count by type
 */
export function countIssues(issues) {
  return {
    errors: issues.filter((i) => i.type === 'error').length,
    warnings: issues.filter((i) => i.type === 'warning').length,
    infos: issues.filter((i) => i.type === 'info').length,
  };
}
