From fab4468582f2eb906cf4c4bb51cfcb0f8b865957 Mon Sep 17 00:00:00 2001 From: uzlopak Date: Mon, 9 Sep 2024 23:47:47 +0200 Subject: [PATCH] chore: improve jsdoc of lib/core/tree.js --- lib/core/tree.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core/tree.js b/lib/core/tree.js index 84293816721..e7b960cb2b3 100644 --- a/lib/core/tree.js +++ b/lib/core/tree.js @@ -40,6 +40,7 @@ class TstNode { /** * @param {string} key * @param {any} value + * @returns {void} */ add (key, value) { const length = key.length @@ -91,7 +92,7 @@ class TstNode { const keylength = key.length let index = 0 /** - * @type {TstNode} + * @type {TstNode|null} */ let node = this while (node !== null && index < keylength) { @@ -127,6 +128,7 @@ class TernarySearchTree { /** * @param {string} key * @param {any} value + * @returns {void} * */ insert (key, value) { if (this.node === null) { @@ -138,7 +140,7 @@ class TernarySearchTree { /** * @param {Uint8Array} key - * @return {any} + * @returns {any} */ lookup (key) { return this.node?.search(key)?.value ?? null