{"size": 402, "ext": "js", "max_stars_repo_path": "src/utils/common.js", "max_stars_repo_name": "wteja/gatsby-blog-starter", "max_stars_repo_stars_event_min_datetime": "2021-07-07T14:22:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-07T14:22:24.000Z", "max_issues_repo_path": "src/utils/common.js", "max_issues_repo_name": "wteja/gatsby-blog-starter", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/utils/common.js", "max_forks_repo_name": "wteja/gatsby-blog-starter", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.125, "max_line_length": 73, "alphanum_fraction": 0.684079602}
const moment = require('moment');

const getPrettyName = name => name.replace(/\W+/g, '-').toLowerCase();

const getArchiveAuthorUrl = author => `/author/${getPrettyName(author)}`;

const getArchiveMonthUrl = date => {
    const dateMoment = moment(date);
    return `/archive/${dateMoment.format("YYYY/MM")}`;
}

module.exports = {
    getPrettyName,
    getArchiveAuthorUrl,
    getArchiveMonthUrl
};