revenge-bundle-next/lib/utils/src/errors.ts

9 lines
221 B
TypeScript
Raw Normal View History

2025-03-21 19:59:16 +07:00
export function getErrorStack(e: unknown) {
return e instanceof Error ? e.stack : String(e)
}
export function getCurrentStack() {
const { stack } = new Error()
return stack!.split('\n').slice(2).join('\n')
}