lib/utils.js
function($str, $checkColors)
    {
        var $regex = new RegExp(REGEXP_PLAIN, 'gm');
        var $match = $str.match($regex);

        if (!!$match)
        {
            $str   = $str.substr($match[0].length);
            $match = true;
        }
        else if ($checkColors !== false)
        {
            $regex = new RegExp(REGEXP_ANSI, 'gm');
            $match = $str.match($regex);

            if (!!$match)
            {
                $str   = $str.substr($match[0].length);
                $match = true;
            }
        }

        // trim extra seperator space when available
        if ($match && $str.substr(0, 1) === ' ')
        {
            $str = $str.substr(1);
        }

        return $str;
    }
function($str, $checkColors)
    {
        var $regex = new RegExp(REGEXP_PLAIN, 'gm');
        var $match = $str.match($regex);

        if (!!$match)
        {
            $str   = $str.substr($match[0].length);
            $match = true;
        }
        else if ($checkColors !== false)
        {
            $regex = new RegExp(REGEXP_ANSI, 'gm');
            $match = $str.match($regex);

            if (!!$match)
            {
                $str   = $str.substr($match[0].length);
                $match = true;
            }
        }

        // trim extra seperator space when available
        if ($match && $str.substr(0, 1) === ' ')
        {
            $str = $str.substr(1);
        }

        return $str;
    }
function ( $str , $checkColors ) { var $regex = new RegExp ( REGEXP_PLAIN , 'gm' ) ; var $match = $str . match ( $regex ) ; if ( ! ! $match ) { $str = $str . substr ( $match [ 0 ] . length ) ; $match = true ; } else if ( $checkColors !== false ) { $regex = new RegExp ( REGEXP_ANSI , 'gm' ) ; $match = $str . match ( $regex ) ; if ( ! ! $match ) { $str = $str . substr ( $match [ 0 ] . length ) ; $match = true ; } } // trim extra seperator space when available if ( $match && $str . substr ( 0 , 1 ) === ' ' ) { $str = $str . substr ( 1 ) ; } return $str ; }
Trim a timestamp from the beginning of the string. First checks for the
timestamp without color coding. When none found and the `checkColors`
arg equals `true`, the function searches for color coded timestamps.

@param {string} $str
@param {boolean} $checkColors [true]
@return {string}
Trim a timestamp from the beginning of the string . First checks for the timestamp without color coding . When none found and the checkColors arg equals true the function searches for color coded timestamps .