import { ProductSearchFilterResponseAttributes } from '@spiffy-ai/commerce-api-client';

export const isApiProductSearchFilterResponseAttributes = (
  attributes: unknown,
): attributes is ProductSearchFilterResponseAttributes => {
  if (attributes == null || typeof attributes !== 'object') {
    return false;
  }

  if ('filter_name' in attributes && typeof attributes.filter_name !== 'string') {
    return false;
  }

  return true;
};
