typedoc-plugin-markdown
Version:
A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
11 lines (10 loc) • 338 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripComments = void 0;
function stripComments(str) {
return str
.replace(/(?:\/\*(?:[\s\S]*?)\*\/)|(?:^\s*\/\/(?:.*)$)/g, ' ')
.replace(/\n/g, '')
.replace(/^\s+|\s+$|(\s)+/g, '$1');
}
exports.stripComments = stripComments;