@@ -45,13 +45,10 @@ function pipeline() {
45
45
} ;
46
46
}
47
47
48
-
49
-
50
- function configure ( indexes , args ) /*: Promise<InputsConfig> */ {
48
+ function configure ( indexes , args ) /*: Promise<InputsConfig> */ {
51
49
let mergedConfig = mergeConfig ( args ) ;
52
50
53
51
return mergedConfig . then ( config => {
54
-
55
52
let expandedInputs = expandInputs ( indexes , config ) ;
56
53
57
54
return expandedInputs . then ( inputs => {
@@ -71,8 +68,10 @@ function configure(indexes, args)/*: Promise<InputsConfig> */ {
71
68
* @param {Object } config options
72
69
* @returns {Promise<Array<string>> } promise with results
73
70
*/
74
- function expandInputs ( indexes /*: string|Array<string> */ ,
75
- config /*: DocumentationConfig */ ) {
71
+ function expandInputs (
72
+ indexes /*: string|Array<string> */ ,
73
+ config /*: DocumentationConfig */
74
+ ) {
76
75
// Ensure that indexes is an array of strings
77
76
indexes = [ ] . concat ( indexes ) ;
78
77
@@ -91,40 +90,42 @@ function buildInternal(inputsAndConfig) {
91
90
config . access = [ 'public' , 'undefined' , 'protected' ] ;
92
91
}
93
92
94
- var parseFn = ( config . polyglot ) ? polyglot : parseJavaScript ;
93
+ var parseFn = config . polyglot ? polyglot : parseJavaScript ;
95
94
96
95
var buildPipeline = pipeline (
97
96
inferName ,
98
97
inferAccess ( config . inferPrivate ) ,
99
98
inferAugments ,
100
99
inferKind ,
100
+ nest ,
101
101
inferParams ,
102
102
inferProperties ,
103
103
inferReturn ,
104
104
inferMembership ( ) ,
105
105
inferType ,
106
- nest ,
107
106
config . github && github ,
108
- garbageCollect ) ;
107
+ garbageCollect
108
+ ) ;
109
109
110
- let extractedComments = _ . flatMap ( inputs , function ( sourceFile ) {
110
+ let extractedComments = _ . flatMap ( inputs , function ( sourceFile ) {
111
111
if ( ! sourceFile . source ) {
112
112
sourceFile . source = fs . readFileSync ( sourceFile . file , 'utf8' ) ;
113
113
}
114
114
115
115
return parseFn ( sourceFile , config ) . map ( buildPipeline ) ;
116
116
} ) . filter ( Boolean ) ;
117
117
118
- return filterAccess ( config . access ,
119
- hierarchy (
120
- sort ( extractedComments , config ) ) ) ;
118
+ return filterAccess (
119
+ config . access ,
120
+ hierarchy ( sort ( extractedComments , config ) )
121
+ ) ;
121
122
}
122
123
123
124
function lintInternal ( inputsAndConfig ) {
124
125
let inputs = inputsAndConfig . inputs ;
125
126
let config = inputsAndConfig . config ;
126
127
127
- let parseFn = ( config . polyglot ) ? polyglot : parseJavaScript ;
128
+ let parseFn = config . polyglot ? polyglot : parseJavaScript ;
128
129
129
130
let lintPipeline = pipeline (
130
131
lintComments ,
@@ -137,7 +138,8 @@ function lintInternal(inputsAndConfig) {
137
138
inferReturn ,
138
139
inferMembership ( ) ,
139
140
inferType ,
140
- nest ) ;
141
+ nest
142
+ ) ;
141
143
142
144
let extractedComments = _ . flatMap ( inputs , sourceFile => {
143
145
if ( ! sourceFile . source ) {
@@ -183,8 +185,7 @@ function lintInternal(inputsAndConfig) {
183
185
* }
184
186
* });
185
187
*/
186
- let lint = ( indexes , args ) => configure ( indexes , args )
187
- . then ( lintInternal ) ;
188
+ let lint = ( indexes , args ) => configure ( indexes , args ) . then ( lintInternal ) ;
188
189
189
190
/**
190
191
* Generate JavaScript documentation as a list of parsed JSDoc
@@ -227,8 +228,7 @@ let lint = (indexes, args) => configure(indexes, args)
227
228
* // any other kind of code data.
228
229
* });
229
230
*/
230
- let build = ( indexes , args ) => configure ( indexes , args )
231
- . then ( buildInternal ) ;
231
+ let build = ( indexes , args ) => configure ( indexes , args ) . then ( buildInternal ) ;
232
232
233
233
/**
234
234
* Documentation's formats are modular methods that take comments
@@ -240,9 +240,8 @@ let build = (indexes, args) => configure(indexes, args)
240
240
var formats = {
241
241
html : require ( './lib/output/html' ) ,
242
242
md : require ( './lib/output/markdown' ) ,
243
- remark : ( comments /*: Array<Comment> */ , config /*: DocumentationConfig */ ) =>
244
- markdownAST ( comments , config )
245
- . then ( res => JSON . stringify ( res , null , 2 ) ) ,
243
+ remark : ( comments /*: Array<Comment> */ , config /*: DocumentationConfig */ ) =>
244
+ markdownAST ( comments , config ) . then ( res => JSON . stringify ( res , null , 2 ) ) ,
246
245
json : require ( './lib/output/json' )
247
246
} ;
248
247
0 commit comments