<commit_before>import { exec } from 'child_process';
import bs from 'browser-sync';
import { Server } from 'karma';
import del from 'del';
import runSequence from 'run-sequence';
import nib from 'nib';

/** Gulp plugins **/
import gulpHelp from 'gulp-help';
import gutil from 'gulp-util';
import gif from 'gulp-if';
import git from 'gulp-git';
import eslint from 'gulp-eslint';
import bump from 'gulp-bump';
import stylus from 'gulp-stylus';
import sourcemaps from 'gulp-sourcemaps';
import autoprefixer from 'gulp-autoprefixer';


function setupConfig(_config) {
    const defaultConfig = {
        src: 'src/',
        karmaConf: 'test/karma.conf.js',
        stylesheets: 'stylesheets/',
        jsSrc: 'javascript/',
        test: 'test/',
        unitTests: 'test/unit/',
        serve: 'demo/',
        dist: {
            root: 'dist/',
            stylesheets: 'dist/stylesheets/',
        },
    };

    return Object.assign(defaultConfig, _config);
}

class Apsis {<commit_msg>add helpers to deep clone config object<commit_after>import { exec } from 'child_process';
import bs from 'browser-sync';
import { Server } from 'karma';
import del from 'del';
import runSequence from 'run-sequence';
import nib from 'nib';

/** Gulp plugins **/
import gulpHelp from 'gulp-help';
import gutil from 'gulp-util';
import gif from 'gulp-if';
import git from 'gulp-git';
import eslint from 'gulp-eslint';
import bump from 'gulp-bump';
import stylus from 'gulp-stylus';
import sourcemaps from 'gulp-sourcemaps';
import autoprefixer from 'gulp-autoprefixer';


function deepAssign(target, ...rest) {
    let combined = target;
    rest.forEach(source => {
        combined = walkSource(combined, source);
    });

    return combined;
}

function walkSource(_target, _source) {
    Object.keys(_source).forEach(key => {
        const value = _source[key];

        if ( Array.isArray(value) ) {
            _target[key] = value.slice();
        } else if ( isObj(value) ) {
            _target[key] = deepAssign(_target[key] || {}, value);
        } else if ( value !== undefined ) {
            _target[key] = value;
        }
    });

    return _target;
}

function isObj(x) {
    const type = typeof x;
    return x !== null && (type === 'object' || type === 'function');
}

function setupConfig(_config) {
    const defaultConfig = {
        src: 'src/',
        karmaConf: 'test/karma.conf.js',
        stylesheets: 'stylesheets/',
        jsSrc: 'javascript/',
        test: 'test/',
        unitTests: 'test/unit/',
        serve: 'demo/',
        dist: {
            root: 'dist/',
            stylesheets: 'dist/stylesheets/',
        },
    };

    return Object.assign(defaultConfig, _config);
}

class Apsis {
{'fraction_non_alphanumeric': 0.1423841059602649, 'fraction_numerical': 0.0, 'mean_word_length': 2.797486033519553, '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': '1143256', 'n_tokens_mistral': 877, 'n_tokens_neox': 859, 'n_words': 236}