tasks/properties_reader.js
function convertPropsToJson(text) {
    var configObject = {};
    if (text && text.length) {
        // handle multi-line values terminated with a backslash
        text = text.replace(/\\\r?\n\s*/g, '');
        text.split(/\r?\n/g).forEach(function (line) {
            var props,
                name,
                val;
            line = line.trim();
            if (line && line.indexOf("#") !== 0 && line.indexOf("!") !== 0) {
                props = line.split(/\=(.+)?/);
                name = props[0] && props[0].trim();
                val = props[1] && props[1].trim();
                configObject[name] = _convertStringIfTrue(val);
            }
        });
    }
    return configObject;
}
function convertPropsToJson(text) {
    var configObject = {};
    if (text && text.length) {
        // handle multi-line values terminated with a backslash
        text = text.replace(/\\\r?\n\s*/g, '');
        text.split(/\r?\n/g).forEach(function (line) {
            var props,
                name,
                val;
            line = line.trim();
            if (line && line.indexOf("#") !== 0 && line.indexOf("!") !== 0) {
                props = line.split(/\=(.+)?/);
                name = props[0] && props[0].trim();
                val = props[1] && props[1].trim();
                configObject[name] = _convertStringIfTrue(val);
            }
        });
    }
    return configObject;
}
function convertPropsToJson ( text ) { var configObject = { } ; if ( text && text . length ) { // handle multi-line values terminated with a backslash text = text . replace ( / \\\r?\n\s* / g , '' ) ; text . split ( / \r?\n / g ) . forEach ( function ( line ) { var props , name , val ; line = line . trim ( ) ; if ( line && line . indexOf ( "#" ) !== 0 && line . indexOf ( "!" ) !== 0 ) { props = line . split ( / \=(.+)? / ) ; name = props [ 0 ] && props [ 0 ] . trim ( ) ; val = props [ 1 ] && props [ 1 ] . trim ( ) ; configObject [ name ] = _convertStringIfTrue ( val ) ; } } ) ; } return configObject ; }
Convert properties string into a json object
Only supports boolean and string types
Convert properties string into a json object Only supports boolean and string types