From 230c981154b94fe9b7278aa35fe82cd1a0256703 Mon Sep 17 00:00:00 2001 From: James Prior Date: Thu, 21 Mar 2024 16:22:56 +0000 Subject: [PATCH] Fix lint issue --- src/path/selectors.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/path/selectors.ts b/src/path/selectors.ts index 5cfe63e..f5dbbc0 100644 --- a/src/path/selectors.ts +++ b/src/path/selectors.ts @@ -450,7 +450,6 @@ export class RecursiveDescentSegment extends JSONPathSelector { return rv; } - // eslint-disable-next-line sonarjs/cognitive-complexity protected nondeterministicVisitor( root: JSONPathNode, depth: number = 1, @@ -461,10 +460,10 @@ export class RecursiveDescentSegment extends JSONPathSelector { ).map((node) => [node, depth]); while (queue.length) { - const [node, depth] = queue.shift() as [JSONPathNode, number]; + const [node, _depth] = queue.shift() as [JSONPathNode, number]; rv.push(node); - if (depth >= this.environment.maxRecursionDepth) { + if (_depth >= this.environment.maxRecursionDepth) { throw new JSONPathRecursionLimitError( "recursion limit reached", this.token, @@ -479,11 +478,11 @@ export class RecursiveDescentSegment extends JSONPathSelector { rv.push(child); const grandchildren: Array<[JSONPathNode, number]> = - this.nondeterministicChildren(child).map((n) => [n, depth + 2]); + this.nondeterministicChildren(child).map((n) => [n, _depth + 2]); queue = interleave(queue, grandchildren); } else { - queue.push([child, depth + 1]); + queue.push([child, _depth + 1]); } } }