{"size": 643, "ext": "js", "max_stars_repo_path": "tests/JavaScript/test-file.js", "max_stars_repo_name": "Thom1729/SublimeSyntaxParser", "max_stars_repo_stars_event_min_datetime": "2018-05-27T13:48:00.000Z", "max_stars_repo_stars_event_max_datetime": "2019-04-29T13:26:02.000Z", "max_issues_repo_path": "tests/JavaScript/test-file.js", "max_issues_repo_name": "Thom1729/SublimeSyntaxParser", "max_issues_repo_issues_event_min_datetime": "2019-08-21T13:11:41.000Z", "max_issues_repo_issues_event_max_datetime": "2019-08-21T14:30:35.000Z", "max_forks_repo_path": "tests/JavaScript/test-file.js", "max_forks_repo_name": "Thom1729/SublimeSyntaxParser", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 19.4848484848, "max_line_length": 85, "alphanum_fraction": 0.5209953344}
/foo/;

// Hello? //

function recMap(obj, callback) {
    const ret = {};
    const stack = new Set();

    function recurse(key, value) {
        if (! ret.hasOwnProperty(key)) {
            if (stack.has(key)) throw new Error(`Infinite recursion on key ${key}.`);
            stack.add(key);
            if (value === undefined) value = obj[key];
            ret[key] = callback(key, value, recurse);
            stack.delete(key);
        }
        return ret[key]
    }

    for (const key of Object.keys(obj)) {
        recurse(key);
    }

    return ret;
}

module.exports = {
    objFromPairs,
    objMap,
    flatMap,
    recMap,
};
