Sha256: 7afc1fef4bd26b41d9d4b301b955be9bb34710a6d9f5c30a14b8e8fe1457226f
Contents?: true
Size: 696 Bytes
Versions: 14
Compression:
Stored size: 696 Bytes
Contents
# frozen_string_literal: true module Mihari module Concerns # # False positive normalizable concern # module FalsePositiveNormalizable extend ActiveSupport::Concern prepend MemoWise # # Normalize a falsepositive value # # @param [String] value # # @return [String, Regexp] # def normalize_falsepositive(value) return value if !value.start_with?("/") || !value.end_with?("/") # if a value is surrounded by slashes, take it as a regexp value_without_slashes = value[1..-2] Regexp.compile value_without_slashes.to_s end memo_wise :normalize_falsepositive end end end
Version data entries
14 entries across 14 versions & 1 rubygems