1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const stacktrace_parser_1 = require("stacktrace-parser");
4function parseErrorStack(stack) {
5    if (stack == null) {
6        return [];
7    }
8    if (Array.isArray(stack)) {
9        return stack;
10    }
11    // This file seems to be web-only, so we can remove this.
12    // // Native support for parsing for non-standard Hermes stack traces.
13    // if (global.HermesInternal) {
14    //   return require('./parseHermesStack').parseErrorStack(stack);
15    // }
16    return (0, stacktrace_parser_1.parse)(stack).map((frame) => {
17        // frame.file will mostly look like `http://localhost:8081/index.bundle?platform=web&dev=true&hot=false`
18        return {
19            ...frame,
20            column: frame.column != null ? frame.column - 1 : null,
21        };
22    });
23}
24exports.default = parseErrorStack;
25//# sourceMappingURL=index.js.map