entries/react/spa/ErrorBoundary.js
function parseMappedStack(stack) {
  let result = []
  for (let line of stack) {
    // at ... (file:///namespace/path:line:column)
    const MATCHED = line.match(/\(.*?:\/{3}(.*?)\/(.*):(.*?):(.*?)\)$/)

    // The line couldn’t be parsed.
    if (!MATCHED){
      result.push({stackLine: line})
      continue
    }

    result.push({
      column: MATCHED[4],
      line: MATCHED[3],
      namespace: MATCHED[1],
      path: MATCHED[2],
      stackLine: line,
    })
  }
  return result
}
function parseMappedStack(stack) {
  let result = []
  for (let line of stack) {
    // at ... (file:///namespace/path:line:column)
    const MATCHED = line.match(/\(.*?:\/{3}(.*?)\/(.*):(.*?):(.*?)\)$/)

    // The line couldn’t be parsed.
    if (!MATCHED){
      result.push({stackLine: line})
      continue
    }

    result.push({
      column: MATCHED[4],
      line: MATCHED[3],
      namespace: MATCHED[1],
      path: MATCHED[2],
      stackLine: line,
    })
  }
  return result
}
function parseMappedStack ( stack ) { let result = [ ] for ( let line of stack ) { // at ... (file:///namespace/path:line:column) const MATCHED = line . match ( / \(.*?:\/{3}(.*?)\/(.*):(.*?):(.*?)\)$ / ) // The line couldn’t be parsed. if ( ! MATCHED ) { result . push ( { stackLine : line } ) continue } result . push ( { column : MATCHED [ 4 ] , line : MATCHED [ 3 ] , namespace : MATCHED [ 1 ] , path : MATCHED [ 2 ] , stackLine : line , } ) } return result }
Return the a new mapped stack where each item is an object with properties
for line, column, namespace and file path.
Return the a new mapped stack where each item is an object with properties for line column namespace and file path .