Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private parsedComments(key: string) {
if (!this.parsedCommentsMemo) {
let comments = parseComments(this.originalSource)
let description = '',
name = ''
if (comments.length) {
let { description: body } = comments[0]
let [line1, ...lines] = body.split('\n')
name = line1
description = lines
.filter((l: string) => l.length)
.join('\n')
.trim()
}
this.parsedCommentsMemo = { name, description }
}
return this.parsedCommentsMemo[key]
}
function sanitizeComment(comment: string): string {
const parsed = commentParser('/*' + comment + '*/');
return parsed && parsed.length > 0 ? parsed[0].source : null;
}