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 // Native support for parsing for non-standard Hermes stack traces. 12 if (global.HermesInternal) { 13 return require('./parseHermesStack').parseErrorStack(stack); 14 } 15 return (0, stacktrace_parser_1.parse)(stack).map((frame) => { 16 // frame.file will mostly look like `http://localhost:8081/index.bundle?platform=web&dev=true&hot=false` 17 return { 18 ...frame, 19 column: frame.column != null ? frame.column - 1 : null, 20 }; 21 }); 22} 23exports.default = parseErrorStack; 24//# sourceMappingURL=index.js.map