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