<commit_before>(function() {
    'use strict';
    
    var DIR         = __dirname + '/',
        DIR_ROOT    = DIR + '../',
        DIR_SERVER  = DIR + 'server/',
        
        Util        = require(DIR + 'util'),
        cloudfunc   = require(DIR + 'cloudfunc'),
        
        auth        = require(DIR_SERVER + 'auth'),
        config      = require(DIR_SERVER + 'config'),
        rest        = require(DIR_SERVER + 'rest'),
        route       = require(DIR_SERVER + 'route'),
        validate    = require(DIR_SERVER + 'validate'),
        createPass  = require(DIR_SERVER + 'password'),
        
        join        = require('join-io'),
        ponse       = require('ponse'),
        mollify     = require('mollify'),
        restafary   = require('restafary'),
        webconsole  = require('console-io'),
        edward      = require('edward'),
        dword       = require('dword'),
        spero       = require('spero'),
        remedy      = require('remedy'),
        ishtar      = require('ishtar'),
        
        root        = function() {
            return config('root');
        },
        
        emptyFunc   = function(req, res, next) {
            next();
        };
        
        emptyFunc.middle    = function() {
            return emptyFunc;
        };
    
    function getPrefix(prefix) {
        var result;
        
        if (typeof prefix === 'function')
            result = prefix();
        else
            result = prefix;
        
        return result || '';
    }
    
    module.exports = function(params) {
        var prefix,
            p               = params || {},
            options         = p.config || {},
            keys            = Object.keys(options);
        
        if (typeof params.prefix !== 'undefined') {
            console.log('cloudcmd: prefix property deprecated, use config.prefix instead');
            options.prefix = params.prefix;
        }
        
        keys.forEach(function(name) {
            var value = options[name];
            
            switch(name) {
            case 'root':
                validate.root(value);
                break;
            case 'editor':
                validate.editor(value);
                break;
            case 'password':
                value = createPass(config('algo'), value);
                break;
            case 'prefix':
                if (value) {
                    if (!~value.indexOf('/'))
                        value = '/' + value;
                    else if (value.length === 1)
                        value = '';
                }
                
                prefix = value;
                
                break;
            }
            
            config(name, value);
        });
        
        if (p.socket)
            listen(p.socket);
        
        return cloudcmd(prefix, p.socket);
    };
    <commit_msg>fix(cloudcmd) value -> typeof value<commit_after>(function() {
    'use strict';
    
    var DIR         = __dirname + '/',
        DIR_ROOT    = DIR + '../',
        DIR_SERVER  = DIR + 'server/',
        
        Util        = require(DIR + 'util'),
        cloudfunc   = require(DIR + 'cloudfunc'),
        
        auth        = require(DIR_SERVER + 'auth'),
        config      = require(DIR_SERVER + 'config'),
        rest        = require(DIR_SERVER + 'rest'),
        route       = require(DIR_SERVER + 'route'),
        validate    = require(DIR_SERVER + 'validate'),
        createPass  = require(DIR_SERVER + 'password'),
        
        join        = require('join-io'),
        ponse       = require('ponse'),
        mollify     = require('mollify'),
        restafary   = require('restafary'),
        webconsole  = require('console-io'),
        edward      = require('edward'),
        dword       = require('dword'),
        spero       = require('spero'),
        remedy      = require('remedy'),
        ishtar      = require('ishtar'),
        
        root        = function() {
            return config('root');
        },
        
        emptyFunc   = function(req, res, next) {
            next();
        };
        
        emptyFunc.middle    = function() {
            return emptyFunc;
        };
    
    function getPrefix(prefix) {
        var result;
        
        if (typeof prefix === 'function')
            result = prefix();
        else
            result = prefix;
        
        return result || '';
    }
    
    module.exports = function(params) {
        var prefix,
            p               = params || {},
            options         = p.config || {},
            keys            = Object.keys(options);
        
        if (typeof params.prefix !== 'undefined') {
            console.log('cloudcmd: prefix property deprecated, use config.prefix instead');
            options.prefix = params.prefix;
        }
        
        keys.forEach(function(name) {
            var value = options[name];
            
            switch(name) {
            case 'root':
                validate.root(value);
                break;
            case 'editor':
                validate.editor(value);
                break;
            case 'password':
                value = createPass(config('algo'), value);
                break;
            case 'prefix':
                if (typeof value === 'string') {
                    if (!~value.indexOf('/'))
                        value = '/' + value;
                    else if (value.length === 1)
                        value = '';
                }
                
                prefix = value;
                
                break;
            }
            
            config(name, value);
        });
        
        if (p.socket)
            listen(p.socket);
        
        return cloudcmd(prefix, p.socket);
    };
    
{'fraction_non_alphanumeric': 0.12041795135320316, 'fraction_numerical': 0.00034258307639602604, 'mean_word_length': 1.1087035030697003, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '58027', 'n_tokens_mistral': 1479, 'n_tokens_neox': 1440, 'n_words': 303}