{"size": 658, "ext": "js", "max_stars_repo_path": "src/io/json.js", "max_stars_repo_name": "kikuchiken-waseda/mri-vuewer.ver2", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/io/json.js", "max_issues_repo_name": "kikuchiken-waseda/mri-vuewer.ver2", "max_issues_repo_issues_event_min_datetime": "2020-09-19T05:42:39.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-28T09:54:57.000Z", "max_forks_repo_path": "src/io/json.js", "max_forks_repo_name": "kikuchiken-waseda/mri-vuewer.ver2", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 44, "max_forks_count": null, "avg_line_length": 24.3703703704, "max_line_length": 62, "alphanum_fraction": 0.5425531915}
export default {
  read: file => {
    return new Promise((resolve, reject) => {
      const fr = new FileReader();
      fr.onloadend = event => {
        const content = event.target.result;
        resolve(JSON.parse(content));
      };
      fr.onerror = error => reject(error);
      fr.readAsText(file);
    });
  },
  toBlob: obj => {
    return new Blob([JSON.stringify(obj, null, "  ")], {
      type: "application/json"
    });
  },
  toFile: (name, obj) => {
    const blob = new Blob([JSON.stringify(obj, null, "  ")], {
      type: "application/json"
    });
    blob.name = name;
    blob.lastModifiedDate = new Date();
    return blob;
  }
};
