@stacktrace-lite/core
    Preparing search index...

    Function filterStack

    • Filter an array of StackFrame entries using include/exclude matchers and presets.

      Parameters

      • frames: StackFrame[]

        The input stack frames to filter.

      • opts: FilterOptions = {}

        Optional filtering options (include/exclude matchers and preset).

      Returns StackFrame[]

      The filtered list of stack frames, in original order.

      Matching order:

      1. Start with exclude (plus any entries added by preset).
      2. If a frame matches any exclude matcher, it is removed.
      3. If include is provided, a frame must match at least one include matcher to be kept.
      4. Otherwise, the frame is kept.

      Matcher behavior

      • RegExp: tested against frame.fileName ?? ''.
      • Function: receives the frame and should return true to indicate a match.
      // Typical "clean stack" for UI error overlays:
      const clean = filterStack(frames, {
      preset: 'app-only',
      include: [//src//], // focus on your own source files
      exclude: [/\.spec\./, /test//] // trim tests if present in stacks
      });