code: function filterJson(query, data) {
    let newData = data;
  
    if ('summary' in query) {
      newData = _(data).reduce((memo, layer) => {
        memo[layer.name] = {
          features: layer.features.length,
          jsonsize: JSON.stringify(layer).length,
        };
        return memo;
      }, {});
    } else if ('nogeo' in query) {
      // Recursively remove all "geometry" fields, replacing them with geometry's size
      const filter = (val, key) => {
        if (key === 'geometry') {
          return val.length;
        } else if (_.isArray(val)) {
          return _.map(val, filter);
        } else if (_.isObject(val)) {
          _.each(val, (v, k) => {
            val[k] = filter(v, k);
          });
        }
        return val;
      };
      newData = _.map(data, filter);
    }
    return newData;
  }
docs: /* eslint no-param-reassign: ["error", {props: true,
  ignorePropertyModificationsFor: ["val", "memo"]}]