<commit_before>import { snakeCase } from 'lodash';
import constants from 'vets-json-schema/dist/constants.json';
import URLSearchParams from 'url-search-params';
import { useLocation } from 'react-router-dom';
import { SMALL_SCREEN_WIDTH } from '../constants';

export const formatNumber = value => {
  const str = (+value).toString();
  return `${str.replace(/\d(?=(\d{3})+$)/g, '$&,')}`;
};

export const formatCurrency = value => {
  if (isNaN(value)) {
    return value;
  }
  return `$${formatNumber(Math.round(+value))}`;
};

export const isVetTecSelected = filters => filters.category === 'vettec';

export const addAllOption = options => [
  { value: 'ALL', label: 'ALL' },
  ...options,
];

export const createId = name => name?.toLowerCase().replace(/\s/g, '-');

export const isCountryUSA = country => country.toUpperCase() === 'USA';
export const isCountryInternational = country => !isCountryUSA(country);

export const locationInfo = (city, state, country) => {
  let address = '';<commit_msg>added a null check to country in helpers (#16714)<commit_after>import { snakeCase } from 'lodash';
import constants from 'vets-json-schema/dist/constants.json';
import URLSearchParams from 'url-search-params';
import { useLocation } from 'react-router-dom';
import { SMALL_SCREEN_WIDTH } from '../constants';

export const formatNumber = value => {
  const str = (+value).toString();
  return `${str.replace(/\d(?=(\d{3})+$)/g, '$&,')}`;
};

export const formatCurrency = value => {
  if (isNaN(value)) {
    return value;
  }
  return `$${formatNumber(Math.round(+value))}`;
};

export const isVetTecSelected = filters => filters.category === 'vettec';

export const addAllOption = options => [
  { value: 'ALL', label: 'ALL' },
  ...options,
];

export const createId = name => name?.toLowerCase().replace(/\s/g, '-');
export const isCountryUSA = country => country?.toUpperCase() === 'USA';
export const isCountryInternational = country => !isCountryUSA(country);

export const locationInfo = (city, state, country) => {
  let address = '';
{'fraction_non_alphanumeric': 0.18146341463414634, 'fraction_numerical': 0.0034146341463414634, 'mean_word_length': 4.76123595505618, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5378837', 'n_tokens_mistral': 642, 'n_tokens_neox': 636, 'n_words': 164}