src/parse-comment.js
/**
 * Parses a config of values separated by comma.
 * @param {string} string The string to parse.
 * @returns {Object} Result map of values and true values
 */
Parses a config of values separated by comma.
Parses a config of values separated by comma .
function parseListConfig(string) {
    const items = {};
    string = string.replace(/\s*,\s*/g, ",");
    string.split(/,+/).forEach(function (name) {
        name = name.trim();
        if (!name) {
            return;
        }
        items[name] = true;
    });
    return items;
}
function parseListConfig ( string ) { const items = { } ; string = string . replace ( / \s*,\s* / g , "," ) ; string . split ( / ,+ / ) . forEach ( function ( name ) { name = name . trim ( ) ; if ( ! name ) { return ; } items [ name ] = true ; } ) ; return items ; }
Parses a config of values separated by comma.
Parses a config of values separated by comma .
// Collapse whitespace around ,