line_push/node_modules/@nuxt/loading-screen/lib/utils/error.js
2022-07-17 13:16:16 +08:00

18 lines
340 B
JavaScript

import { sep } from 'path'
// copied from https://github.com/nuxt/consola/blob/master/src/utils/error.js
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
}