{"size": 922, "ext": "js", "max_stars_repo_path": "src/models/disaster.js", "max_stars_repo_name": "18F/dspan-registration", "max_stars_repo_stars_event_min_datetime": "2019-04-03T20:24:28.000Z", "max_stars_repo_stars_event_max_datetime": "2020-06-29T05:56:41.000Z", "max_issues_repo_path": "src/models/disaster.js", "max_issues_repo_name": "18F/dspan-registration", "max_issues_repo_issues_event_min_datetime": "2018-12-12T19:32:36.000Z", "max_issues_repo_issues_event_max_datetime": "2020-01-10T18:57:44.000Z", "max_forks_repo_path": "src/models/disaster.js", "max_forks_repo_name": "18F/dspan-registration", "max_forks_repo_forks_event_min_datetime": "2021-02-14T09:41:43.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-14T09:41:43.000Z"}
{"max_stars_count": 3, "max_issues_count": 8, "max_forks_count": 1, "avg_line_length": 36.88, "max_line_length": 97, "alphanum_fraction": 0.7472885033}
import moment from 'moment';

export const getDisaster = (disasters, index) => disasters.data[index] || {};
export const getState = disaster => disaster.state;
export const getDisasters = disasters => Object.values(disasters.data);
export const getBeginDate = disaster => moment(disaster.benefit_begin_date).format('MM/DD/YYYY');
export const getEndDate = disaster => moment(disaster.benefit_end_date).format('MM/DD/YYYY');
export const getCounties = (disasters, index, periodIndex) => {
  const benefitsPeriod = getDisaster(disasters, index).application_periods;
  let defaultValue = []

  if (!benefitsPeriod || !benefitsPeriod.length) {
    return defaultValue;
  }

  const applicationPeriodData = benefitsPeriod[periodIndex];

  return (applicationPeriodData && applicationPeriodData.counties) || defaultValue;
};
export const getStateForDisaster = disaster => disaster.state;

export default () => ({
  data: []
});
