Function tsStripDeclSourceMapComments

  • Strips out TypeScript declaration source map comments from the provided code string.

    Parameters

    • code: string

      The TypeScript code string from which to strip source map comments.

    Returns string

    The cleaned TypeScript code string without source map comments.

    Remarks

    This function is useful when you want to clean up TypeScript code for readability or performance reasons.

    Example

    tsStripDeclSourceMapComments(
    ['// some code', '//# sourceMappingURL=createEncapsulatingRegex.d.ts.map', ''].join('\n')
    );
    //=> '// some code\n'

Generated using TypeDoc