How to use the error-stack-parser.parseV8OrIE function in error-stack-parser

To help you get started, we’ve selected a few error-stack-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iodide-project / iodide / src / reps / serialization / get-error-stack-summary.js View on Github external
import ErrorStackParser from "error-stack-parser";
import StackFrame from "stackframe";

ErrorStackParser.parseV8OrIE = error => {
  const filtered = error.stack
    .split("\n")
    .filter(
      line => !!line.match(/^\s*at .*(\S+:\d+|\(native\))/m),
      ErrorStackParser
    );

  return filtered.map(line => {
    const tokens = line
      .replace(/^\s+/, "")
      .replace(/\(eval code/g, "(")
      .split(/\s+/)
      .slice(1);

    if (line.indexOf("(eval ") > -1) {
      const regExp = /\), (<[^>]+>:\d+:\d+)\)$/;

error-stack-parser

Extract meaning from JS Errors

MIT
Latest version published 2 years ago

Package Health Score

77 / 100
Full package analysis