Skip to content
This repository
Browse code

add collection dep

  • Loading branch information...
commit d13be69c3d19ca80a86caf50d0c928d20bbbf891 1 parent cb35b17
TJ Holowaychuk visionmedia authored

Showing 3 changed files with 2 additions and 67 deletions. Show diff stats Hide diff stats

  1. +1 2  component.json
  2. +0 64 lib/collection.js
  3. +1 1  lib/static.js
3  component.json
@@ -14,7 +14,7 @@
14 14 "component/each": "*",
15 15 "component/json": "*",
16 16 "component/emitter": "*",
17   - "component/enumerable": "*",
  17 + "component/collection": "*",
18 18 "visionmedia/superagent": "*"
19 19 },
20 20 "development": {
@@ -24,7 +24,6 @@
24 24 },
25 25 "scripts": [
26 26 "lib/index.js",
27   - "lib/collection.js",
28 27 "lib/static.js",
29 28 "lib/proto.js"
30 29 ],
64 lib/collection.js
... ... @@ -1,64 +0,0 @@
1   -
2   -/**
3   - * Module dependencies.
4   - */
5   -
6   -var Enumerable = require('enumerable');
7   -
8   -/**
9   - * Expose `Collection`.
10   - */
11   -
12   -module.exports = Collection;
13   -
14   -/**
15   - * Initialize a new collection with the given `models`.
16   - *
17   - * @param {Array} models
18   - * @api public
19   - */
20   -
21   -function Collection(models) {
22   - this.models = models || [];
23   -}
24   -
25   -/**
26   - * Mixin enumerable.
27   - */
28   -
29   -Enumerable(Collection.prototype);
30   -
31   -/**
32   - * Iterator implementation.
33   - */
34   -
35   -Collection.prototype.__iterate__ = function(){
36   - var self = this;
37   - return {
38   - length: function(){ return self.length() },
39   - get: function(i){ return self.models[i] }
40   - }
41   -};
42   -
43   -/**
44   - * Return the collection length.
45   - *
46   - * @return {Number}
47   - * @api public
48   - */
49   -
50   -Collection.prototype.length = function(){
51   - return this.models.length;
52   -};
53   -
54   -/**
55   - * Add `model` to the collection and return the index.
56   - *
57   - * @param {Object} model
58   - * @return {Number}
59   - * @api public
60   - */
61   -
62   -Collection.prototype.push = function(model){
63   - return this.models.push(model);
64   -};
2  lib/static.js
@@ -4,7 +4,7 @@
4 4 */
5 5
6 6 var request = require('superagent')
7   - , Collection = require('./collection');
  7 + , Collection = require('collection');
8 8
9 9 /**
10 10 * Construct a url to the given `path`.

0 comments on commit d13be69

Please sign in to comment.
Something went wrong with that request. Please try again.