lib/java.properties.js
function splitEscaped(src, separator) {
    let escapeFlag = false,
        token = '',
        result = [];
    src.split('').forEach(letter => {
        if (escapeFlag) {
            token += letter;
            escapeFlag = false;
        } else if (letter === '\\') {
            escapeFlag = true;
        } else if (letter === separator) {
            result.push(token);
            token = '';
        } else {
            token += letter;
        }
    });
    if (token.length > 0) {
        result.push(token);
    }
    return result;
}
function splitEscaped(src, separator) {
    let escapeFlag = false,
        token = '',
        result = [];
    src.split('').forEach(letter => {
        if (escapeFlag) {
            token += letter;
            escapeFlag = false;
        } else if (letter === '\\') {
            escapeFlag = true;
        } else if (letter === separator) {
            result.push(token);
            token = '';
        } else {
            token += letter;
        }
    });
    if (token.length > 0) {
        result.push(token);
    }
    return result;
}
function splitEscaped ( src , separator ) { let escapeFlag = false , token = '' , result = [ ] ; src . split ( '' ) . forEach ( letter => { if ( escapeFlag ) { token += letter ; escapeFlag = false ; } else if ( letter === '\\' ) { escapeFlag = true ; } else if ( letter === separator ) { result . push ( token ) ; token = '' ; } else { token += letter ; } } ) ; if ( token . length > 0 ) { result . push ( token ) ; } return result ; }
Split a string using a separator, if not preceded by a backslash.
For simplicity, this does not correctly handle two preceding backslashes
@param src {String} value to parse
@param separator {String} single character separator
@returns []
Split a string using a separator if not preceded by a backslash . For simplicity this does not correctly handle two preceding backslashes