Comparing version 1.16.1 to 1.16.2
@@ -193,3 +193,3 @@ // Generated by CoffeeScript 1.7.0 | ||
IterableResult.prototype._next = varar(0, 1, function(cb) { | ||
var fn; | ||
var fn, p; | ||
fn = (function(_this) { | ||
@@ -201,16 +201,19 @@ return function(cb) { | ||
})(this); | ||
if ((cb != null) && typeof cb !== 'function') { | ||
if (typeof cb === "function") { | ||
return fn(cb); | ||
} else if (cb === void 0) { | ||
p = new Promise(function(resolve, reject) { | ||
cb = function(err, result) { | ||
if (err) { | ||
return reject(err); | ||
} else { | ||
return resolve(result); | ||
} | ||
}; | ||
return fn(cb); | ||
}); | ||
return p; | ||
} else { | ||
throw new err.RqlDriverError("First argument to `next` must be a function or undefined."); | ||
} | ||
return new Promise(function(resolve, reject) { | ||
var nextCb; | ||
nextCb = function(err, result) { | ||
if (err) { | ||
return reject(err); | ||
} else { | ||
return resolve(result); | ||
} | ||
}; | ||
return fn(nextCb); | ||
}).nodeify(cb); | ||
}); | ||
@@ -217,0 +220,0 @@ |
{ "name" : "rethinkdb" | ||
, "version" : "1.16.1" | ||
, "version" : "1.16.2" | ||
, "main" : "rethinkdb" | ||
@@ -4,0 +4,0 @@ , "description" : "This package provides the JavaScript driver library for the RethinkDB database server for use either from node or your web-browser." |
179390
5231