Commit bfacfb93 authored by Robert Knight's avatar Robert Knight

Add missing types in sidebar/helpers/thread.js

parent 4fd435b8
...@@ -22,6 +22,8 @@ function countByVisibility(thread, visibility) { ...@@ -22,6 +22,8 @@ function countByVisibility(thread, visibility) {
/** /**
* Count the hidden annotations/replies in the `thread` * Count the hidden annotations/replies in the `thread`
*
* @param {Thread} thread
*/ */
export function countHidden(thread) { export function countHidden(thread) {
return countByVisibility(thread, false); return countByVisibility(thread, false);
...@@ -29,6 +31,8 @@ export function countHidden(thread) { ...@@ -29,6 +31,8 @@ export function countHidden(thread) {
/** /**
* Count the visible annotations/replies in the `thread` * Count the visible annotations/replies in the `thread`
*
* @param {Thread} thread
*/ */
export function countVisible(thread) { export function countVisible(thread) {
return countByVisibility(thread, true); return countByVisibility(thread, true);
...@@ -76,6 +80,7 @@ export function rootAnnotations(threads) { ...@@ -76,6 +80,7 @@ export function rootAnnotations(threads) {
} }
// Else, search across all children at once (an entire hierarchical level) // Else, search across all children at once (an entire hierarchical level)
/** @type {Thread[]} */
const allChildren = []; const allChildren = [];
threads.forEach(thread => { threads.forEach(thread => {
if (thread.children) { if (thread.children) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment