MCPcopy Create free account
hub / github.com/Automattic/mongoose / parseFile

Function parseFile

docs/source/api.js:359–371  ·  view source on GitHub ↗

* Parse a specific file * @param {String} file The file to parse * @param {Boolean} throwErr throw the error if one is encountered?

(file, throwErr = true)

Source from the content-addressed store, hash-verified

357 * @param {Boolean} throwErr throw the error if one is encountered?
358 */
359function parseFile(file, throwErr = true) {
360 try {
361 const comments = dox.parseComments(fs.readFileSync(file, 'utf8'), { raw: true });
362 comments.file = file;
363 processFile(comments);
364 } catch (err) {
365 // show log of which file has thrown a error for easier debugging
366 console.error('Error while trying to parseComments for ', file);
367 if (throwErr) {
368 throw err;
369 }
370 }
371}
372
373function processFile(props) {
374 const { docName: name, docFileName } = processName(props.file);

Callers 1

parseAllFilesFunction · 0.85

Calls 1

processFileFunction · 0.85

Tested by

no test coverage detected