(defn redact
[data]
(walk/postwalk
(fn [node]
(if (and (vector? node) (= :id-number (first node)))
[:id-number "REDACTED"]
node))
data))
Redact values in a map using clojure.walk/postwalk
![](https://media.dev.to/cdn-cgi/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F75681%2Fd3f5ef39-9b43-4e6a-98d7-ecfcc20683ed.png)
(defn redact
[data]
(walk/postwalk
(fn [node]
(if (and (vector? node) (= :id-number (first node)))
[:id-number "REDACTED"]
node))
data))