{"size": 385, "ext": "js", "max_stars_repo_path": "src/utils/storage.js", "max_stars_repo_name": "alef-garrido/myToDoList", "max_stars_repo_stars_event_min_datetime": "2021-08-28T19:08:45.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-28T19:08:45.000Z", "max_issues_repo_path": "src/utils/storage.js", "max_issues_repo_name": "alef-garrido/myToDoList", "max_issues_repo_issues_event_min_datetime": "2021-08-29T03:34:33.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-01T06:32:27.000Z", "max_forks_repo_path": "src/utils/storage.js", "max_forks_repo_name": "alef-garrido/myToDoList", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 21.3888888889, "max_line_length": 59, "alphanum_fraction": 0.6285714286}
/* eslint-disable max-classes-per-file */

export default class Storage {
  static saveToStorage(arr) {
    localStorage.setItem('todoList', JSON.stringify(arr));
  }

  static getFromStorage() {
    let tasks;
    if (localStorage.getItem('todoList') === null) {
      tasks = [];
    } else {
      tasks = JSON.parse(localStorage.getItem('todoList'));
    }
    return tasks;
  }
}
