From 2491ebfd093dba561dfe7c62b78e906f6d8af753 Mon Sep 17 00:00:00 2001 From: Niloy Sikdar Date: Sat, 13 Aug 2022 02:00:54 +0530 Subject: [PATCH] docs(jsdoc): add comments for generateTextEmailFromHTML Add JSDoc comments for genearteTextEmailFromHTML utility Resolves #61 Signed-off-by: Niloy Sikdar --- .../generateTextEmailFromHTML/generateTextEmailFromHTML.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/generateTextEmailFromHTML/generateTextEmailFromHTML.ts b/src/utils/generateTextEmailFromHTML/generateTextEmailFromHTML.ts index 1fcb218..0a2fed7 100644 --- a/src/utils/generateTextEmailFromHTML/generateTextEmailFromHTML.ts +++ b/src/utils/generateTextEmailFromHTML/generateTextEmailFromHTML.ts @@ -1,5 +1,11 @@ import htmlToPlainText from 'textversionjs'; +/** + * Function to convert HTML Email to Text version. + * @param {string} html - HTML which needs to be converted. + * @returns {string} Text version of the email in string format. + */ + export const generateTextEmailFromHTML = (html: string): string => { const plainText = htmlToPlainText(html, { headingStyle: 'hashify' }); return plainText;