Skip to content

Commit a4926be

Browse files
convert hasStack to TS (#2471)
1 parent 0f3c39c commit a4926be

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/core/src/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { App, Device, FeatureFlag, Logger, Request, Stackframe, Thread, User, BugsnagError, NotifiableError } from "./common"
22

3-
import ErrorStackParser from './lib/error-stack-parser'
3+
import ErrorStackParser from 'error-stack-parser'
44
// @ts-expect-error no types
55
import StackGenerator from 'stack-generator'
66
import hasStack from './lib/has-stack'

packages/core/src/lib/error-stack-parser.js

Lines changed: 0 additions & 1 deletion
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Given `err` which may be an error, does it have a stack property which is a string?
2-
module.exports = err =>
2+
const hasStack = (err: any): boolean =>
33
!!err &&
44
(!!err.stack || !!err.stacktrace || !!err['opera#sourceloc']) &&
55
typeof (err.stack || err.stacktrace || err['opera#sourceloc']) === 'string' &&
66
err.stack !== `${err.name}: ${err.message}`
7+
8+
export default hasStack

0 commit comments

Comments
 (0)