Skip to content

Commit 0cdd2a7

Browse files
manovotnyclaude
andcommitted
chore(repo): restore stripTextAfterTodo (removed in PR #8637)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9be16f7 commit 0cdd2a7

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.typedoc/comment-utils.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ function commentContainsTodo(comment) {
2222
return chunks.some(text => TODO_WORD.test(text));
2323
}
2424

25+
/**
26+
* Truncate at the first word "TODO" (case-insensitive). Used when flattening display parts to a string.
27+
*
28+
* @param {string} text
29+
*/
30+
export function stripTextAfterTodo(text) {
31+
if (!text) {
32+
return '';
33+
}
34+
const m = TODO_WORD.exec(text);
35+
if (!m) {
36+
return text;
37+
}
38+
return text.slice(0, m.index).trimEnd();
39+
}
40+
2541
/**
2642
* Drop display parts from the first `TODO` onward; truncate the containing text part if `TODO` appears mid-string.
2743
*

0 commit comments

Comments
 (0)