Optimizing your experience
Gradient background

Redact values in a map using clojure.walk/postwalk

Clarice Bouwer

Software Engineering Team Lead and Director of Cloudsure

Monday, 22 August 2022 · Estimated 1 minute read
Copy
(defn redact
  [data]
  (walk/postwalk
   (fn [node]
     (if (and (vector? node) (= :id-number (first node)))
       [:id-number "REDACTED"]
       node))
   data))