From 4b2c35d01e971b0402ad6d3488f2ba167b2583e2 Mon Sep 17 00:00:00 2001 From: Lukas Elmer Date: Tue, 7 Feb 2023 22:21:34 +0100 Subject: [PATCH] Avoid going deeper if not needed --- app/visit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/visit.js b/app/visit.js index e362b2f..c01f79a 100644 --- a/app/visit.js +++ b/app/visit.js @@ -20,7 +20,7 @@ function visit(old, options) { const level = sortOptions.level || 1; const processing = level <= depth; - if (typeof (old) !== 'object' || old === null) { + if (typeof (old) !== 'object' || old === null || (!processing && !reverse)) { return old; }