Liking cljdoc? Tell your friends :D

macchiato.middleware.nested-params


assoc-conjcljs

(assoc-conj map key val)

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.

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.
sourceraw docstring

nested-params-requestcljs

(nested-params-request request)
(nested-params-request request options)

Converts a request with a flat map of parameters to a nested map. See: wrap-nested-params.

Converts a request with a flat map of parameters to a nested map.
See: wrap-nested-params.
sourceraw docstring

parse-nested-keyscljs

(parse-nested-keys param-name)

Parse a parameter name into a list of keys using a 'C'-like index notation. For example: "foo[bar][][baz]" => ["foo" "bar" "" "baz"]

Parse a parameter name into a list of keys using a 'C'-like index
notation.
For example:
  "foo[bar][][baz]"
  => ["foo" "bar" "" "baz"]
sourceraw docstring

wrap-nested-paramscljs

(wrap-nested-params handler)
(wrap-nested-params handler options)

Middleware to converts a flat map of parameters into a nested map. Accepts the following options: :key-parser - the function to use to parse the parameter names into a list of keys. Keys that are empty strings are treated as elements in a vector, non-empty keys are treated as elements in a map. Defaults to the parse-nested-keys function. For example: {"foo[bar]" "baz"} => {"foo" {"bar" "baz"}} {"foo[]" "bar"} => {"foo" ["bar"]}

Middleware to converts a flat map of parameters into a nested map.
Accepts the following options:
:key-parser - the function to use to parse the parameter names into a list
              of keys. Keys that are empty strings are treated as elements in
              a vector, non-empty keys are treated as elements in a map.
              Defaults to the parse-nested-keys function.
For example:
  {"foo[bar]" "baz"}
  => {"foo" {"bar" "baz"}}
  {"foo[]" "bar"}
  => {"foo" ["bar"]}
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close