Comparing version 0.2.9 to 0.2.10
@@ -33,3 +33,2 @@ // Generated by CoffeeScript 1.6.3 | ||
Projects.prototype.all = function(params, fn) { | ||
var _this = this; | ||
if (params == null) { | ||
@@ -46,10 +45,27 @@ params = {}; | ||
this.debug("Projects::all()"); | ||
if (params.page == null) { | ||
params.page = 1; | ||
} | ||
if (params.per_page == null) { | ||
params.per_page = 100; | ||
} | ||
return this.get("projects", params, function(data) { | ||
if (fn) { | ||
return fn(data); | ||
} | ||
}); | ||
return (function() { | ||
var cb, data, | ||
_this = this; | ||
data = []; | ||
cb = function(retData) { | ||
if (retData.length === 100) { | ||
_this.debug("Recurse Projects::all()"); | ||
data = data.concat(retData); | ||
params.page++; | ||
return _this.all(params, cb); | ||
} else { | ||
data = data.concat(retData); | ||
if (fn) { | ||
return fn(data); | ||
} | ||
} | ||
}; | ||
return this.get("projects/all", params, cb); | ||
}).bind(this)(); | ||
}; | ||
@@ -56,0 +72,0 @@ |
{ | ||
"name": "gitlab", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"description": "gitlab api nodejs library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
55761
42
1136