<commit_before>var _ = require('lodash');

function Collection() {
    this.data = {};
}
_.extend(Collection.prototype, {
    add: function (item) {
        item.id = this.nextId;
        item.collection = this;
        this.data[this.nextId] = item;
        this.nextId++;
    },
    data: null,
    each: function (callback) {
        return _.each(this.data, callback);
    },
    nextId: 0,
    remove: function (item) {
        delete this.data[item.id];
    },
});

module.exports = Collection;<commit_msg>Change collection to es6 class<commit_after>let _ = require('lodash');

class Collection {
    constructor() {
        this.data = {};
        this.nextId = 0;
    }

    add(item) {
        item.id = this.nextId;
        item.collection = this;
        this.data[this.nextId] = item;
        this.nextId++;
    }

    each(callback) {
        return _.each(this.data, callback);
    }

    remove(item) {
        delete this.data[item.id];
    }
}

module.exports = Collection;
{'fraction_non_alphanumeric': 0.14646464646464646, 'fraction_numerical': 0.0030303030303030303, 'mean_word_length': 2.176282051282051, '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': '4641865', 'n_tokens_mistral': 323, 'n_tokens_neox': 314, 'n_words': 61}