File tree 2 files changed +29
-0
lines changed
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'),
5
5
finders = require ( './finders' ) ,
6
6
flowDoctrine = require ( '../flow_doctrine' ) ;
7
7
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
+ */
8
26
function paramToDoc ( param , comment , i , prefix ) {
9
27
10
28
prefix = prefix || '' ;
Original file line number Diff line number Diff line change @@ -2,6 +2,17 @@ var fs = require('fs');
2
2
var path = require ( 'path' ) ;
3
3
var _ = require ( 'lodash' ) ;
4
4
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
+ */
5
16
function expandDirectories ( indexes , filterer ) {
6
17
return _ . flatMap ( indexes , function ( index ) {
7
18
if ( typeof index !== 'string' ) {
You can’t perform that action at this time.
0 commit comments