<commit_before>'use strict';

// derivative-model.js - A just a generic object literal model
const validator = require('validator');

const derivativeModel = {
    name: {
        type: String,
        required: true,
        prop: data => data.name,
        validator: [
            {
                validate: data => !validator.isNull(data.name),
                message: "Name cannot be empty."
            }
        ]
    },
    age: {
        type: Number,
        required: false,
        min: 0,
        prop: data => data.age,
        validator: [
            {
                validate: data => Number.isSafeInteger(data.age),
                message: "Age must be a valid integer."
            },
            {
                validate: data => data.age >= derivativeModel.age.min,
                message: "Age must not be negative."
            }
        ]
    }
};

module.exports = derivativeModel;<commit_msg>Added icon & full to derivative model.<commit_after>'use strict';

// derivative-model.js - A just a generic object literal model
const validator = require('validator');

const Picture = require('../picture/picture-model');

const derivativeModel = {
    name: {
        type: String,
        required: true,
        prop: data => data.name,
        validator: [
            {
                validate: data => !validator.isNull(data.name),
                message: "Name cannot be empty."
            }
        ]
    },
    icon: {
        type: Picture,
        required: false,
        prop: data => data.icon
    },
    full: {
        type: Picture,
        required: false,
        prop: data => data.full
    },
    age: {
        type: Number,
        required: false,
        min: 0,
        prop: data => data.age,
        validator: [
            {
                validate: data => Number.isSafeInteger(data.age),
                message: "Age must be a valid integer."
            },
            {
                validate: data => data.age >= derivativeModel.age.min,
                message: "Age must not be negative."
            }
        ]
    }
};

module.exports = derivativeModel;
{'fraction_non_alphanumeric': 0.11330512458862248, 'fraction_numerical': 0.0009402914903620122, 'mean_word_length': 1.434782608695652, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '7310233', 'n_tokens_mistral': 573, 'n_tokens_neox': 557, 'n_words': 155}