diff options
Diffstat (limited to 'lib/doDuring.js')
-rw-r--r-- | lib/doDuring.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/doDuring.js b/lib/doDuring.js index 85a69c2..cce61d0 100644 --- a/lib/doDuring.js +++ b/lib/doDuring.js @@ -1,5 +1,5 @@ import noop from 'lodash/noop'; -import rest from './internal/rest'; +import slice from './internal/slice'; import onlyOnce from './internal/onlyOnce'; import wrapAsync from './internal/wrapAsync'; @@ -28,11 +28,12 @@ export default function doDuring(fn, test, callback) { var _fn = wrapAsync(fn); var _test = wrapAsync(test); - var next = rest(function(err, args) { - if (err) return callback(err); + function next(err/*, ...args*/) { + if (err) return callback(err); + var args = slice(arguments, 1); args.push(check); _test.apply(this, args); - }); + }; function check(err, truth) { if (err) return callback(err); |