Comparing version 1.2.7 to 1.2.8
@@ -143,3 +143,3 @@ var events = require('events'), | ||
if (this._attach) { | ||
for (var i in this._attach) { | ||
for (var i = 0; i < this._attach.length; i++) { | ||
this._attach[i].call(thisArg); | ||
@@ -146,0 +146,0 @@ } |
@@ -197,3 +197,3 @@ /* | ||
this.recurse = options.recurse || this.recurse || false; | ||
this.recurse = typeof options.recurse === 'undefined' ? this.recurse || false : options.recurse; | ||
this.async = options.async || false; | ||
@@ -609,3 +609,3 @@ this.delimiter = options.delimiter || '\/'; | ||
if (this.recurse) { | ||
fns.push([routes[r].before, routes[r].on].filter(Boolean)); | ||
fns.push([routes[r].before, routes[r][method]].filter(Boolean)); | ||
next.after = next.after.concat([routes[r].after].filter(Boolean)); | ||
@@ -612,0 +612,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"author": "Charlie Robbins <charlie.robbins@gmail.com>", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"maintainers": [ | ||
@@ -31,3 +31,3 @@ "hij1nx <paolo@nodejitsu.com>", | ||
"uglify-js": "2.4.x", | ||
"vows": "0.7.x" | ||
"vows": "0.8.0" | ||
}, | ||
@@ -34,0 +34,0 @@ "ender": "./build/ender.js", |
@@ -277,2 +277,3 @@ ![Logo](https://github.com/flatiron/director/raw/master/img/director.png) | ||
* [URL Parameters](#url-parameters) | ||
* [Wildcard routes](#wildcard-routes) | ||
* [Route Recursion](#route-recursion) | ||
@@ -283,4 +284,4 @@ * [Async Routing](#async-routing) | ||
* [Instance Methods](#instance-methods) | ||
* [Attach Properties to `this`](#attach-to-this) | ||
* [HTTP Streaming and Body Parsing](#http-streaming-body-parsing) | ||
* [Attach Properties to `this`](#attach-properties-to-this) | ||
* [HTTP Streaming and Body Parsing](#http-streaming-and-body-parsing) | ||
@@ -538,2 +539,11 @@ ## Constructor | ||
## Wildcard routes | ||
It is possible to define wildcard routes, so that /foo and /foo/a/b/c routes to | ||
the same handler, and gets passed `""` and `"a/b/c"` respectively. | ||
``` js | ||
router.on("/foo/?((\w|.)*)"), function (path) { }); | ||
``` | ||
## Route Recursion | ||
@@ -540,0 +550,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
197622
47
4545
963