<commit_before>'use strict';

var util = require('util');

function Terminal() {
    this.subLevel = 1;
}

/**
 * Display received data in format on terminal
 * @param {Object|string} data
 */
Terminal.prototype.show = function (data) {
    if (data['type'] === 'notify') {
        if (data['tag'] === 'START_FLAG_UP') { this.subLevel++; }
        if (data['tag'] === 'START_FLAG_DOWN') { this.subLevel--; }
        return this.subLevel;
    }

    if (this.subLevel > 0) {
        if (data['type'] === 'message') {
            var tab = '  ';
            for (var i = 0 ; i < this.subLevel - 1 ; i++) {
                tab += tab;
            }

            delete data['type'];
            //console.log(tab + '*', util.inspect(data['data'], false, null));
            process.stdout.write(data['data']);
        }
    }

    return this.subLevel;
};

module.exports = Terminal;<commit_msg>fix(terminal): show recived data format<commit_after>'use strict';

var util = require('util');

function Terminal() {
    this.subLevel = 1;
}

/**
 * Display received data in format on terminal
 * @param {Object|string} data
 */
Terminal.prototype.show = function (data) {
    if (data['type'] === 'notify') {
        if (data['tag'] === 'START_FLAG_UP') { this.subLevel++; }
        if (data['tag'] === 'START_FLAG_DOWN') { this.subLevel--; }
        return this.subLevel;
    }

    if (this.subLevel > 0) {
        if (data['type'] === 'message') {
            var tab = '  ';
            for (var i = 0 ; i < this.subLevel - 1 ; i++) {
                tab += tab;
            }

            delete data['type'];

            if (data['data']) {
                if (typeof data['data'] === 'string') {
                    process.stdout.write(data['data']);
                } else if (typeof data['data'] === 'object') {
                    process.stdout.write(util.format(data['data']));
                }
            }
        }
    }

    return this.subLevel;
};

module.exports = Terminal;
{'fraction_non_alphanumeric': 0.17921686746987953, 'fraction_numerical': 0.004016064257028112, 'mean_word_length': 1.9265785609397945, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4587529', 'n_tokens_mistral': 625, 'n_tokens_neox': 593, 'n_words': 139}