millermedeiros / crossroads.js

JavaScript Routes
http://millermedeiros.github.com/crossroads.js/
1.44k stars 156 forks source link

per-route shouldTypeCast override #103

Closed joelclermont closed 10 years ago

joelclermont commented 10 years ago

I set the shouldTypeCast property true, but I have some situations where I don't want a route to type cast something. Would you be open to accepting a PR adding this?

millermedeiros commented 10 years ago

I kinda regret of implementing the shouldTypecast feature and have plans to remove it in the future (in a v2.0 release), so I guess it is not a good idea to use it.

Maybe you can reuse a method like mout/string/typecast and use it individually as needed.

you can use it together with mout/object/map to convert the whole query string as well (var typecastedValues = map(query, typecast);)