{"size": 1051, "ext": "js", "max_stars_repo_path": "config-example.js", "max_stars_repo_name": "hgoebl/mobile-usage", "max_stars_repo_stars_event_min_datetime": "2015-01-09T17:16:54.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-12T11:11:34.000Z", "max_issues_repo_path": "config-example.js", "max_issues_repo_name": "hgoebl/mobile-usage", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "config-example.js", "max_forks_repo_name": "hgoebl/mobile-usage", "max_forks_repo_forks_event_min_datetime": "2017-12-25T11:16:57.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-14T07:53:51.000Z"}
{"max_stars_count": 19, "max_issues_count": null, "max_forks_count": 3, "avg_line_length": 29.1944444444, "max_line_length": 99, "alphanum_fraction": 0.5718363463}
// Place paths to your implementations absolute or relative to the config-script

var defaultMapImpl = require("./lib/DefaultMapImpl.js"),
    NAGIOS_IPS = /^214\.96\.80\.23[01]$/;

module.exports = {

    filterRaw: function (hit) {
        // do not count requests from nagios monitoring
        if (NAGIOS_IPS.test(hit.ip)) {
            return false;
        }
        // do not count weird requests
        if (hit.userAgent === '-' && hit.referer === '-') {
            return false;
        }

        return true;
    },

    filterCooked: function (cooked) {
        // only count mobile devices which are Mobile Grade A
        return cooked.mobileGrade === 'A';
    },

    map: function (cooked, emit) {
        // a somewhat derived example to filter based on emitted objects (better use filterCooked!)
        defaultMapImpl(cooked, function (emittedObject) {
            if (emittedObject.mobileGrade && emittedObject.mobileGrade.A >= 1 ||
                true) {
                emit(emittedObject);
            }
        });
    }

};