<commit_before>"use strict";

angular.module('es.logongas.ix3').run(['richDomain', 'langUtil', function (richDomain, langUtil) {



        function getValueDescription(value) {
            if (value) {
                if (angular.isArray(this.values)) {
                    var description = undefined;
                    var values = this.values;
                    if (this.type === "OBJECT") {
                        for (var i = 0; i < values.length; i++) {
                            if (values[i][this.primaryKeyPropertyName] === value) {
                                description = values[i].toString();
                                break;
                            }
                        }
                    } else {
                        for (var i = 0; i < values.length; i++) {
                            if (values[i].key === value) {
                                description = values[i].description;
                                break;
                            }
                        }
                    }

                    if (typeof (description) === "undefined") {
                        return value;
                    } else {
                        return description;
                    }
                } else {
                    return value;
                }
            } else {
                return value;
            }
        }


        richDomain.addEntityTransformer("Property", function (className, object) {
            object['getValueDescription'] = getValueDescription;<commit_msg>Permitir en una propiedad que se puedan buscar "sub" propeidades anidadas en vez de justo la que poseen Es decir dad auna propiedad obtener "a.b.c"<commit_after>"use strict";

angular.module('es.logongas.ix3').run(['richDomain', 'langUtil', function (richDomain, langUtil) {



        function getValueDescription(value) {
            if (value) {
                if (angular.isArray(this.values)) {
                    var description = undefined;
                    var values = this.values;
                    if (this.type === "OBJECT") {
                        for (var i = 0; i < values.length; i++) {
                            if (values[i][this.primaryKeyPropertyName] === value) {
                                description = values[i].toString();
                                break;
                            }
                        }
                    } else {
                        for (var i = 0; i < values.length; i++) {
                            if (values[i].key === value) {
                                description = values[i].description;
                                break;
                            }
                        }
                    }

                    if (typeof (description) === "undefined") {
                        return value;
                    } else {
                        return description;
                    }
                } else {
                    return value;
                }
            } else {
                return value;
            }
        }
        
        //Obtener los metadatos de una propiedad
        function getMetadataProperty(propertyName) {
            propertyName = propertyName || "";
            if (propertyName.indexOf(",") >= 0) {
                throw new Error("No se permiten comas en el nombre de la propiedad");
            }

            var keys = langUtil.splitValues(propertyName, ".");
            var current = this;
            for (var i = 0; i < keys.length; i++) {
                current = current.properties[keys[i]];

                if (current === undefined) {
                    break;
                }
            }
            if (current === undefined) {
                return null;
            } else {
                return current;
            }
        }


        richDomain.addEntityTransformer("Property", function (className, object) {
            object['getValueDescription'] = getValueDescription;
            object['getMetadataProperty'] = getMetadataProperty;
{'fraction_non_alphanumeric': 0.09655340992422391, 'fraction_numerical': 0.001955512099731117, 'mean_word_length': 0.9864077669902913, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 4, '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': '973483', 'n_tokens_mistral': 944, 'n_tokens_neox': 870, 'n_words': 217}