"use strict";
var _ = require('underscore'),
format = require('util').format,
utils = require('./filterObjectUtils'),
config = require('./config');
module.exports = function(displayFilters, restrictFeatureFilters, displayPlotsOnly) {
var featureTypes, inClause,
plotFilters = ['Tree', 'Plot', 'EmptyPlot'],
defaultPlotFilter = ['Plot'];
if ( ! _.isBoolean(displayPlotsOnly)) {
throw new Error('`displayPlotsOnly must be a boolean value.');
}
if (displayPlotsOnly) {
if (_.isArray(displayFilters) && displayFilters.length > 0) {
displayFilters = _.intersection(displayFilters, plotFilters);
} else {
displayFilters = defaultPlotFilter;
}
}
if (_.isArray(displayFilters)) {
displayFilters = _.intersection(
displayFilters,
_.union(restrictFeatureFilters || [], plotFilters));
} else {
displayFilters = _.union(restrictFeatureFilters || [], defaultPlotFilter);
}
if (_.isEmpty(displayFilters)) {