Skip to content

Switch from jsdoc-parse to jsdoc-to-markdown - #3

Open
gotnone wants to merge 1 commit into
john-doherty:masterfrom
gotnone:jsdoc2md
Open

gotnone wants to merge 1 commit into
john-doherty:masterfrom
gotnone:jsdoc2md

Conversation

@gotnone

@gotnone gotnone commented Jul 15, 2020

Copy link
Copy Markdown

The jsdoc-parse version is quite old and has some vulnerabilities in its dependencies. The author of jsdoc-parse, after bumping the version to 2.x, recommends using the getTemplateData() function from his package jsdoc-to-markdown instead of the lower level jsdocParse(). This patch replaces 'jsdocParse()' with a call to jsdoc2md.getTemplateData().

@gotnone

gotnone commented Jul 15, 2020

Copy link
Copy Markdown
Author

I am not sure that this code is 100% correct. Occasionally, when calling toJsonSchema() to generate a JSON schema and return it as an object, the underlying jsdoc2md.getTemplateData() does not resolve and it neither rejects nor throws an error.

I experimented with getTemplateDataSync() and did not have any problems with my example jsdoc file, but I wanted to retain the async nature of toJsonSchema(). I am not entirely convinced that this is a problem with @75lb 's code, more than likely it is operator error on my part.

My workaround is to use something similar to promiseTimeout() to reject and then retry the parse. FWIW I am currently testing in an electron environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant