{"size": 493, "ext": "js", "max_stars_repo_path": "lib/parsers/headerParser.js", "max_stars_repo_name": "Cyberitas/ScrewturnToMediawiki", "max_stars_repo_stars_event_min_datetime": "2016-04-26T17:55:24.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-02T22:38:02.000Z", "max_issues_repo_path": "lib/parsers/headerParser.js", "max_issues_repo_name": "Cyberitas/ScrewturnToMediawiki", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/parsers/headerParser.js", "max_forks_repo_name": "Cyberitas/ScrewturnToMediawiki", "max_forks_repo_forks_event_min_datetime": "2022-03-22T04:41:24.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-22T04:41:24.000Z"}
{"max_stars_count": 5, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 37.9230769231, "max_line_length": 70, "alphanum_fraction": 0.7322515213}
var stripLineEndings = require('../utils/StrUtil.js').stripLineEndings
  , revisionDataParser = require('./revisionDataParser.js')
  , ScrewTurnHeader = require('../model/ScrewTurnHeader.js')

function headerParser(data, context) {
    var firstEOL = data.indexOf('\n')
      , title = stripLineEndings(data.substr(0, firstEOL))
      , revisionData = revisionDataParser(data.substr(firstEOL + 1))

    context.header = new ScrewTurnHeader(title, revisionData)
}

module.exports = headerParser