We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9be16f7 commit 0cdd2a7Copy full SHA for 0cdd2a7
1 file changed
.typedoc/comment-utils.mjs
@@ -22,6 +22,22 @@ function commentContainsTodo(comment) {
22
return chunks.some(text => TODO_WORD.test(text));
23
}
24
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
+
41
/**
42
* Drop display parts from the first `TODO` onward; truncate the containing text part if `TODO` appears mid-string.
43
*
0 commit comments