Redact values in a map using clojure.walk/postwalk
Clarice Bouwer

Clarice Bouwer @cbillowes

About: Curious programmer sharing byte-sized knowledge on dev.to. Passionate about Git, GCP, TypeScript, Next.js, and DevTools. Enjoys collaborating with others and leading by example.

Location:
Mauritius
Joined:
May 30, 2018

Redact values in a map using clojure.walk/postwalk

Publish Date: Aug 22 '22
0 0
(defn redact
  [data]
  (walk/postwalk
   (fn [node]
     (if (and (vector? node) (= :id-number (first node)))
       [:id-number "REDACTED"]
       node))
   data))
Enter fullscreen mode Exit fullscreen mode

Comments 0 total

    Add comment