dist/utils.js
function copyAll(copies) {
    var success = 0;
    var failed = 0;
    var result;
    function update(_result) {
        if (!_result)
            failed++;
        else
            success++;
    }
    function logResults() {
        // only log if something copied or failed.
        if (success || failed) {
            if (failed > success) {
                if (!success)
                    logger_1.log.error(failed + " failed to copy with 0 succeeding.");
                else
                    logger_1.log.warn(failed + " failed to copy " + success + " succeeded.");
            }
            else {
                logger_1.log.notify(success + " items copied " + failed + " failed.");
            }
        }
    }
    if (chek_1.isPlainObject(copies)) {
        chek_1.keys(copies).forEach(function (k) {
            var itm = copies[k];
            // Check if src is glob.
            if (itm.src.indexOf('*') !== -1) {
                var arr = glob.sync(itm.src);
                arr.forEach(function (str) {
                    result = copy(str, itm.dest);
                    update(result);
                });
            }
            else {
                result = copy(itm.src, itm.dest);
                update(result);
            }
        });
        logResults();
    }
    else if (chek_1.isArray(copies)) {
        // If not array of tuples convert.
        if (chek_1.isString(copies[0]))
            copies = copies.reduce(function (a, c) {
                var tuple = c.split('|');
                return a.concat([tuple]);
            }, []);
        copies.forEach(function (c) {
            var tuple = c;
            if (tuple[0].indexOf('*') !== -1) {
                var arr = glob.sync(tuple[0]);
                arr.forEach(function (str) {
                    result = copy(str, tuple[1]);
                    update(result);
                });
            }
            else {
                result = copy(tuple[0], tuple[1]);
                update(result);
            }
        });
        logResults();
    }
    else {
        logger_1.log.warn("copy failed using unknown configuration type.");
    }
    return {
        success: success,
        failed: failed
    };
}
function copyAll(copies) {
    var success = 0;
    var failed = 0;
    var result;
    function update(_result) {
        if (!_result)
            failed++;
        else
            success++;
    }
    function logResults() {
        // only log if something copied or failed.
        if (success || failed) {
            if (failed > success) {
                if (!success)
                    logger_1.log.error(failed + " failed to copy with 0 succeeding.");
                else
                    logger_1.log.warn(failed + " failed to copy " + success + " succeeded.");
            }
            else {
                logger_1.log.notify(success + " items copied " + failed + " failed.");
            }
        }
    }
    if (chek_1.isPlainObject(copies)) {
        chek_1.keys(copies).forEach(function (k) {
            var itm = copies[k];
            // Check if src is glob.
            if (itm.src.indexOf('*') !== -1) {
                var arr = glob.sync(itm.src);
                arr.forEach(function (str) {
                    result = copy(str, itm.dest);
                    update(result);
                });
            }
            else {
                result = copy(itm.src, itm.dest);
                update(result);
            }
        });
        logResults();
    }
    else if (chek_1.isArray(copies)) {
        // If not array of tuples convert.
        if (chek_1.isString(copies[0]))
            copies = copies.reduce(function (a, c) {
                var tuple = c.split('|');
                return a.concat([tuple]);
            }, []);
        copies.forEach(function (c) {
            var tuple = c;
            if (tuple[0].indexOf('*') !== -1) {
                var arr = glob.sync(tuple[0]);
                arr.forEach(function (str) {
                    result = copy(str, tuple[1]);
                    update(result);
                });
            }
            else {
                result = copy(tuple[0], tuple[1]);
                update(result);
            }
        });
        logResults();
    }
    else {
        logger_1.log.warn("copy failed using unknown configuration type.");
    }
    return {
        success: success,
        failed: failed
    };
}
function copyAll ( copies ) { var success = 0 ; var failed = 0 ; var result ; function update ( _result ) { if ( ! _result ) failed ++ ; else success ++ ; } function logResults ( ) { // only log if something copied or failed. if ( success || failed ) { if ( failed > success ) { if ( ! success ) logger_1 . log . error ( failed + " failed to copy with 0 succeeding." ) ; else logger_1 . log . warn ( failed + " failed to copy " + success + " succeeded." ) ; } else { logger_1 . log . notify ( success + " items copied " + failed + " failed." ) ; } } } if ( chek_1 . isPlainObject ( copies ) ) { chek_1 . keys ( copies ) . forEach ( function ( k ) { var itm = copies [ k ] ; // Check if src is glob. if ( itm . src . indexOf ( '*' ) !== - 1 ) { var arr = glob . sync ( itm . src ) ; arr . forEach ( function ( str ) { result = copy ( str , itm . dest ) ; update ( result ) ; } ) ; } else { result = copy ( itm . src , itm . dest ) ; update ( result ) ; } } ) ; logResults ( ) ; } else if ( chek_1 . isArray ( copies ) ) { // If not array of tuples convert. if ( chek_1 . isString ( copies [ 0 ] ) ) copies = copies . reduce ( function ( a , c ) { var tuple = c . split ( '|' ) ; return a . concat ( [ tuple ] ) ; } , [ ] ) ; copies . forEach ( function ( c ) { var tuple = c ; if ( tuple [ 0 ] . indexOf ( '*' ) !== - 1 ) { var arr = glob . sync ( tuple [ 0 ] ) ; arr . forEach ( function ( str ) { result = copy ( str , tuple [ 1 ] ) ; update ( result ) ; } ) ; } else { result = copy ( tuple [ 0 ] , tuple [ 1 ] ) ; update ( result ) ; } } ) ; logResults ( ) ; } else { logger_1 . log . warn ( "copy failed using unknown configuration type." ) ; } return { success : success , failed : failed } ; }
Copy All
Takes collection and copies to destination.

@param copies collection of source and destination targets.
Copy All Takes collection and copies to destination .