total rebase
[anni] / lib / pleroma / web / activity_pub / mrf / utils.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2023 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.ActivityPub.MRF.Utils do
6   @spec describe_regex_or_string(String.t() | Regex.t()) :: String.t()
7   def describe_regex_or_string(pattern) do
8     # This horror is needed to convert regex sigils to strings
9     if not is_binary(pattern) do
10       inspect(pattern)
11     else
12       pattern
13     end
14   end
15 end