Sha256: 71ca59d7aaa8c82d998a59c2c1e91f4b417e6ecc510e15c044621426d50df297

Contents?: true

Size: 852 Bytes

Versions: 27

Compression:

Stored size: 852 Bytes

Contents

/*!
 * Express - router - Collection
 * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
 * MIT Licensed
 */

/**
 * Expose `Collection`.
 */

module.exports = Collection;

/**
 * Initialize a new route `Collection`
 * with the given `router`.
 * 
 * @param {Router} router
 * @api private
 */

function Collection(router) {
  Array.apply(this, arguments);
  this.router = router;
}

/**
 * Inherit from `Array.prototype`.
 */

Collection.prototype.__proto__ = Array.prototype;

/**
 * Remove the routes in this collection.
 *
 * @return {Collection} of routes removed
 * @api public
 */

Collection.prototype.remove = function(){
  var router = this.router
    , len = this.length
    , ret = new Collection(this.router);

  for (var i = 0; i < len; ++i) {
    if (router.remove(this[i])) {
      ret.push(this[i]);
    }
  }

  return ret;
};

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
blackboard-3.1.9 lib/site_template/node_modules/express/lib/router/collection.js
vulcan-0.8.2 server/node_modules/express/lib/router/collection.js
vulcan-0.8.1 server/node_modules/express/lib/router/collection.js
vulcan-0.8.0 server/node_modules/express/lib/router/collection.js
vulcan-0.7.2 server/node_modules/express/lib/router/collection.js
vulcan-0.7.1 server/node_modules/express/lib/router/collection.js
vulcan-0.7.0 server/node_modules/express/lib/router/collection.js
vulcan-0.6.1 server/node_modules/express/lib/router/collection.js
vulcan-0.6.0 server/node_modules/express/lib/router/collection.js
vulcan-0.5.0 server/node_modules/express/lib/router/collection.js
vulcan-0.4.0 server/node_modules/express/lib/router/collection.js
vulcan-0.3.0 server/node_modules/express/lib/router/collection.js
vulcan-0.2.5 server/node_modules/express/lib/router/collection.js
vulcan-0.2.4 server/node_modules/express/lib/router/collection.js
vulcan-0.2.3 server/node_modules/express/lib/router/collection.js
vulcan-0.2.2 server/node_modules/express/lib/router/collection.js
vulcan-0.2.1 server/node_modules/express/lib/router/collection.js
vulcan-0.2.0 server/node_modules/express/lib/router/collection.js
vulcan-0.1.6 server/node_modules/express/lib/router/collection.js
vulcan-0.1.5 server/node_modules/express/lib/router/collection.js