Permalink
Browse files

add collection dep

  • Loading branch information...
1 parent cb35b17 commit d13be69c3d19ca80a86caf50d0c928d20bbbf891 @tj tj committed Nov 3, 2012
Showing with 2 additions and 67 deletions.
  1. +1 −2 component.json
  2. +0 −64 lib/collection.js
  3. +1 −1 lib/static.js
View
@@ -14,7 +14,7 @@
"component/each": "*",
"component/json": "*",
"component/emitter": "*",
- "component/enumerable": "*",
+ "component/collection": "*",
"visionmedia/superagent": "*"
},
"development": {
@@ -24,7 +24,6 @@
},
"scripts": [
"lib/index.js",
- "lib/collection.js",
"lib/static.js",
"lib/proto.js"
],
View
@@ -1,64 +0,0 @@
-
-/**
- * Module dependencies.
- */
-
-var Enumerable = require('enumerable');
-
-/**
- * Expose `Collection`.
- */
-
-module.exports = Collection;
-
-/**
- * Initialize a new collection with the given `models`.
- *
- * @param {Array} models
- * @api public
- */
-
-function Collection(models) {
- this.models = models || [];
-}
-
-/**
- * Mixin enumerable.
- */
-
-Enumerable(Collection.prototype);
-
-/**
- * Iterator implementation.
- */
-
-Collection.prototype.__iterate__ = function(){
- var self = this;
- return {
- length: function(){ return self.length() },
- get: function(i){ return self.models[i] }
- }
-};
-
-/**
- * Return the collection length.
- *
- * @return {Number}
- * @api public
- */
-
-Collection.prototype.length = function(){
- return this.models.length;
-};
-
-/**
- * Add `model` to the collection and return the index.
- *
- * @param {Object} model
- * @return {Number}
- * @api public
- */
-
-Collection.prototype.push = function(model){
- return this.models.push(model);
-};
View
@@ -4,7 +4,7 @@
*/
var request = require('superagent')
- , Collection = require('./collection');
+ , Collection = require('collection');
/**
* Construct a url to the given `path`.

0 comments on commit d13be69

Please sign in to comment.