lib/error-handler.js
function getFilePath (str) {
    var hasRoot = /^[a-z]:/i.exec(str)
    var colonLeftIndex = 0
    if (hasRoot) {
      colonLeftIndex = hasRoot[0].length
    }
    var pathEnd = str.split('\n')[0].indexOf(':', colonLeftIndex)
    if (pathEnd === -1) {
      // invalid string, return non-formattable result
      return null
    }
    return str.substring(0, pathEnd)
  }
function getFilePath (str) {
    var hasRoot = /^[a-z]:/i.exec(str)
    var colonLeftIndex = 0
    if (hasRoot) {
      colonLeftIndex = hasRoot[0].length
    }
    var pathEnd = str.split('\n')[0].indexOf(':', colonLeftIndex)
    if (pathEnd === -1) {
      // invalid string, return non-formattable result
      return null
    }
    return str.substring(0, pathEnd)
  }
function getFilePath ( str ) { var hasRoot = / ^[a-z]: / i . exec ( str ) var colonLeftIndex = 0 if ( hasRoot ) { colonLeftIndex = hasRoot [ 0 ] . length } var pathEnd = str . split ( '\n' ) [ 0 ] . indexOf ( ':' , colonLeftIndex ) if ( pathEnd === - 1 ) { // invalid string, return non-formattable result return null } return str . substring ( 0 , pathEnd ) }
get a file path from the error message
get a file path from the error message