bidi icon indicating copy to clipboard operation
bidi copied to clipboard

Extend keyword support to other types

Open tomconnors opened this issue 9 years ago • 0 comments

In the readme, there's a section about extracting variables from urls as keywords (https://github.com/juxt/bidi#keywords). It would be useful to be able to extract integers and probably other types as well. Is this currently possible?

My use case: The url looks like "/rules/4356", where 4356 is a "rule" entity's id. Bidi gives me {:handler :rules :route-params {:id "4356"}} when I match that url against a route like [["rules/" :id] :rules]. Dealing with the number as a string isn't terribly difficult, but it would be handy to just have it come out as a number. Additionally, it might be useful to have the route not match at all if the segment of the path at the :id key cannot be parsed as a number/whatever type is specified.

tomconnors avatar Apr 21 '16 16:04 tomconnors