<commit_before>/*$AMPERSAND_VERSION*/
var View = require('ampersand-view');
var isFunction = require('lodash.isfunction');
var result = require('lodash.result');
var noop = function(){};

module.exports = View.extend({
    props: {
        'model': 'state',
        'rendered': {
            type: 'boolean',
            required: true,
            default: false
        }
    },
    derived: {
        data: {
            fn: function () {
                var res = {};
                for (var key in this._fieldViews) {
                    if (this._fieldViews.hasOwnProperty(key)) {
                        res[key] = this._fieldViews[key].value;
                    }
                }
                return this.clean(res);
            }
        },
        cache: false
    },
    initialize: function(opts) {
        opts = opts || {};
        this.el = opts.el;
        this.validCallback = opts.validCallback || this.validCallback || noop;
        this.submitCallback = opts.submitCallback || this.submitCallback || noop;
        this.clean = opts.clean || this.clean || function (res) { return res; };

        if (opts.model) this.model = opts.model;

        this.valid = false;
        this.preventDefault = opts.preventDefault === false ? false : true;
        this.autoAppend = opts.autoAppend === false ? false : true;

        // storage for our fields
        this._fieldViews = {};
        this._fieldViewsArray = [];
<commit_msg>remove redundant props<commit_after>/*$AMPERSAND_VERSION*/
var View = require('ampersand-view');
var isFunction = require('lodash.isfunction');
var result = require('lodash.result');
var noop = function(){};

module.exports = View.extend({
    derived: {
        data: {
            fn: function () {
                var res = {};
                for (var key in this._fieldViews) {
                    if (this._fieldViews.hasOwnProperty(key)) {
                        res[key] = this._fieldViews[key].value;
                    }
                }
                return this.clean(res);
            }
        },
        cache: false
    },
    initialize: function(opts) {
        opts = opts || {};
        this.el = opts.el;
        this.validCallback = opts.validCallback || this.validCallback || noop;
        this.submitCallback = opts.submitCallback || this.submitCallback || noop;
        this.clean = opts.clean || this.clean || function (res) { return res; };

        if (opts.model) this.model = opts.model;

        this.valid = false;
        this.preventDefault = opts.preventDefault === false ? false : true;
        this.autoAppend = opts.autoAppend === false ? false : true;

        // storage for our fields
        this._fieldViews = {};
        this._fieldViewsArray = [];

{'fraction_non_alphanumeric': 0.13095671153146599, 'fraction_numerical': 0.0, 'mean_word_length': 1.7862208713272543, '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': '6162926', 'n_tokens_mistral': 749, 'n_tokens_neox': 728, 'n_words': 166}