class Honeybadger::Util::Sanitizer

def initialize(max_depth: 20, filters: [])

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: (max_depth: Integer, filters: (Array[String] | Array[])) -> void

This signature was generated using 66 samples from 1 application.

def initialize(max_depth: 20, filters: [])
  @filters = !filters.empty?
  @max_depth = max_depth
  strings, @regexps, @blocks = [], [], []
  filters.each do |item|
    case item
    when Proc
      @blocks << item
    when Regexp
      @regexps << item
    else
      strings << Regexp.escape(item.to_s)
    end
  end
  @deep_regexps, @regexps = @regexps.partition { |r| r.to_s.include?('\\.'.freeze) }
  deep_strings, @strings = strings.partition { |s| s.include?('\\.'.freeze) }
  @regexps << Regexp.new(strings.join('|'.freeze), true) unless strings.empty?
  @deep_regexps << Regexp.new(deep_strings.join('|'.freeze), true) unless deep_strings.empty?
end