lambdaisland / uri

A pure Clojure/ClojureScript URI library
Mozilla Public License 2.0
243 stars 21 forks source link

More conservative into #49

Closed plexus closed 9 months ago

plexus commented 9 months ago

Revert to the old behavior for query-map if no :into is specified

The previous change constitutes a breaking change, existing code might rely on the behavior of returning nil, e.g. in an if-let.

(if-let [m (query-map uri)] ,,,)

However, when an explicit :into is provided, it is reasonable to assume that you expect something of the same type to be returned. E.g. when calling (query-map uri {:into (sorted-map)}), it is reasonable to expect that the result is a sorted-map.

So this is a compromise, where we return :into if it is explicitly specified, or nil if not.

plexus commented 9 months ago

Released in v1.18.150

[lambdaisland/uri "1.18.150"]                 ;; deps.edn
{lambdaisland/uri {:mvn/version "1.18.150"}}  ;; project.clj