function processOutput( raw, flg ) {
	var i;
	if ( flg ) {
		return trim( stripANSI( raw.join( '' ) ) );
	}
	for ( i = raw.length-1; i >= 0; i-- ) {
		// Check whether the screen display was erased, as the next element is the refreshed line...
		if ( raw[ i ] === '\u001b[0J' ) {
			return raw[ i+1 ];
		}
	}
}
Processes output stream text and returns a string representing what is currently displayed in the REPL.

## Notes

-   We can rely on simple concatenation when a test expression proceeds from left-to-right (i.e., as if a user normally types); however, when a user backtracks (e.g., by moving the cursor to the left), the REPL needs to refresh the displayed text (in full) in order to shift any text after the cursor to the right to make room for inserted characters.

@private
@param {Array<string>} raw - unprocessed output data
@param {boolean} flg - boolean indicating whether to concatenate unprocessed output data
@returns {string} output string