src/utils.js
/**
 * Transforms the passed values and the passed argument name to an array of argument values, e.g. the value array
 * `['1', '2', '3']` and the argument name '--number' will be transformed to
 * `['--number', '1', '--number', '2', '--number', '3']`.
 *
 * @returns {Array<string>} An array that represents command line arguments.
 * @param {?Array<string>} values The values that will be used as values for the CLI options.
 * @param {!string} argumentName The name of the CLI option.
 */
Transforms the passed values and the passed argument name to an array of argument values, e.g.

@returns {Array} An array that represents command line arguments.
@param {?Array} values The values that will be used as values for the CLI options.
@param {!string} argumentName The name of the CLI option.
Transforms the passed values and the passed argument name to an array of argument values e . g . @returns { Array } An array that represents command line arguments . @param { ?Array } values The values that will be used as values for the CLI options . @param { !string } argumentName The name of the CLI option .
function valuesToArgumentsArray (values, argumentName) {
    if (!values || values.length === 0) return [argumentName];
    return values.reduce(function (accumulator, currentValue) {
        accumulator.push(argumentName, currentValue);
        return accumulator;
    }, []);
}
function valuesToArgumentsArray ( values , argumentName ) { if ( ! values || values . length === 0 ) return [ argumentName ] ; return values . reduce ( function ( accumulator , currentValue ) { accumulator . push ( argumentName , currentValue ) ; return accumulator ; } , [ ] ) ; }
Transforms the passed values and the passed argument name to an array of argument values, e.g.
Transforms the passed values and the passed argument name to an array of argument values e . g .