<commit_before>'use strict';

const path = require('path'),
  flatten = require('../../support/flattenMessage'),
  filterRegistry = require('../../support/filterRegistry');

module.exports = {
  name() {
    return path.basename(__dirname);
  },
  open(context, options) {
    this.options = options;
    this.metrics = {};
    this.storageManager = context.storageManager;
  },
  postOpen() {
    if (this.options.metrics && this.options.metrics.filter) {

      for (let metric of this.options.metrics.filter) {
        // for all filters
        // cleaning all filters means (right now) that all
        // metrics are sent
        if (metric === '*+') {<commit_msg>bugfix if we only get one entry in the filter list<commit_after>'use strict';

const path = require('path'),
  flatten = require('../../support/flattenMessage'),
  filterRegistry = require('../../support/filterRegistry');

module.exports = {
  name() {
    return path.basename(__dirname);
  },
  open(context, options) {
    this.options = options;
    this.metrics = {};
    this.storageManager = context.storageManager;
  },
  postOpen() {
    if (this.options.metrics && this.options.metrics.filter) {

      const filters = Array.isArray(this.options.metrics.filter) ? this.options.metrics.filter : [this.options.metrics.filter];

      for (let metric of filters) {
        // for all filters
        // cleaning all filters means (right now) that all
        // metrics are sent
        if (metric === '*+') {
{'fraction_non_alphanumeric': 0.15141318977119786, 'fraction_numerical': 0.0, 'mean_word_length': 2.862337662337662, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3599730', 'n_tokens_mistral': 420, 'n_tokens_neox': 415, 'n_words': 105}