mirror of
https://github.com/Instadapp/Swap-Aggregator-Subgraph.git
synced 2024-07-29 21:57:12 +00:00
14 lines
216 B
JavaScript
14 lines
216 B
JavaScript
'use strict'
|
|
|
|
module.exports = function count (max) {
|
|
var i = 0; max = max || Infinity
|
|
return function (end, cb) {
|
|
if(end) return cb && cb(end)
|
|
if(i > max)
|
|
return cb(true)
|
|
cb(null, i++)
|
|
}
|
|
}
|
|
|
|
|