From c5935645beffa3a08313b452314e9a2a4dad5d95 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Fri, 16 Aug 2024 23:53:00 +0200 Subject: [PATCH] fix: add jsdoc in tree.js, avoiding codesmells (#3476) --- lib/core/tree.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/core/tree.js b/lib/core/tree.js index 17dfca4cc4e..84293816721 100644 --- a/lib/core/tree.js +++ b/lib/core/tree.js @@ -47,6 +47,9 @@ class TstNode { throw new TypeError('Unreachable') } let index = 0 + /** + * @type {TstNode} + */ let node = this while (true) { const code = key.charCodeAt(index) @@ -87,6 +90,9 @@ class TstNode { search (key) { const keylength = key.length let index = 0 + /** + * @type {TstNode} + */ let node = this while (node !== null && index < keylength) { let code = key[index]