From d7da04a3eaed0a2f39b74e5dc6299c91cb08398e Mon Sep 17 00:00:00 2001 From: eltrac Date: Mon, 16 Mar 2026 16:12:35 +0800 Subject: refactor: move javamap->map to utils.clj --- src/weepinbell/processor.clj | 5 +---- src/weepinbell/utils.clj | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/weepinbell/processor.clj b/src/weepinbell/processor.clj index a4b85a8..76017a6 100644 --- a/src/weepinbell/processor.clj +++ b/src/weepinbell/processor.clj @@ -3,8 +3,7 @@ [clojure.string :refer [includes? lower-case]] [clj-http.client :as client] [weepinbell.storage :as storage] - [clojure.walk :as walk] - [weepinbell.utils :refer [validate-content-types]] + [weepinbell.utils :refer [validate-content-types javamap->map]] [taoensso.timbre :as timbre]) (:import [com.kylewm.mf2j Mf2Parser] [java.net URI])) @@ -56,8 +55,6 @@ url attempt (or msg "Unknown error"))) nil)))))))) -(defn javamap->map [map] - (->> (seq map) (into {}) walk/keywordize-keys)) (defn wrap-webmention "Parse microformats and collect essential info. Wrap source, target and collected data into a Clojure map and return it." diff --git a/src/weepinbell/utils.clj b/src/weepinbell/utils.clj index 782368a..d85c097 100644 --- a/src/weepinbell/utils.clj +++ b/src/weepinbell/utils.clj @@ -4,6 +4,7 @@ (:require [weepinbell.config :refer [get-config]] [clj-http.client :as client] [clojure.string :as string] + [clojure.walk :as walk] [taoensso.timbre :as timbre])) (defn get-domain [url] @@ -51,3 +52,5 @@ target-valid (validate target)] (and source-valid target-valid))) +(defn javamap->map [map] + (->> (seq map) (into {}) walk/keywordize-keys)) -- cgit v1.2.3