{"size": 1185, "ext": "js", "max_stars_repo_path": "ext/classic/classic/src/grid/property/Reader.js", "max_stars_repo_name": "sys0pp/c5", "max_stars_repo_stars_event_min_datetime": "2015-04-30T07:13:41.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-08T10:31:57.000Z", "max_issues_repo_path": "ext/classic/classic/src/grid/property/Reader.js", "max_issues_repo_name": "sys0pp/c5", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "ext/classic/classic/src/grid/property/Reader.js", "max_forks_repo_name": "sys0pp/c5", "max_forks_repo_forks_event_min_datetime": "2017-05-28T08:56:40.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-06T02:06:26.000Z"}
{"max_stars_count": 20, "max_issues_count": null, "max_forks_count": 7, "avg_line_length": 26.9318181818, "max_line_length": 72, "alphanum_fraction": 0.4886075949}
/**
 * @private
 * Custom reader for property grid data
 */
Ext.define('Ext.grid.property.Reader', {
    extend: 'Ext.data.reader.Reader',

    successProperty: null,
    totalProperty: null,
    messageProperty: null,

    read: function(dataObject) {
        return this.readRecords(dataObject);
    },

    readRecords: function(dataObject) {
        var Model = this.getModel(),
            result = {
                records: [],
                success: true
            }, val, propName;

        for (propName in dataObject) {
            if (dataObject.hasOwnProperty(propName)) {
                val = dataObject[propName];
                if (this.isEditableValue(val)) {
                    result.records.push(new Model({
                        name: propName,
                        value: val
                    }));
                }
            }
        }
        result.total = result.count = result.records.length;
        return new Ext.data.ResultSet(result);
    },

    /**
     * @private
     */
    isEditableValue: function(val){
        return Ext.isPrimitive(val) || Ext.isDate(val) || val === null;
    }
});