<commit_before>'use strict';

//Pasive data structure decorator
//Strips unrelevant data from entity before sending it to server
angular.module('mean.icu').config(function($provide) {
    var passiveDataSrtuctureDecorator = function($delegate) {
        var normalize = function(data) {
            if (!data) {
                return;
            }

            var keys = Object.keys(data);
            for (var i = 0; i < keys.length; i+=1) {
                var property = data[keys[i]];

                if (property && property._id) {
                    data[keys[i]] = property._id;
                } else if (property instanceof Array) {
                    normalize(property);
                }
            }
        };<commit_msg>Fix whitespaces in titles<commit_after>'use strict';

//Pasive data structure decorator
//Strips unrelevant data from entity before sending it to server
angular.module('mean.icu').config(function($provide) {
    var passiveDataSrtuctureDecorator = function($delegate) {
        var normalize = function(data) {
            if (!data) {
                return;
            }

            var keys = Object.keys(data);
            for (var i = 0; i < keys.length; i+=1) {
                var property = data[keys[i]];

                if (keys[i] === 'title') {
                    data[keys[i]] = property.trim();
                }

                if (property && property._id) {
                    data[keys[i]] = property._id;
                } else if (property instanceof Array) {
                    normalize(property);
                }
            }
        };
{'fraction_non_alphanumeric': 0.11421477343265053, 'fraction_numerical': 0.002482929857231533, 'mean_word_length': 1.5466034755134281, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2273299', 'n_tokens_mistral': 438, 'n_tokens_neox': 407, 'n_words': 108}