Closed bramstein closed 12 years ago
I agree that it should respect the shouldTypecast
. The change in behavior will probably break some apps but I guess it's better to change it sooner than later.
Was considering to add another setting but I guess this should be enough for most cases, so let's keep like this. I added this change to the v0.11.0 milestone, should be on the next release.
I merged this into dev including other changes that I hope to ship with v0.11.0: https://github.com/millermedeiros/crossroads.js/compare/v0.10.0...v0.11.0a - it would be great to get feedback on the v0.11.0 changes. Thanks.
The changes look good. I've tried out the dev branch (v0.11.0) and couldn't find any problems with in my app.
This patch changes the decoding of query strings to respect the global
shouldTypecast
property.I could tell from your unit tests that typecasting the query string values was intentional, but I feel this is a bit unexpected when I explicitly set the
shouldTypecast
property tofalse
. For this reason I'm hoping you will consider accepting this patch which makes the behaviour consistent.I've updated all the unit tests that test the typecasting of query strings and added a new one that tests that typecasting is not performed by default. All tests pass after these changes.