build/src/cli.js
/**
 * Parses a comma-separated list of environment variables into an object. The keys of
 * this object are the environment variable names, with the values being their respective
 * values.
 *
 * e.g. KEY1=value1, KEY2=value2 -> { KEY1: 'value1', KEY2: 'value2' }
 * @param environmentVariables String of comma-separated list of environment variables
 * @returns An object with the environment variables as keys
 */
Parses a comma-separated list of environment variables into an object. The keys of
this object are the environment variable names, with the values being their respective
values.


Parses a comma - separated list of environment variables into an object . The keys of this object are the environment variable names with the values being their respective values .
function parseEnvironmentVariables(environmentVariables) {
    if (!environmentVariables) {
        return {};
    }
    return environmentVariables.split(',')
        .map((seg) => seg.trim())
        .reduce((acc, seg) => {
        let splitSeg = seg.split('=');
        return {
            ...acc,
            [splitSeg[0].trim()]: splitSeg[1].trim(),
        };
    }, {});
}
function parseEnvironmentVariables ( environmentVariables ) { if ( ! environmentVariables ) { return { } ; } return environmentVariables . split ( ',' ) . map ( ( seg ) => seg . trim ( ) ) . reduce ( ( acc , seg ) => { let splitSeg = seg . split ( '=' ) ; return { ... acc , [ splitSeg [ 0 ] . trim ( ) ] : splitSeg [ 1 ] . trim ( ) , } ; } , { } ) ; }
Parses a comma-separated list of environment variables into an object.
Parses a comma - separated list of environment variables into an object .