2021-08-30

export const panic = (data: any) => {
let str = new Error().stack.toString()
let Regexp = /\w+.(js|ts):\d+:\d+/g
// console.log(str.split('\n')[2].split('/').reverse()[0].slice(0,-1))
Regexp.exec(str)
console.log(${Regexp.exec(str)[0]}: ${util.inspect(data, { showHidden: true, depth: null })})
// console.log(/\w+.(js|ts):\d+:\d+/g.exec('empty.js:7:1'))
}

你可能感兴趣的:(2021-08-30)