File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ module.exports.makeLegacyFindCursor = function (baseClass) {
2626 }
2727
2828 explain ( _verbosity , _options , _callback ) {
29- const callback = Array . from ( arguments ) . find ( argument => typeof argument === 'function' ) ;
29+ const argumentsArray = Array . from ( arguments ) ;
30+ const callback = argumentsArray . find ( argument => typeof argument === 'function' ) ;
31+ callback != null && argumentsArray . pop ( ) ;
3032 return maybeCallback ( super . explain ( ...arguments ) , callback ) ;
3133 }
3234
@@ -175,7 +177,9 @@ module.exports.makeLegacyAggregationCursor = function (baseClass) {
175177
176178 class LegacyAggregationCursor extends baseClass {
177179 explain ( _verbosity , _options , _callback ) {
178- const callback = Array . from ( arguments ) . find ( argument => typeof argument === 'function' ) ;
180+ const argumentsArray = Array . from ( arguments ) ;
181+ const callback = argumentsArray . find ( argument => typeof argument === 'function' ) ;
182+ callback != null && argumentsArray . pop ( ) ;
179183 return maybeCallback ( super . explain ( ...arguments ) , callback ) ;
180184 }
181185
You can’t perform that action at this time.
0 commit comments