<commit_before>//Default Module-Item
'use strict';
function itemModule(){}
itemModule.prototype={
    /**
     * Module init after module instance created
     */
    init:function(){
        //valid data middleware
        this.use(function(datas,next){
            let error;
            if(!Array.isArray(datas)) error=new Error('Item datas must be an array');
            if(!error&&datas.length===0) error=new Error('Item datas must be not empty');
            if(!error){
                let valid=datas.every(data=>{
                    try{
                        return data.type&&data.itemId&&data.dId&&data.point&&!isNaN(data.point);
                    }
                    catch(e){
                        return false;
                    }
                });
                if(!valid) error=new Error('Item data must have right props:type(dimension type),itemId,dId(dimension ID),point');
            }
            next(error,datas);
        });
    },
    /**
     * Update Item to redis
     * @param  {Array}    pointArray An array for item info(Object:itemId,dId(dimension ID),point)
     * @return {Object}              Promise object
     */
    update:function(pointArray){<commit_msg>Fixed item update commit error<commit_after>//Default Module-Item
'use strict';
function itemModule(){}
itemModule.prototype={
    /**
     * Module init after module instance created
     */
    init:function(){
        //valid data middleware
        this.use(function(datas,next){
            let error;
            if(!Array.isArray(datas)) error=new Error('Item datas must be an array');
            if(!error&&datas.length===0) error=new Error('Item datas must be not empty');
            if(!error){
                let valid=datas.every(data=>{
                    try{
                        return data.type&&data.itemId&&data.dId&&data.point&&!isNaN(data.point);
                    }
                    catch(e){
                        return false;
                    }
                });
                if(!valid) error=new Error('Item data must have right props:type(dimension type),itemId,dId(dimension ID),point');
            }
            next(error,datas);
        });
    },
    /**
     * Update Item to redis
     * @param  {Array}    pointArray An array for item info(Object:itemId,dId(dimension ID),point,type)
     * @return {Object}              Promise object
     */
    update:function(pointArray){
{'fraction_non_alphanumeric': 0.12387571545380213, 'fraction_numerical': 0.0008176614881439084, 'mean_word_length': 1.7340782122905027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6049888', 'n_tokens_mistral': 661, 'n_tokens_neox': 624, 'n_words': 151}