diff options
| author | eltrac <hi@eltr.ac> | 2026-03-16 16:12:35 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-16 16:12:35 +0800 |
| commit | d7da04a3eaed0a2f39b74e5dc6299c91cb08398e (patch) | |
| tree | 118d64670c675c9dbff33409b9cfcf85e02bde02 | |
| parent | 5167f8d68223d4358012a2b26ebfb2fbc718839c (diff) | |
refactor: move javamap->map to utils.clj
| -rw-r--r-- | src/weepinbell/processor.clj | 5 | ||||
| -rw-r--r-- | src/weepinbell/utils.clj | 3 |
2 files changed, 4 insertions, 4 deletions
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)) |
