<commit_before>'use strict';

var mongoose = require('mongoose'),
    Schema = mongoose.Schema,
    utils = requires('../utils'),
    defaultSelection = 'member updateTime';

var DashboardSchema = new Schema({
    memberData: {type: String},
    inventoryData: {type: String},
    createTime: { type: Date},
    updateTime: { type: Date}
});


DashboardSchema.path('memberData').validate(function (memberString) {
    return utils.isJson(memberString);
}, 'Invalid JSON string');

DashboardSchema.path('inventoryData').validate(function (inventoryString) {
    return utils.isJson(inventoryString);
}, 'Invalid JSON string');


DashboardSchema.pre('validate', function(next) {
    var currentTime = new Date();
    if (this.isNew){
        this.createTime = currentTime;
        this.updateTime = currentTime;
    } else {
        this.updateTime = currentTime;
    }
    next();
});<commit_msg>fix spell err<commit_after>'use strict';

var mongoose = require('mongoose'),
    Schema = mongoose.Schema,
    utils = require('../utils'),
    defaultSelection = 'member updateTime';

var DashboardSchema = new Schema({
    memberData: {type: String},
    inventoryData: {type: String},
    createTime: { type: Date},
    updateTime: { type: Date}
});


DashboardSchema.path('memberData').validate(function (memberString) {
    return utils.isJson(memberString);
}, 'Invalid JSON string');

DashboardSchema.path('inventoryData').validate(function (inventoryString) {
    return utils.isJson(inventoryString);
}, 'Invalid JSON string');


DashboardSchema.pre('validate', function(next) {
    var currentTime = new Date();
    if (this.isNew){
        this.createTime = currentTime;
        this.updateTime = currentTime;
    } else {
        this.updateTime = currentTime;
    }
    next();
});
{'fraction_non_alphanumeric': 0.14197875908328675, 'fraction_numerical': 0.0, 'mean_word_length': 3.931129476584022, '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': '5882778', 'n_tokens_mistral': 519, 'n_tokens_neox': 532, 'n_words': 118}