src/utils.js
/**
 * Merges two argument arrays into one argument array, by means of copying all values from all passed argument arrays
 * into a new one, so that no duplicates will exist. But no argument value will overwrite the argument value of the
 * other argument array. I.e. in case of `['--js', 'file1.js', '--version']` and `['--debug', '--js', 'file1.js',
 * '--js', 'file2.js']` the result will be `['--js', 'file1.js', '--version', '--debug', '--js', 'file2.js']`.
 *
 * @returns {Array<string>} The merges argument array.
 * @param {?Array<string>} parentArguments The arguments array of the parent configuration.
 * @param {?Array<string>} childArguments The arguments array of the child configuration.
 */
Merges two argument arrays into one argument array, by means of copying all values from all passed argument arrays
into a new one, so that no duplicates will exist. But no argument value will overwrite the argument value of the
other argument array.

@returns {Array} The merges argument array.
@param {?Array} parentArguments The arguments array of the parent configuration.
@param {?Array} childArguments The arguments array of the child configuration.
Merges two argument arrays into one argument array by means of copying all values from all passed argument arrays into a new one so that no duplicates will exist . But no argument value will overwrite the argument value of the other argument array . @returns { Array } The merges argument array . @param { ?Array } parentArguments The arguments array of the parent configuration . @param { ?Array } childArguments The arguments array of the child configuration .
function mergeArguments (parentArguments, childArguments) {
    var innerParentArguments = parentArguments || [];
    var innerChildArguments = childArguments || [];
    var result = innerParentArguments.slice(0);
    var i = 0;
    while (i !== innerChildArguments.length) {
        if (i < innerChildArguments.length - 1 && !innerChildArguments[i + 1].startsWith('--')) {
            var index = findTuple(result, {fst: innerChildArguments[i], snd: innerChildArguments[i + 1]});
            if (index === -1) result.push(innerChildArguments[i], innerChildArguments[i + 1]);
            i += 2;
        } else if (result.indexOf(innerChildArguments[i]) === -1) {
            result.push(innerChildArguments[i++]);
        } else {
            ++i;
        }
    }
    return result;
}
function mergeArguments ( parentArguments , childArguments ) { var innerParentArguments = parentArguments || [ ] ; var innerChildArguments = childArguments || [ ] ; var result = innerParentArguments . slice ( 0 ) ; var i = 0 ; while ( i !== innerChildArguments . length ) { if ( i < innerChildArguments . length - 1 && ! innerChildArguments [ i + 1 ] . startsWith ( '--' ) ) { var index = findTuple ( result , { fst : innerChildArguments [ i ] , snd : innerChildArguments [ i + 1 ] } ) ; if ( index === - 1 ) result . push ( innerChildArguments [ i ] , innerChildArguments [ i + 1 ] ) ; i += 2 ; } else if ( result . indexOf ( innerChildArguments [ i ] ) === - 1 ) { result . push ( innerChildArguments [ i ++ ] ) ; } else { ++ i ; } } return result ; }
Merges two argument arrays into one argument array, by means of copying all values from all passed argument arrays
 into a new one, so that no duplicates will exist.
Merges two argument arrays into one argument array by means of copying all values from all passed argument arrays into a new one so that no duplicates will exist .