total rebase
[anni] / lib / pleroma / web / activity_pub / mrf / utils.ex
diff --git a/lib/pleroma/web/activity_pub/mrf/utils.ex b/lib/pleroma/web/activity_pub/mrf/utils.ex
new file mode 100644 (file)
index 0000000..f2dc9ee
--- /dev/null
@@ -0,0 +1,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