# all files / keystone/lib/list/ addFiltersToQuery.js

20% Statements 2/10
0% Branches 0/6
0% Functions 0/2
22.22% Lines 2/9

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    131×

    1×
     function addFiltersToQuery (filters, query) {
    	var fields = Object.keys(this.fields);
    	query = query || {};
    	fields.forEach(function (path) {
    		var field = this.fields[path];
    		if (!field.addFilterToQuery || !filters[field.path]) return;
    		field.addFilterToQuery(filters[field.path], query);
    	}, this);
    	return query;
    }

    module.exports = addFiltersToQuery;