millermedeiros/crossroads.js — Issue #39: rules.normalize_ called twice on regexp match
Author: ncirkel
Created: 2012-01-06 18:10:46+00:00
State: open

When using a regexp route, my rules.normalize_ function gets called twice with different arguments.

The problem seems to be that a regex route returns an array in stead of an object with named properties.
Therefore, in route.js, line 45...

```javascript
var validationRule = this.rules[prop]
```

...returns this.rules[0] which is my normalize_ function. It is then called on line 59:

```javascript
isValid = validationRule(val, request, values)
```