<commit_before>import { PropMetadata, PropMetadataSym, ModelPropertiesSym } from '../../metadata';
import * as sequelize from 'sequelize';
import 'reflect-metadata';

export function Prop(columnName?: PropMetadata | string) {
    let meta: PropMetadata;
    if (typeof columnName === 'string') meta = { columnName: columnName };
    else meta = columnName || {};
    
    return function(model: any, propertyName: string) {
        let props: string[] = Reflect.getOwnMetadata(ModelPropertiesSym, model) || [];
        props.push(propertyName);
        Reflect.defineMetadata(ModelPropertiesSym, props, model);
        
        if (!meta.type) {
            let reflectType = Reflect.getMetadata('design:type', model, propertyName);
            let sequelizeType: any = null;
            if (reflectType === String) sequelizeType = sequelize.STRING;
            else if (reflectType === Number) {
            if (meta.primaryKey || meta.autoIncrement) sequelizeType = sequelize.INTEGER;
            else sequelizeType = sequelize.FLOAT;
            }
            else if (reflectType === Date) sequelizeType = sequelize.DATE;
            else if (reflectType === Boolean) sequelizeType = sequelize.BOOLEAN;
            else throw new Error(`Could not infer column type for model property: ${propertyName}`);
            meta.type = sequelizeType;
        }
        Reflect.defineMetadata(PropMetadataSym, meta, model, propertyName);
    }
}<commit_msg>style(prop.decorator): fix whitespace problems in the Prop() decorator<commit_after>import { PropMetadata, PropMetadataSym, ModelPropertiesSym } from '../../metadata';
import * as sequelize from 'sequelize';
import 'reflect-metadata';

export function Prop(columnName?: PropMetadata | string) {
    let meta: PropMetadata;
    if (typeof columnName === 'string') meta = { columnName: columnName };
    else meta = columnName || {};
    
    return function(model: any, propertyName: string) {
        let props: string[] = Reflect.getOwnMetadata(ModelPropertiesSym, model) || [];
        props.push(propertyName);
        Reflect.defineMetadata(ModelPropertiesSym, props, model);
        
        if (!meta.type) {
            let reflectType = Reflect.getMetadata('design:type', model, propertyName);
            let sequelizeType: any = null;
            if (reflectType === String) sequelizeType = sequelize.STRING;
            else if (reflectType === Number) {
                if (meta.primaryKey || meta.autoIncrement) sequelizeType = sequelize.INTEGER;
                else sequelizeType = sequelize.FLOAT;
            }
            else if (reflectType === Date) sequelizeType = sequelize.DATE;
            else if (reflectType === Boolean) sequelizeType = sequelize.BOOLEAN;
            else throw new Error(`Could not infer column type for model property: ${propertyName}`);
            meta.type = sequelizeType;
        }
        Reflect.defineMetadata(PropMetadataSym, meta, model, propertyName);
    }
}
{'fraction_non_alphanumeric': 0.1111485348602223, 'fraction_numerical': 0.0, 'mean_word_length': 2.892529488859764, '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': '7470102', 'n_tokens_mistral': 787, 'n_tokens_neox': 763, 'n_words': 213}