Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gotnone
Copy link

@gotnone gotnone commented Jul 15, 2020

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
Copy link
Author

gotnone commented Jul 15, 2020

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