From 05eca748672c72a237881dbce00bba9a4e7f4089 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Thu, 18 May 2023 18:10:05 -0400 Subject: [PATCH] Update collection.js --- lib/drivers/node-mongodb-native/collection.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/drivers/node-mongodb-native/collection.js b/lib/drivers/node-mongodb-native/collection.js index fc9235f6f48..2fb6804c3f4 100644 --- a/lib/drivers/node-mongodb-native/collection.js +++ b/lib/drivers/node-mongodb-native/collection.js @@ -208,14 +208,14 @@ function iter(i) { if (debug) { if (typeof debug === 'function') { - let range = ''; + let argsToAdd = null; if (typeof args[args.length - 1] == 'function') { - range = args.slice(0, args.length - 1); + argsToAdd = args.slice(0, args.length - 1); } else { - range = args.slice(0, args.length); + argsToAdd = args; } debug.apply(_this, - [_this.name, i].concat(range)); + [_this.name, i].concat(argsToAdd)); } else if (debug instanceof stream.Writable) { this.$printToStream(_this.name, i, args, debug); } else {