{"size": 312, "ext": "js", "max_stars_repo_path": "src/transformers/field.js", "max_stars_repo_name": "Rossalli/logtunnel", "max_stars_repo_stars_event_min_datetime": "2021-09-10T12:06:15.000Z", "max_stars_repo_stars_event_max_datetime": "2021-10-29T22:04:49.000Z", "max_issues_repo_path": "src/transformers/field.js", "max_issues_repo_name": "Rossalli/logtunnel", "max_issues_repo_issues_event_min_datetime": "2021-10-29T21:26:14.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-29T21:26:14.000Z", "max_forks_repo_path": "src/transformers/field.js", "max_forks_repo_name": "Rossalli/logtunnel", "max_forks_repo_forks_event_min_datetime": "2021-10-29T20:30:19.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-29T20:30:19.000Z"}
{"max_stars_count": 6, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 26.0, "max_line_length": 95, "alphanum_fraction": 0.6153846154}
const vm = require('vm');

module.exports = filter =>  line => {
    if(typeof line !== 'object') {
        throw new Error("To use a field filter, you need to specify a parser like '-p json' ");
    }

    vm.createContext(line);
    const result = vm.runInContext(filter, line);
    return Boolean(result);
};
