File tree Expand file tree Collapse file tree 2 files changed +19
-15
lines changed
src/generators/legacy-json Expand file tree Collapse file tree 2 files changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -49,17 +49,19 @@ export default {
4949 return section ;
5050 } ;
5151
52- await Promise . all ( headNodes . map ( async node => {
53- // Get the json for the node's section
54- const section = processModuleNodes ( node ) ;
55-
56- // Write it to the output file
57- await writeFile (
58- join ( output , `${ node . api } .json` ) ,
59- JSON . stringify ( section ) ,
60- 'utf8'
61- ) ;
62- } ) ) ;
52+ await Promise . all (
53+ headNodes . map ( async node => {
54+ // Get the json for the node's section
55+ const section = processModuleNodes ( node ) ;
56+
57+ // Write it to the output file
58+ await writeFile (
59+ join ( output , `${ node . api } .json` ) ,
60+ JSON . stringify ( section ) ,
61+ 'utf8'
62+ ) ;
63+ } )
64+ ) ;
6365
6466 return generatedValues ;
6567 } ,
Original file line number Diff line number Diff line change @@ -94,10 +94,12 @@ function parseSignature(textRaw, values) {
9494 * Extract a list of the signatures from the method's declaration
9595 * @example `[sources[, options]]`
9696 */
97- let [ , declaredParameters ] = textRaw . match ( PARAM_EXPRESSION ) || [ ] ;
97+ let [ , declaredParameters ] = `\` ${ textRaw } \`` . match ( PARAM_EXPRESSION ) || [ ] ;
9898
9999 if ( ! declaredParameters ) {
100- return ;
100+ signature . params = rawParameters ;
101+
102+ return signature ;
101103 }
102104
103105 /**
@@ -175,8 +177,8 @@ function parseSignature(textRaw, values) {
175177 for ( const otherParam of rawParameters ) {
176178 if ( declaredParameter === otherParam . name ) {
177179 // Found a matching one
178- // TODO break?
179180 parameter = otherParam ;
181+ break ;
180182 } else if ( otherParam . options ) {
181183 // Found a matching one in the parameter's options
182184 for ( const option of otherParam . options ) {
@@ -265,7 +267,7 @@ function parseListItem(child) {
265267 // Extract name
266268 if ( RETURN_EXPRESSION . test ( text ) ) {
267269 current . name = 'return' ;
268- // console.log(text)
270+
269271 let matchResult = text . match ( / ` ( .* ?) ` / ) ;
270272 if ( matchResult ) {
271273 let returnType = matchResult [ 1 ] ;
You can’t perform that action at this time.
0 commit comments