From a5feb38496c2598a5ee64ae4dde2c8261ddd711e Mon Sep 17 00:00:00 2001 From: linonetwo Date: Tue, 10 Sep 2024 16:15:35 +0800 Subject: [PATCH] feat: add an example jsdoc to $tw.wiki.getTiddlerText --- core/modules/wiki.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 587ca8cad..e6765ebf8 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -1494,9 +1494,13 @@ exports.search = function(text,options) { return results; }; -/* -Trigger a load for a tiddler if it is skinny. Returns the text, or undefined if the tiddler is missing, null if the tiddler is being lazily loaded. -*/ +/** + * Trigger a load for a tiddler if it is skinny. Returns the text, or undefined if the tiddler is missing, null if the tiddler is being lazily loaded. + * + * @param {string} title - The title of the tiddler. + * @param {string} [defaultText] - The default text to return if the tiddler is missing. + * @returns {string | null | undefined} - The text of the tiddler, undefined if the tiddler is missing, or null if the tiddler is being lazily loaded. + */ exports.getTiddlerText = function(title,defaultText) { var tiddler = this.getTiddler(title); // Return undefined if the tiddler isn't found