File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,24 @@ var shouldSkipInference = require('./should_skip_inference'),
55 finders = require ( './finders' ) ,
66 flowDoctrine = require ( '../flow_doctrine' ) ;
77
8+ /**
9+ * Babel parses JavaScript source code and produces an abstract syntax
10+ * tree that includes methods and their arguments. This function takes
11+ * that AST and uses it to infer details that would otherwise need
12+ * explicit documentation, like the names of comments and their
13+ * default values.
14+ *
15+ * It is especially careful to allow the user and the machine to collaborate:
16+ * documentation.js should not overwrite any details that the user
17+ * explicitly sets.
18+ *
19+ * @private
20+ * @param {Object } param the abstract syntax tree of the parameter in JavaScript
21+ * @param {Object } comment the full comment object
22+ * @param {number } i the number of this parameter, in argument order
23+ * @param {string } prefix of the comment, if it is nested, like in the case of destructuring
24+ * @returns {Object } parameter with inference.
25+ */
826function paramToDoc ( param , comment , i , prefix ) {
927
1028 prefix = prefix || '' ;
Original file line number Diff line number Diff line change @@ -2,6 +2,17 @@ var fs = require('fs');
22var path = require ( 'path' ) ;
33var _ = require ( 'lodash' ) ;
44
5+ /**
6+ * Given a list of indexes, expand those indexes that are paths
7+ * to directories into sub-lists of files. This does _not_ work
8+ * recursively and will throw an error if an index is not found
9+ *
10+ * @private
11+ * @throws {Error } if index is not found
12+ * @param {Array<Object|string> } indexes entry points given to documentatino
13+ * @param {Function } filterer method that avoids evaluating non-JavaScript files
14+ * @returns {Array<Object|string> } flattened array of file sources
15+ */
516function expandDirectories ( indexes , filterer ) {
617 return _ . flatMap ( indexes , function ( index ) {
718 if ( typeof index !== 'string' ) {
You can’t perform that action at this time.
0 commit comments