aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/activity_pub/mrf/utils.ex
blob: f2dc9eea91e817baf37916616fd1fb459de2a4e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Pleroma: A lightweight social networking server
# Copyright © 2017-2023 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only

defmodule Pleroma.Web.ActivityPub.MRF.Utils do
  @spec describe_regex_or_string(String.t() | Regex.t()) :: String.t()
  def describe_regex_or_string(pattern) do
    # This horror is needed to convert regex sigils to strings
    if not is_binary(pattern) do
      inspect(pattern)
    else
      pattern
    end
  end
end