Skip to content

Commit

Permalink
[ci-skip] added some javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Tcharl committed Jan 20, 2023
1 parent 3e236f8 commit 781a433
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions generators/base/support/templates/doc-formatters.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,30 @@
* limitations under the License.
*/

/**
* Converts text to an array of lines.
* @param text the text to convert
* @return {*} the array of lines
*/
const textToArray = text => {
return text.split('\n');
};

/**
* Checks if a string is null, undefined or empty.
* @param str the string to check
* @return {boolean} true if the string is null, undefined or empty, false otherwise
*/
const stringNullOrEmpty = str => {
return str === null || str === undefined || str.trim() === '';
};

/**
* Verifies is the text is wrapped between ><: used in Api docs and liquibase changelogs templates.
* @param previousLine the previous line (potentially finishing with the wrapper character '>'
* @param text the text to check, which should not begin with the closing wrapper character '<'
* @return {boolean} true if the text is considered wrapped, false otherwise
*/
const isSimpleText = (previousLine, text) => {
return !previousLine.endsWith('>') && !text.startsWith('<');
};
Expand Down

0 comments on commit 781a433

Please sign in to comment.