line_push/node_modules/@nuxt/loading-screen/lib/utils.js
2022-07-21 03:28:35 +00:00

22 lines
373 B
JavaScript

const { sep } = require('path')
// copied from https://github.com/nuxt/consola/blob/master/src/utils/error.js
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
}
module.exports = {
parseStack
}