{"size": 619, "ext": "js", "max_stars_repo_path": "build/bundle/es.js", "max_stars_repo_name": "demiazz/homey", "max_stars_repo_stars_event_min_datetime": "2017-07-10T10:48:45.000Z", "max_stars_repo_stars_event_max_datetime": "2017-09-03T19:18:22.000Z", "max_issues_repo_path": "build/bundle/es.js", "max_issues_repo_name": "demiazz/homey", "max_issues_repo_issues_event_min_datetime": "2017-05-06T09:07:24.000Z", "max_issues_repo_issues_event_max_datetime": "2017-07-28T16:08:48.000Z", "max_forks_repo_path": "build/bundle/es.js", "max_forks_repo_name": "demiazz/homey", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 13, "max_forks_count": null, "avg_line_length": 26.9130434783, "max_line_length": 50, "alphanum_fraction": 0.5961227787}
const { writeFileSync } = require("fs");
const { dirname } = require("path");
const { sync: makeDirectory } = require("mkdirp");
const banner = require("./banner");
const { prettify } = require("./prettify");
const sources = require("./sources");

function build() {
  Object.keys(sources).forEach(file => {
    const dest = `${file}.flow`;
    const code = prettify(sources[file])
      .replace(/\/\* @flow \*\/\n/, "")
      .replace(/\/\* eslint[^*]* \*\/\n/, "");
    const bannered = `${banner.flow}${code}`;

    makeDirectory(dirname(dest));

    writeFileSync(dest, bannered);
  });
}

module.exports = build;
