organized level helpers ala mongo driver

This commit is contained in:
psychobunny
2014-04-11 15:47:49 -04:00
parent 46b6a93e98
commit a7582e2cca
6 changed files with 30 additions and 15 deletions

View File

@@ -69,4 +69,22 @@
}
};
var helpers = {};
helpers.iterator = function(fn, keys, value, callback) {
var results = [];
async.each(keys, function(key, next) {
module[fn](key, value, function(err, result) {
results.push(result);
next();
});
}, function(err) {
callback(err, results);
});
};
module.helpers = module.helpers || {};
module.helpers.level = helpers;
}(exports));