From e5ce57a76aac2f2e242dee831c792565d2eac54d Mon Sep 17 00:00:00 2001 From: Evan Hahn Date: Tue, 30 Apr 2019 17:23:29 -0500 Subject: [PATCH] Fix incorrect assertion check 8182446bfac6c55a4016255cfc86e6748ab88e41 introduced a regression. Here's the relevant part of the diff: ``` - assert(isFunction(pageCallback), - 'The first parameter to `eachPage` must be a function'); + if (!isFunction(done)) { + throw new Error('The first parameter to `eachPage` must be a function'); + } ``` This should have been checking whether `pageCallback` was a function but instead changed to `done`. I re-reviewed the original commit and didn't see any other mistakes. --- lib/query.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/query.js b/lib/query.js index 401b679e..3b89d03f 100644 --- a/lib/query.js +++ b/lib/query.js @@ -67,7 +67,7 @@ var Query = Class.extend({ * `done(error)`. */ eachPage: function(pageCallback, done) { - if (!isFunction(done)) { + if (!isFunction(pageCallback)) { throw new Error('The first parameter to `eachPage` must be a function'); }