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

Function parseFile

docs/source/api.js:228–240  ·  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

226 * @param {Boolean} throwErr throw the error if one is encountered?
227 */
228function parseFile(file, throwErr = true) {
229 try {
230 const comments = dox.parseComments(fs.readFileSync(file, 'utf8'), { raw: true });
231 comments.file = file;
232 processFile(comments);
233 } catch (err) {
234 // show log of which file has thrown a error for easier debugging
235 console.error('Error while trying to parseComments for ', file);
236 if (throwErr) {
237 throw err;
238 }
239 }
240}
241
242function processFile(props) {
243 const { docName: name, docFileName } = processName(props.file);

Callers 1

parseAllFilesFunction · 0.85

Calls 1

processFileFunction · 0.85

Tested by

no test coverage detected