Function tsDocUnwrapComment

  • Unwraps a TSDoc block comment, removing the comment markers and leading asterisks. Throws an error if the provided string is not a valid TSDoc block comment.

    Parameters

    • code: string

      The TSDoc block comment to unwrap.

    Returns string

    The unwrapped TSDoc comment.

    Remarks

    This function will throw an error if the provided string is not a valid TSDoc block comment.

    Throws

    Will throw an error if the provided code is not a valid TSDoc comment.

    Example

    const actual = tsDocUnwrapComment([
    '/**',
    ' * Checks if the provided (...)',
    ' * @remarks This function (...)',
    ' * @param code The source (...)',
    ' * @returns A boolean ind (...)',
    ' */',
    ].join('\n'))
    const expected = [
    'Checks if the provided (...)',
    '@remarks This function (...)',
    '@param code The source (...)',
    '@returns A boolean ind (...)',
    ].join('\n')
    actual === expected
    //=> true

Generated using TypeDoc