How to use the comment-parser function in comment-parser

To help you get started, we’ve selected a few comment-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flood-io / element / packages / element / src / test-script / Compiler.ts View on Github external
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]
	}
github forcedotcom / lightning-language-server / packages / lwc-language-server / src / javascript / compiler.ts View on Github external
function sanitizeComment(comment: string): string {
    const parsed = commentParser('/*' + comment + '*/');
    return parsed && parsed.length > 0 ? parsed[0].source : null;
}

comment-parser

Generic JSDoc-like comment parser

MIT
Latest version published 7 months ago

Package Health Score

76 / 100
Full package analysis