summaryrefslogtreecommitdiff
path: root/src/node_modules/consola/src/utils/error.js
blob: 3d5ab8ec5bf77cb8aa32887dbf9d4caf378acbe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { sep } from 'path'

export function parseStack (stack) {
  const cwd = process.cwd() + sep

  const lines = stack
    .split('\n')
    .splice(1)
    .map(l => l
      .trim()
      .replace('file://', '')
      .replace(cwd, '')
    )

  return lines
}