<commit_before>"use strict";

var Serializer = require('./Serializer'),
    inherits = require('inherits'),
    _ = require('underscore');

var Gson = function () {
    var typeAdapters = [],
        typeInstances = [];

    this.registerTypeAdapter = function (Model) {
        if (_.isArray(Model))
            typeAdapters = _.union(typeAdapters, Model);
        else if (!_.contains(typeAdapters, Model))
            typeAdapters.push(Model);
        mapInstanceItems();
    };

    var mapInstanceItems = function () {
        typeInstances = typeAdapters.map(function (Item) {
            return new Item();
        });<commit_msg>Add array of typeAdapters in constructor of gson<commit_after>"use strict";

var Serializer = require('./Serializer'),
    inherits = require('inherits'),
    _ = require('underscore');

var Gson = function (_typeAdapters) {
    var typeAdapters = [],
        typeInstances = [];

    if (_typeAdapters)
        _.each(_typeAdapters, this.registerTypeAdapter);

    this.registerTypeAdapter = function (Model) {
        if (_.isArray(Model))
            typeAdapters = _.union(typeAdapters, Model);
        else if (!_.contains(typeAdapters, Model))
            typeAdapters.push(Model);
        mapInstanceItems();
    };

    var mapInstanceItems = function () {
        typeInstances = typeAdapters.map(function (Item) {
            return new Item();
        });
{'fraction_non_alphanumeric': 0.12829650748396293, 'fraction_numerical': 0.0, 'mean_word_length': 2.6850393700787403, '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': '4688816', 'n_tokens_mistral': 401, 'n_tokens_neox': 379, 'n_words': 86}