Permalink
Please sign in to comment.
Showing
with
25 additions
and 22 deletions.
4
ring-core/src/ring/middleware/multipart_params.clj
30
ring-core/src/ring/util/codec.clj
13
ring-core/src/ring/util/data.clj
| @@ -0,0 +1,13 @@ | |||
| +(ns ring.util.data | |||
| + "Miscellaneous functions for manipulating data structures.") | |||
| + | |||
| +(defn assoc+ | |||
| + "Associate a key with a value in a map. If the key already exists in the map, | |||
| + a vector of values is associated with the key." | |||
| + [map key val] | |||
| + (assoc map key | |||
| + (if-let [cur (get map key)] | |||
| + (if (vector? cur) | |||
| + (conj cur val) | |||
| + [cur val]) | |||
| + val))) | |||
0 comments on commit
c1e23d5