Skip to content

Commit

Permalink
Implement map-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
verberktstan authored Jun 5, 2024
1 parent 19c2e1c commit 4ddedbc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/swark/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@
(-> item map? assert)
(into {} (map-vals f) item))))

(defn map-keys
"WIP"
([f]
(map (juxt (comp f key) val)))
([f item]
(when item
(-> f ifn? assert)
(-> item map? assert)
(into {} (map-keys f) item))))

(defn filter-keys
{:added "0.1.3"
:arglists '([map pred])
Expand Down

0 comments on commit 4ddedbc

Please sign in to comment.