@nuxt/loading-screen
Version:
[![Github Actions CI][github-actions-src]][github-actions-href] [![Standard JS][standard-js-src]][standard-js-href] [![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![package phobia][package-ph
22 lines (17 loc) • 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
}