<commit_before>var database = require('./db.js');
var exTable = require('./exTable.json');
var status = {
    level:1,
    experience:0,
};

exports.getStatus = function(){
    console.log('getStatus');
    return Promise.all([database.get('level'),database.get('experience')]);
};

exports.addExperience = function(value){
    database.get('experience').then(function(ex){
        database.set('experience',Number(ex) + value);
    }, function(err){
        //TODO
        //エラー処理
    })
    return true;
};<commit_msg>レベルアップ実装<commit_after>var database = require('./db.js');
var exTable = require('./exTable.json');
var status = {
    level:1,
    experience:0,
};

exports.getStatus = function(){
    console.log('getStatus');
    return Promise.all([database.get('level'),database.get('experience')]);
};

exports.addExperience = function(value){
    database.get('experience').then(function(ex){
        database.set('experience',Number(ex) + value);
    }, function(err){
        //TODO
        //エラー処理
    })
    return true;
};

exports.levelUp = function(){
    database.get('level').then(function(ex){
        database.set('level',Number(ex) + 1);
    }, function(err){
        //TODO
        //エラー処理
    })
    return true;
}
{'fraction_non_alphanumeric': 0.18932038834951456, 'fraction_numerical': 0.0040453074433656954, 'mean_word_length': 3.2508591065292096, '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': '7439130', 'n_tokens_mistral': 401, 'n_tokens_neox': 398, 'n_words': 60}