{"size": 678, "ext": "js", "max_stars_repo_path": "client/src/services/operations.js", "max_stars_repo_name": "telegrambotdev/your_spotify", "max_stars_repo_stars_event_min_datetime": "2020-03-16T13:02:05.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-31T14:40:18.000Z", "max_issues_repo_path": "client/src/services/operations.js", "max_issues_repo_name": "telegrambotdev/your_spotify", "max_issues_repo_issues_event_min_datetime": "2020-03-17T01:12:43.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T07:26:23.000Z", "max_forks_repo_path": "client/src/services/operations.js", "max_forks_repo_name": "telegrambotdev/your_spotify", "max_forks_repo_forks_event_min_datetime": "2020-03-23T16:43:57.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-29T20:46:45.000Z"}
{"max_stars_count": 582, "max_issues_count": 103, "max_forks_count": 33, "avg_line_length": 26.0769230769, "max_line_length": 64, "alphanum_fraction": 0.616519174}
export const ratioValueAB = (oldValue, newValue) => {
  if (oldValue === newValue) return 0;
  if (oldValue === 0) return 100;
  if (newValue === 0) return -100;

  if (oldValue > newValue) {
    const diff = oldValue - newValue;
    return -(diff / oldValue) * 100;
  } if (oldValue < newValue) {
    const diff = newValue - oldValue;
    return (diff / newValue) * 100;
  }
  return 0;
};

export const msToHoursAndMinutesString = (ms) => {
  const hour = 1000 * 60 * 60;
  const hours = Math.floor(ms / hour);
  const minutes = Math.floor((ms - (hours * hour)) / 1000 / 60);
  return `${hours}:${minutes.toString().padStart(2, '0')}`;
};

export default {
  ratioValueAB,
};
