1import { parse } from 'stacktrace-parser';
2function parseErrorStack(stack) {
3    if (stack == null) {
4        return [];
5    }
6    if (Array.isArray(stack)) {
7        return stack;
8    }
9    // Native support for parsing for non-standard Hermes stack traces.
10    if (global.HermesInternal) {
11        return require('./parseHermesStack').parseErrorStack(stack);
12    }
13    return parse(stack).map((frame) => {
14        // frame.file will mostly look like `http://localhost:8081/index.bundle?platform=web&dev=true&hot=false`
15        return {
16            ...frame,
17            column: frame.column != null ? frame.column - 1 : null,
18        };
19    });
20}
21export default parseErrorStack;
22//# sourceMappingURL=index.js.map