<commit_before>/*global require, define, module

*/
(function (factory) {
    "use strict";

    var env = factory.env,
        def = factory.def,
        deps = {
            amd: ['./modelo.js'],
            node: ['./modelo.js'],
            browser: ['Modelo']
        };

    def.call(this, 'Modelo/Property', deps[env], function (Modelo) {

        var Property, PropertyObject;

        PropertyObject = new Modelo(function (options) {
            this.value = options.value || undefined;
        });

        PropertyObject.prototype.get = function () {
            return this.value;
        };

        PropertyObject.prototype.set = function (val) {
            this.value = val;
        };

        Property = function () {

            var args = Array.prototype.slice.call(arguments),
                type = "undefined",
                typeValidator,
                Prop;

            if (args.length > 0 && typeof args[0] === "string") {
                type = args.shift();
            }

            switch (type) {

            case "undefined":
                typeValidator = function (value) {
                    return true;
                };
                break;

            case "string":
                typeValidator = function (value) {
                    return {
                        valid: typeof value === "string" ||
                                value === null ||
                                isNaN(value),
                        message: "Value must be a string."
                    };
                };
                break;

            case "number":
                typeValidator = function (value) {
                    return {
                        valid: typeof value === "number" ||
                                value === null ||
                                isNaN(value),
                        message: "Value must be a number."
                    };
                };
                break;

            case "boolean":
                typeValidator = function (value) {
                    return {
                        valid: typeof value === "boolean" ||
                                value === null ||
                                isNaN(value),
                        message: "Value must be a boolean."
                    };
                };
                break;
            }

            args.splice(0, 0, typeValidator);

            Prop = new PropertyObject();

            return function (val) {

                var x, result;

                if (val === undefined) {
                    return Prop.get();
                }
                console.log(args);
                console.log(type);
                for (x = 0; x < args.length; x = x + 1) {

                    result = args[x](val);

                    if (result === undefined) {

                        throw new Error("Validation function did not return a value.");

                    }

                    if (result === false) {

                        throw new Error("Property validation failed for value: " + val);

                    }

                    if (result.valid === false) {

                        throw new Error(result.message);

                    }
<commit_msg>Remove: Left over console statements<commit_after>/*global require, define, module

*/
(function (factory) {
    "use strict";

    var env = factory.env,
        def = factory.def,
        deps = {
            amd: ['./modelo.js'],
            node: ['./modelo.js'],
            browser: ['Modelo']
        };

    def.call(this, 'Modelo/Property', deps[env], function (Modelo) {

        var Property, PropertyObject;

        PropertyObject = new Modelo(function (options) {
            this.value = options.value || undefined;
        });

        PropertyObject.prototype.get = function () {
            return this.value;
        };

        PropertyObject.prototype.set = function (val) {
            this.value = val;
        };

        Property = function () {

            var args = Array.prototype.slice.call(arguments),
                type = "undefined",
                typeValidator,
                Prop;

            if (args.length > 0 && typeof args[0] === "string") {
                type = args.shift();
            }

            switch (type) {

            case "undefined":
                typeValidator = function (value) {
                    return true;
                };
                break;

            case "string":
                typeValidator = function (value) {
                    return {
                        valid: typeof value === "string" ||
                                value === null ||
                                isNaN(value),
                        message: "Value must be a string."
                    };
                };
                break;

            case "number":
                typeValidator = function (value) {
                    return {
                        valid: typeof value === "number" ||
                                value === null ||
                                isNaN(value),
                        message: "Value must be a number."
                    };
                };
                break;

            case "boolean":
                typeValidator = function (value) {
                    return {
                        valid: typeof value === "boolean" ||
                                value === null ||
                                isNaN(value),
                        message: "Value must be a boolean."
                    };
                };
                break;
            }

            args.splice(0, 0, typeValidator);

            Prop = new PropertyObject();

            return function (val) {

                var x, result;

                if (val === undefined) {
                    return Prop.get();
                }

                for (x = 0; x < args.length; x = x + 1) {

                    result = args[x](val);

                    if (result === undefined) {

                        throw new Error("Validation function did not return a value.");

                    }

                    if (result === false) {

                        throw new Error("Property validation failed for value: " + val);

                    }

                    if (result.valid === false) {

                        throw new Error(result.message);

                    }

{'fraction_non_alphanumeric': 0.10348550277606416, 'fraction_numerical': 0.001850709438618137, 'mean_word_length': 0.9051116333725029, 'pattern_counts': {'":': 8, '<': 5, '<?xml version=': 0, '>': 5, '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': '7615342', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1365, 'n_words': 380}