• Remove comment symbols from a TypeScript comment string. This also takes care of special JSDoc tags like {@link ...} and {@see ...}.

    Parameters

    • comment: string

    Returns string

    const comment = '/**\n* This is a comment.\n* It has multiple lines.\n */'; // closing comment sadly escaped for ts doc
    const cleaned = removeCommentSymbolsFromTypeScriptComment(comment);
    console.log(cleaned);

    This will output:

    This is a comment.
    It has multiple lines.