{"size": 625, "ext": "js", "max_stars_repo_path": "warehouse/filter.js", "max_stars_repo_name": "etigerstudio/recordflow", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "warehouse/filter.js", "max_issues_repo_name": "etigerstudio/recordflow", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "warehouse/filter.js", "max_forks_repo_name": "etigerstudio/recordflow", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.8333333333, "max_line_length": 77, "alphanum_fraction": 0.504}

class Filter {
    static cut(records) {
        return records.map(rec => rec._id);
    }

    static all() {
        return rec => this.cut(rec);
    }

    static equal(name, value) {
        return rec => {
            return this.cut(rec.filter(rec => rec.retrieve(name) === value));
        }
    }

    static gt(name, value) {
        return rec => {
            return this.cut(rec.filter(rec => rec.retrieve(name) > value));
        }
    }

    static lt(name, value) {
        return rec => {
            return this.cut(rec.filter(rec => rec.retrieve(name) < value));
        }
    }
}

module.exports = Filter;